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

dart-lang/sdk

Measured 13 November 2026, 10:25 UTC, at code version 0b75423

First survey, so nothing to compare with yet
CAI score 37out of 100 Weak
CriticalWeakAdequateStrongExemplary

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

A very large codebase: 2,096,576 lines of product code in 90 projects, tests not counted · Estimated rebuild effort: about 34.9 person-years · Weakest lens: Code Health, 26

Findings by how serious they are

50 critical 18034 serious 246 minor

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

This survey was produced by

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

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

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

73of 73 dimensions measured by tools.
18275of 18330 findings point to an exact file and line, so you can open each one in the code. The other 55 concern the repository as a whole, such as missing documentation.
73dimensions across 8 lenses, read from 2,096,576 lines of product code in 90 projects.
Chapters

Executive summary

dart-lang/sdk falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 37 out of 100 and is rated Weak, and 18 of its 50 critical findings are security problems.

Code Health, at 26, is the weakest lens and counts most in the score. The best first steps are adding type checking and splitting the oversized files, each worth about 4 points. Raising Code Health to 70 would lift the score to about 45.

Fourteen passwords or keys are open to anyone who can read the repository. Two places in the code run text as code, which an attacker could use, and twenty-three parts of the code are no longer understood by anyone working on it. Replacing each exposed password or key, replacing text run as code with direct calls and having someone learn the forgotten files would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and switching the validation back on would deal with the security check on connections or logins switched off. The three pages that don't say their language need their language set.

The product code is 2,096,576 lines, about €5,100,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 26 · counts for 45%Security and Compliance 38 · counts for 25%Accessibility 39 · counts for 14%Production Readiness 59 · counts for 8%Performance 60 · counts for 4%Domain Modelling 61 · counts for 2%Maturity 73 · counts for 1%Architecture 93 · counts for 1%

If Code Health rose from 26 to 70, the lowest score rated Strong, the score would rise from 37 to about 45.

Code composition: what the lines of code are
Product code 42%Tests 58%
Rebuild cost: about €5,100,000 · Estimate
Cost to rebuild€1,700,000 to €8,500,000, for 28,124 to 89,220 hours of work, about 34.9 person-years for 20 to 67 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 37. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 2,096,576 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 4 points · Medium effort · Type Safety
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4 points · Medium effort · Large Files
3
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
Raises the score by about 3 points · Medium effort · Dead Code

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €5,100,000 to build again, about 34.9 person-years of work. Its weakest lens is Code Health, at 26 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change.
How this is estimated: It rests on an assumption of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch _fe_analyzer_shared _fe_analyzer_shared meta meta _fe_analyzer_shared->meta analysis_server analysis_server analysis_server->_fe_analyzer_shared analyzer analyzer analysis_server->analyzer analysis_server->meta vm_service vm_service analysis_server->vm_service analyzer->_fe_analyzer_shared analyzer->meta compiler compiler compiler->_fe_analyzer_shared front_end front_end compiler->front_end kernel kernel compiler->kernel compiler->meta compiler->vm_service dap_adapters dap_adapters dds_service_extensions dds_service_extensions dap_adapters->dds_service_extensions dap_adapters->meta dap_adapters->vm_service dart2wasm dart2wasm dart2wasm->_fe_analyzer_shared dart2wasm->analyzer dart2wasm->compiler dart2wasm->front_end dart2wasm->kernel dart2wasm->meta vm vm dart2wasm->vm dart_runtime_service dart_runtime_service dds dds dart_runtime_service->dds dart_runtime_service->dds_service_extensions dart_runtime_service->meta dart_runtime_service->vm_service dart_runtime_service_dds dart_runtime_service_dds dart_runtime_service_dds->dap_adapters dart_runtime_service_dds->dart_runtime_service dart_runtime_service_dds->dds dart_runtime_service_dds->dds_service_extensions dart_runtime_service_dds->meta dart_runtime_service_dds->vm_service dartdev dartdev dartdev->analysis_server dartdev->analyzer dartdev->dap_adapters dartdev->dart_runtime_service_dds dartdev->dds_service_extensions dtd_impl dtd_impl dartdev->dtd_impl dartdev->front_end frontend_server frontend_server dartdev->frontend_server dartdev->kernel dartdev->meta dartdev->vm dartdev->vm_service dartpad_worker dartpad_worker dartpad_worker->analysis_server dartpad_worker->analyzer dartpad_worker->dart_runtime_service dartpad_worker->frontend_server dartpad_worker->vm_service dds->dap_adapters dds->dds_service_extensions dds->meta dds->vm_service dds_service_extensions->vm_service dev_compiler dev_compiler dev_compiler->_fe_analyzer_shared dev_compiler->front_end dev_compiler->kernel dtd_impl->dds dtd_impl->meta dtd_impl->vm_service front_end->_fe_analyzer_shared front_end->kernel frontend_server->compiler frontend_server->dart2wasm frontend_server->dev_compiler frontend_server->front_end frontend_server->kernel frontend_server->vm kernel->_fe_analyzer_shared vm->front_end vm->kernel __more__ +61 more projects

Architecture: which parts of the code depend on which

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

157 modules, with 225 dependencies between them. One loop runs through 34 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 channel2 typed_data3 collection4 convert5 front_end6 metadata7 runtime8 source9 target10 internal11 core12 async13 exception14 file_system15 modular16 protocol17 svg18 text19 utils20 back_end21 html22 io23 transformations24 utilities25 _http26 instrumentation27 passes28 edit29 ir30 cfg31 src32 dart33 snapshot34 analysis_rule35 plugin36 repository37 binary38 embedder39 js_interop40 _internal
1 channel
2 typed_data
3 collection716
4 convert124
5 front_end169
6 metadata91
7 runtime313
8 source1
9 target95
10 internal11322
11 core13
12 async32
13 exception2
14 file_system2
15 modular7114330
16 protocol11
17 svg15
18 text21377
19 utils12
20 back_end524122
21 html8951
22 io11616721
23 transformations1621728358
24 utilities111021615
25 _http2351461
26 instrumentation1
27 passes231118
28 edit1152521
29 ir11032478
30 cfg112
31 src255464215149154961416361867112970917582771368
32 dart3112105
33 snapshot213312
34 analysis_rule51
35 plugin127112
36 repository64711351802721517141215158923231
37 binary111444
38 embedder1314
39 js_interop31
40 _internal731161079321011
Uses a module listed above itPart of a loopThe module itself
1 channel2 typed_data3 collection4 convert5 front_end6 metadata7 runtime8 source9 target10 internal11 core12 async13 exception14 file_system15 modular16 protocol17 svg18 text19 utils20 back_end21 html22 io23 transformations24 utilities25 _http26 instrumentation27 passes28 edit29 ir30 cfg31 src32 dart33 snapshot34 analysis_rule35 plugin36 repository37 binary38 embedder39 js_interop40 _internalchannel1typed_data2collection3convert4front_end5metadata6runtime7source8target9internal10core11async12exception13file_system14modular15protocol16svg17text18utils19back_end20html21io22transformations23utilities24_http25instrumentation26passes27edit28ir29cfg30src31dart32snapshot33analysis_rule34plugin35repository36binary37embedder38js_interop39_internal40716124169913131951132213322271143301115213771252412289511161672116217283581110216152351461123111811525211103247811225546421514915496141636186711297091758277136831121052133125112711264711351802721517141215158923231111444131431731161079321011+117 more modules (most-connected shown)

At a glance — Code Health · 26% · Weak · gated by D2, R1, R3, R7 ·

At a glance — Architecture · 93% · Exemplary ·

At a glance — Maturity · 73% · Strong ·

At a glance — Readiness · 59% · Adequate · gated by P7 ·

At a glance — Security · 38% · Weak · gated by D28, D29, D36, S1 ·

At a glance — Domain Modelling · 61% · Adequate · gated by DM6 ·

At a glance — Accessibility · 39% · Weak · gated by AC3 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection17High / Critical
A07:2025 — Authentication Failures15High / Critical
A03:2025 — Software Supply Chain Failures4Medium

Roadmap

Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.

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

Do thisHelpsEffortDimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+4.3 ptsMediumType Safety
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+4.3 ptsMediumLarge Files
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.+3.4 ptsMediumDead Code
Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off.+3.2 ptsMediumWeb-Security Posture
Resolve the 6685 TodoComment finding(s) in Explicit Debt — start with builder.dart (136), add_missing_switch_cases_test.dart (99), compiler_new.dart (99).+3.1 ptsHighExplicit Debt
Resolve the 14 REDACTED finding(s) in Secrets (history) — start with REDACTED (7), REDACTED (5), REDACTED.+2.6 ptsMediumSecrets (history)
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+2.5 ptsMediumPage structure
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+2.1 ptsMediumVisual & motion safety

File quality

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

FileScoreBandWorst signal
pkg/vm_service/lib/src/vm_service.dart4.0MixedCyclomatic Complexity: Instance.toJson (cyclomatic 40)
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
pkg/kernel/lib/src/ast/constants.dart4.0MixedCognitive Complexity: TypedefTearOffConstant.== (cognitive 16)
REDACTED4.1MixedStatic Analysis (SAST): Medium: REDACTED
sdk/lib/_internal/vm/lib/mirrors_impl.dart4.1MixedGod Classes: FileTooLong: lib/mirrors_impl.dart
pkg/front_end/lib/src/type_inference/body_inference_context.dart4.2MixedCyclomatic Complexity: _AsyncContext._checkValidReturn (cyclomatic 16)
pkg/front_end/lib/src/fragment/enum_element.dart4.2MixedGod Classes: TooManyMethods: EnumElementDeclaration
pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart4.2MixedGod Classes: FileTooLong: resource_provider/resource_provider_file.dart
runtime/tools/dartfuzz/dartfuzz_type_table.dart4.2MixedGod Classes: FileTooLong: dartfuzz/dartfuzz_type_table.dart
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
pkg/front_end/lib/src/type_inference/delayed_expressions.dart4.3MixedCognitive Complexity: DelayedInstanceGet.createExpression (cognitive 21)
pkg/observatory/lib/src/elements/heap_snapshot.dart4.4MixedCyclomatic Complexity: HeapSnapshotElement._createReport (cyclomatic 27)
pkg/dart2wasm/lib/constants.dart4.4MixedCyclomatic Complexity: ConstantCreator._makeWasmArrayLiteral (cyclomatic 20)
pkg/kernel/lib/src/ast/declarations.dart4.4MixedGod Classes: TooManyMethods: Class
pkg/wasm_builder/lib/src/ir/type.dart4.6MixedGod Classes: FileTooLong: ir/type.dart
REDACTED4.6MixedSecrets (history): REDACTED: REDACTED
pkg/dart2wasm/lib/code_generator.dart4.8MixedCyclomatic Complexity: SwitchInfo.SwitchInfo (cyclomatic 51)
pkg/dart2wasm/lib/translator.dart4.8MixedCyclomatic Complexity: Translator.translateStorageType (cyclomatic 32)
pkg/vm/lib/modular/transformations/ffi/native_type_cfe.dart4.8MixedCyclomatic Complexity: NativeTypeCfe.NativeTypeCfe (cyclomatic 18)
pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart4.8MixedGod Classes: ClassTooLong: ElementBindingVisitor

How the grades work

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

Critical — 50

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 — 18034

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 — 246

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

Could not be resolved — 13

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

Methodology & how to trust this report

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

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

What we checked — 73 dimensions across the health lenses
D1D2D3D4D5D6D13D15D16D17D19D20D24D26D28D29D34D35D36D37D44AC2AC3AC6AX10AX3AX5AX8AX9C2DM2DM5DM6GD1IC1M1M2M3M4P1P10P2P3P6P7PF3R1R10R2R3R7R9S1X1X12X13X14X15X16X17X19X2X20X21X23X25X27X28X29X3X30X4X5

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d470-f786-7df8-a95d-07540237a1a5.

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

Run transparency — what happened this run

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

  • D4 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2226 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .cc (333,797 lines, 13% of production source), .c (146,156 lines, 6% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.py, .dart) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .dart) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's dependency manifest (a Dart pubspec.yaml) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • D14 License Compliance — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository declares a pubspec.yaml, commits no pubspec.lock, and its dependencies: block names only SDK, path and git packages, none of which has a registry release whose licence this pass can read. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (pkg/vm_service_protos/pubspec.yaml), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Project size and spread are measured over build units whose source a code model reads. This repository's .cc, .c source is a material share of its production lines and was read by none, so the score is a verdict about the units that were read. Not a finding that the unread source is cohesive — it is unmeasured.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `pkg/analysis_server/tool/performance/scenarios/logs/DAS-test1-norm.json`, `pkg/analysis_server/tool/performance/scenarios/logs/package_build_find_references.json`, `pkg/analysis_server/tool/performance/scenarios/logs/sdk_rename_driver_class.json` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in pkg/vm_service_interface/lib/src/vm_service_interface.dart, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 12 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 320 further occurrence(s) are not listed individually; the score already reflects all 360.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 571 further occurrence(s) are not listed individually; the score already reflects all 611.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 189 further occurrence(s) are not listed individually; the score already reflects all 229.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity4.5 / 10Weak✓ Tool-verified

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

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

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

1201 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Intrinsifier.generateStaticIntrinsic at 409. A further 118 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 AstBinaryReader._readNode at 111 — they are counted neither in the figure above nor in this dimension's score. 39 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: pkg/analyzer/lib/src/summary2/ast_binary_reader.dart (AstBinaryReader._readNode at 111), pkg/front_end/testcases/patterns/const_patterns.dart (Class.test at 100), pkg/front_end/parser_testcases/patterns/const_patterns.dart (Class.test at 94), pkg/kernel/lib/binary/ast_from_binary.dart (BinaryBuilder.readExpression at 84), pkg/compiler/lib/src/common/codegen.dart (JsNodeDeserializer.read at 65), and 34 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.

_ChunkedJsonParser.parseNumber (cyclomatic 42) · ×3sdk/lib/_internal/vm/lib/convert_patch.dart:1303
_ChunkedJsonParser.parsePartialNumber (cyclomatic 25) · ×3sdk/lib/_internal/vm/lib/convert_patch.dart:640
_BigIntImpl.toDouble (cyclomatic 16) · ×3sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1884
_BigIntImpl._binaryGcd (cyclomatic 77) · ×2sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504
AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cyclomatic 22) · ×2pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1386

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

What to do

  1. Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with Intrinsifier.generateStaticIntrinsic (cyclomatic 409), Instruction.deserialize (cyclomatic 241). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 4.5 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

D2 · Cognitive Complexity3.9 / 10Weak✓ Tool-verified

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

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

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

2341 method(s) exceeded the cognitive complexity threshold of 15; the worst was AstWriter._computeProperties at 690.

_ChunkedJsonParser.parseNumber (cognitive 96) · ×3sdk/lib/_internal/vm/lib/convert_patch.dart:1303
_ChunkedJsonParser.parsePartialNumber (cognitive 47) · ×3sdk/lib/_internal/vm/lib/convert_patch.dart:640
_BigIntImpl.toDouble (cognitive 33) · ×3sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1884
_Visitor.visitMethodDeclaration (cognitive 17) · ×3pkg/linter/lib/src/rules/avoid_returning_this.dart:69
_BigIntImpl._binaryGcd (cognitive 181) · ×2sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504

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

What to do

  1. Bring the 5 bodies over 240 down to 240 or less in Cognitive Complexity — start with AstWriter._computeProperties (cognitive 690), RequirementsManifest.isSatisfied (cognitive 333), _Processor.calculate (cognitive 271). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cognitive Complexity from 3.9 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

D3 · God Classes8.5 / 10Strong✓ Tool-verified

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

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

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

1456 god class(es) detected.

FileTooLong: dartfuzz/dartfuzz_type_table.dart · ×441runtime/tools/dartfuzz/dartfuzz_type_table.dart
TooManyMethods: InstructionsBuilder · ×433pkg/wasm_builder/lib/src/builder/instructions.dart:156
MethodTooLong: Intrinsifier.generateStaticIntrinsic · ×326pkg/dart2wasm/lib/intrinsics.dart:1355
ClassTooLong: DartType · ×252runtime/tools/dartfuzz/dartfuzz_type_table.dart:9
FunctionTooLong: graphexplorer.showTables · ×4runtime/tools/graphexplorer/graphexplorer.js:1835

What to do

  1. Resolve the 441 FileTooLong finding(s) in God Classes — start with types.dart (6), encoding.dart (6), builder.dart (4). — One of this dimension's main actionable groups (441 warning-level).
  2. Resolve the 433 TooManyMethods finding(s) in God Classes — start with element.dart (13), nodes.dart (11), ast.dart (10). — One of this dimension's main actionable groups (433 warning-level).
  3. Resolve the 326 MethodTooLong finding(s) in God Classes — start with inference_visitor.dart (29), inference_visitor_base.dart (12), builder.dart (7). — One of this dimension's main actionable groups (326 warning-level).

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

D4 · Code Duplication9.5 / 10Stronggated by 4521 serious findings✓ Tool-verified

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.

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

2226 duplicated block group(s) detected. A further 2295 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 83 of the 4521 are in trees this repository does not ship — vendored, example/demo, project-template, 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. Measured on part of this repository only: .cc, .c (19% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.

Duplicated block (7 lines × 2) · ×136pkg/_fe_analyzer_shared/lib/src/testing/id.dart:141
Duplicated block (8 lines × 2) · ×130pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:403
Duplicated block (9 lines × 2) · ×123pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:598
Duplicated block (10 lines × 2) · ×108pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:975
Duplicated block (11 lines × 2) · ×105pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200

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

What to do

  1. Resolve the 136 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with compiler.dart (15), element_map_impl.dart (7), typed_data_patch.dart (6). — One of this dimension's main actionable groups (136 warning-level).
  2. Resolve the 130 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with compiler.dart (10), native_typed_data.dart (10), compact_hash.dart (6). — One of this dimension's main actionable groups (130 warning-level).
  3. Resolve the 123 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with relevance_metrics.dart (12), compiler.dart (9), builder.dart (4). — One of this dimension's main actionable groups (123 warning-level).

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

D5 · Coupling8.4 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

81 production modules (pub), 1 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 13 module(s) off the main sequence, with abstractness counted on 67 of the 81 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Circular dependency
Off the main sequence: js_runtime · ×12
Off the main sequence: _fe_analyzer_shared

What to do

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

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

D6 · Cohesion (LCOM4)7.9 / 10Strong✓ Tool-verified

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

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

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

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

1340 of 7838 classes have LCOM4 above 3.

Low cohesion: WrapperClass (LCOM4 69) · ×1340pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart:2

What to do

  1. Resolve the 1340 Low cohesion finding(s) in Cohesion (LCOM4) — start with ast.dart (262), nodes.dart (72), expressions.dart (67). — One of this dimension's main actionable groups (1340 warning-level).

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

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

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

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

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.7 / 10Stronggated by 152 serious findings✓ Tool-verified

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

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

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

Top hotspots: pkg/analyzer/lib/src/dart/ast/ast.dart (148×78=11544); pkg/dart2wasm/lib/intrinsics.dart (17×409=6953); pkg/analyzer/lib/src/generated/error_verifier.dart (76×38=2888) Repeated repair below the complexity floor: pkg/dart2wasm/lib/record_class_generator.dart (8 of 9 changes were fixes); pkg/kernel/lib/binary/ast_from_binary.dart (7 of 12 changes were fixes); pkg/vm/lib/modular/transformations/ffi/native.dart (5 of 6 changes were fixes)

Hotspot: pkg/analyzer/lib/src/dart/ast/ast.dart · ×135pkg/analyzer/lib/src/dart/ast/ast.dart:62253
Repeated repair: pkg/dart2wasm/lib/record_class_generator.dart · ×17pkg/dart2wasm/lib/record_class_generator.dart:395

What to do

  1. Resolve the 135 Hotspot finding(s) in Churn × Complexity Hotspots — start with code_generator.dart (2), driver.dart (2), to_wasm.dart (2). — One of this dimension's main actionable groups (135 warning-level).
  2. Resolve the 17 Repeated repair finding(s) in Churn × Complexity Hotspots — start with record_class_generator.dart, ast_from_binary.dart, native.dart. — One of this dimension's main actionable groups (17 warning-level).

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

D16 · Bus Factor8.9 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

313 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart. Counted over 2907 of the 10144 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×23
Further sole-owners (lower concentration)

What to do

  1. Resolve the 23 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (23 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt9.3 / 10Stronggated by 6763 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×6685PRESUBMIT.py:151
FixmeComment · ×39tools/dom/src/native_DOMImplementation.dart:331
HackComment · ×33tools/dom/scripts/htmldartgenerator.py:556
TodoComment repeated across 16 filestests/lib/mirrors/abstract_class_test.dart:5
TodoComment repeated across 155 filestests/language/variable/bad_initializer1_runtime_test.dart:1

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

What to do

  1. Resolve the 6685 TodoComment finding(s) in Explicit Debt — start with builder.dart (136), add_missing_switch_cases_test.dart (99), compiler_new.dart (99). — One of this dimension's main actionable groups (6685 warning-level).
  2. Resolve the 39 FixmeComment finding(s) in Explicit Debt — start with non_utf8_file_test.dart (4), non_utf8_link_test.dart (4), directory_impl.dart (4). — One of this dimension's main actionable groups (39 warning-level).
  3. Resolve the 33 HackComment finding(s) in Explicit Debt — start with htmldartgenerator.py (3), static_separate_lib1.dart (3), lib1.dart (3). — One of this dimension's main actionable groups (33 warning-level).

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

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

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

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

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

1 of 1 documentation facets pass in full. 293 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundsdk/lib/_internal/vm/bin/builtin.dart:1

What to do

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

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

D24 · Comment Value9.7 9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 97% · ceiling Documented

1 of 361 judged comments only repeat the code they sit on (0.3 %). 16 comment(s) in another language or script were not judged.

redundant commentREDACTED:701
doc comments repeat the namesbenchmarks/Richards/javascript/Richards.js:252

✓ On the Gold path — maintain.

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

D26 · Project Cohesion5.3 / 10Adequate✓ Tool-verified

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

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

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

21 of 90 build units (pub) flagged as possibly oversized/incoherent. This repository's .cc, .c source was read by no build unit, so this covers part of the tree, not all of it.

Projects may be oversized for their cohesion

What to do

  1. 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.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

17 finding(s): 0 critical, 3 high, 7 medium, 7 low. semgrep hit a parse error in 56 file(s) — `pkg/analysis_server/tool/performance/scenarios/logs/DAS-test1-norm.json`, `pkg/analysis_server/tool/performance/scenarios/logs/package_build_find_references.json`, `pkg/analysis_server/tool/performance/scenarios/logs/project_pigeon_format_generated_file.json`, `pkg/analysis_server/tool/performance/scenarios/logs/sdk_rename_driver_class.json`, `pkg/analysis_server/tool/spec/spec_input.html` (lines 4093–4095), … (+51 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D34 · Knowledge Freshness9.4 / 10Adequategated by 23 critical findings✓ Tool-verified

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

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

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

160 of 2907 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is runtime/tools/dartfuzz/dartfuzz_api_table.dart. Counted over 2907 of the 10144 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×23runtime/tools/dartfuzz/dartfuzz_api_table.dart:1
Orphaned file · ×137pkg/vm_service/lib/src/snapshot_graph.dart:1
Further orphaned files (smaller)

What to do

  1. Resolve the 23 Orphaned knowledge finding(s) in Knowledge Freshness — start with dartfuzz_api_table.dart, systemhtml.py, convert_patch.dart. — One of this dimension's main actionable groups (23 issue-level).
  2. Resolve the 137 Orphaned file finding(s) in Knowledge Freshness — start with closure.dart (2), convert_patch.dart (2), developer_patch.dart (2). — One of this dimension's main actionable groups (137 recommendation-level).
  3. 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.

D35 · Change Coupling9.8 / 10Stronggated by 40 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: run.dart↔test.dart 100%; code_generator.dart↔constraints.dart 97%; assist.dart↔assist_internal.dart 92%

Change coupling: run.dart ↔ test.dart · ×34pkg/dartdev/lib/src/commands/run.dart:1
Change-coupling hub: code_generator.dart → constraints.dart, recognized_methods.dart, lowering.dart · ×6pkg/native_compiler/lib/back_end/arm64/code_generator.dart

What to do

  1. Resolve the 34 Change coupling finding(s) in Change Coupling — start with best_practices_verifier.dart (2), run.dart, assist.dart. — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 6 Change-coupling hub finding(s) in Change Coupling — start with code_generator.dart, driver.dart, simplification.dart. — One of this dimension's main actionable groups (6 warning-level).

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC2 · Forms & labels4.8 / 10Weak✓ Tool-verified

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.

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — pkg/front_end/tool/benchmark_visualiser.html:68

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure3.3 / 10Weak✓ Tool-verified

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.

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — pkg/front_end/tool/benchmark_visualiser.html:1, pkg/vm_snapshot_analysis/lib/src/assets/index.html:6, runtime/tools/wiki/templates/page.html:2
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — pkg/front_end/tool/benchmark_visualiser.html:1
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — pkg/front_end/tool/benchmark_visualiser.html:1, pkg/vm_snapshot_analysis/lib/src/assets/index.html:6

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.
AC6 · Visual & motion safety4.1 / 10Weak✓ Tool-verified

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

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

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

  • `#trace-viewer:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — pkg/observatory/web/timeline.html:24
  • `& .gi` sets color: #22863a on background-color: #f0fff4 — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — runtime/tools/wiki/styles/style.scss:317
  • `nav.nav-bar > ul` sets color: white on background-color: #0489c3 — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — pkg/observatory/lib/src/elements/css/shared.css:2049
  • `.search-bar button:enabled` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — pkg/observatory/lib/src/elements/css/shared.css:2653
  • `.virtual-tree .expander:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — pkg/observatory/lib/src/elements/css/shared.css:2861
  • `.shake` moves (`animation: shake 0.5s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — pkg/observatory/lib/src/elements/css/shared.css:414
  • `.nav-exception > div` moves (`animation: fadein 1s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — pkg/observatory/lib/src/elements/css/shared.css:2175

What to do

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

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

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

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

AX3 · Project dependency cycles7.5 / 10Strong✓ Tool-verified

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

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

  • The projects _test_circular1 → _test_circular2 → _test_circular1 form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.

What to do

  • Break project reference cycles by extracting shared abstractions into a separate project; keep the graph a DAG.
AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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.

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.

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

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

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

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

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 (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.
DM2 · Strongly-typed ids10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain identifiers are strongly typed (an extension-type / value-class wrapper) rather than raw primitives — consistency once an idiom exists.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether an entity protects its own invariants — a class whose identity is derived from its fields (value equality) but whose fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM6 · Domain ↔ infrastructure boundary1.0 / 10Critical✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM (drift/floor/isar/objectbox/hive) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

  • `DefinedTable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the drift `Table`/`@DataClassName`/`@DriftDatabase` mapping) with no separate pure-domain layer — the domain entity IS the ORM row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — pkg/wasm_builder/lib/src/ir/table.dart:60
  • `ImportedTable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the drift `Table`/`@DataClassName`/`@DriftDatabase` mapping) with no separate pure-domain layer — the domain entity IS the ORM row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — pkg/wasm_builder/lib/src/ir/table.dart:91

What to do

  • Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Dart: methods whose whole body still throws UnimplementedError or a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • `lookupMemberTypeInternal` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. — pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:880
  • `assertInErrorRecovery` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. — pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:2442
  • `metadataContents` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. — pkg/dwds/lib/src/readers/frontend_server_asset_reader.dart:126
  • `bootstrapJs` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. — pkg/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart:137
  • `accept` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. (×2) — pkg/kernel/lib/src/ast/types.dart:2764, pkg/kernel/lib/src/ast/types.dart:2822
  • `accept1` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. (×2) — pkg/kernel/lib/src/ast/types.dart:2770, pkg/kernel/lib/src/ast/types.dart:2828
  • `equals` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. (×2) — pkg/kernel/lib/src/ast/types.dart:2834, pkg/kernel/lib/src/ast/types.dart:2895
  • `withDeclaredNullability` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface. (×2) — pkg/kernel/lib/src/ast/types.dart:2857, pkg/kernel/lib/src/ast/types.dart:2918

What to do

  • Finish or delete the methods that still throw UnimplementedError, and replace placeholder text before shipping.
IC1 · Incompleteness & stubs5.5 / 10Adequate✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Dart: methods that only throw UnimplementedError or a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

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

  • `lookupMemberTypeInternal` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface. — pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:880
  • `assertInErrorRecovery` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface. — pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:2442
  • `_storeForLoopParts` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:1084
  • `_disposeLibrary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/analyzer/lib/src/summary2/linked_element_factory.dart:280
  • `registerOptimization` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:644
  • `makeNull` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — pkg/dev_compiler/lib/src/js_ast/template.dart:187
  • `metadataContents` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface. — pkg/dwds/lib/src/readers/frontend_server_asset_reader.dart:126
  • `test12part1usage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/outline_extraction_testcases/part_01/main.dart:3
  • `secondtest12part1usage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/outline_extraction_testcases/part_01/main.dart:4
  • `foo3` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:3, pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:3
  • `foo4` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:4, pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:4
  • `foo5` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:5, pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:5
  • `on` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — pkg/front_end/parser_testcases/general/call_on_after_try_block.dart:15, pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart:22
  • `onX` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart:13
  • `test2` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/constructor_tearoffs/bound_checks_in_type_literals.dart:9
  • `acceptsInt` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — pkg/front_end/testcases/dart2wasm/inference_update_2/issue52452.dart:46, pkg/front_end/testcases/dartdevc/inference_update_2/issue52452.dart:46
  • `boz` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/enhanced_enums/instantiated_generic_enum_types.dart:34
  • `testOptionalPositional` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/extension_types/nullability.dart:81
  • `testNamedNotRequired` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/extension_types/nullability.dart:97
  • `genericMethod1` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. (×2) — pkg/front_end/testcases/extensions/explicit_extension_inference.dart:18, pkg/front_end/testcases/extensions/implicit_extension_inference.dart:18
  • A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition. (×4) — pkg/front_end/testcases/general/constants/unused_non_const.dart:12, pkg/front_end/testcases/general/constants/unused_non_const.dart:13, pkg/front_end/testcases/general/constants/unused_non_const.dart:14, …
  • `bad` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/deferred_type_annotation.dart:7
  • `topLevelOptionalPositional` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:5
  • `topLevelOptionalNamed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:6
  • `topLevelOptionalPositionalImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:7
  • `topLevelOptionalNamedImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:8
  • `EN` has 4 unfinished members out of 4 declared methods (whether or not each carries a body) — a scaffolded class that was never implemented. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:36
  • `foobarOptionalPositional` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:39
  • `foobarOptionalNamed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:40
  • `foobarOptionalPositionalImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:41
  • `foobarOptionalNamedImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:42

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
  • Clear the softer debt: re-enable or delete tests marked `skip:`, decide whether each empty method or UnsupportedError is deliberate (and say so in a comment), and replace `// ignore_for_file: type=lint` with targeted, justified ignores.
M1 · Documentation (README)8.3 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

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

What to do

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

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

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

  • Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`PRESUBMIT.py`).
M4 · Documentation accuracy8.6 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • runtime/docs/README.md links to `vegorov@google.com`, but `runtime/docs/vegorov@google.com` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — runtime/docs/README.md:5

What to do

  • Reconcile the README with reality: runtime/docs/README.md links to `vegorov@google.com`, but `runtime/docs/vegorov@google.com` does not exist.
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified

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

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

P10 · Library API & versioning8.7 / 10Strong✓ 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; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 585 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `DiagnosticCodeImpl` (pkg/_fe_analyzer_shared/lib/src/base/errors.dart:187, name ends in `Impl`), `StackImpl` (pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:534, name ends in `Impl`), `TokenStreamRewriterImpl` (pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart:273, name ends in `Impl`), `StringTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:26, name ends in `Impl`), `CommentTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:127, name ends in `Impl`), `LanguageVersionTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:164, name ends in `Impl`), `SharedInferenceLogWriterImpl` (pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:273, name ends in `Impl`), `PluginRegistryImpl` (pkg/analysis_server_plugin/lib/src/registry.dart:16, name ends in `Impl`), and 577 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — pkg/_fe_analyzer_shared/lib/src/base/errors.dart:187
  • 5 public types in `repository` are marked as implementation by their own namespace, folder or name: `InsertUnitHeaderCommentMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/insert_unit_header_comment.dart:11, `impl`), `RemoveLastFormalParameterMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/remove_last_formal_parameter.dart:13, `impl`), `RenameLocalVariableMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/rename_local_variable.dart:16, `impl`), `SwapTopLevelFunctionsMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/swap_top_level_functions.dart:12, `impl`), `ToggleReturnTypeNullabilityMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/toggle_return_type_nullability.dart:12, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — pkg/analyzer/tool/fine/ab_mutate/mutations/impl/insert_unit_header_comment.dart:11

What to do

  • Hide `repository.src` (`DiagnosticCodeImpl`, `StackImpl`, `TokenStreamRewriterImpl`, `StringTokenImpl`, `CommentTokenImpl`, `LanguageVersionTokenImpl`, `SharedInferenceLogWriterImpl`, `PluginRegistryImpl`, and 577 more) (Dart: a `_` name, or keep it under `lib/src/` unexported): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `repository` (`InsertUnitHeaderCommentMutation`, `RemoveLastFormalParameterMutation`, `RenameLocalVariableMutation`, `SwapTopLevelFunctionsMutation`, `ToggleReturnTypeNullabilityMutation`) (Dart: a `_` name, or keep it under `lib/src/` unexported): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability4.6 / 10Weak✓ Tool-verified

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

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

  • Only 13/68 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `pkg/_fe_analyzer_shared`, `pkg/analysis_server_client`, `pkg/analysis_server_plugin` and 50 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add a health-check endpoint (a /health route on your shelf router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling6.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • `scorecards-analysis.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • `http.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — pkg/analysis_server/lib/src/services/pub/pub_api.dart:61
  • `HttpClient()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_change_requests_processing.dart:124
  • `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — runtime/tools/dartfuzz/collect_data.py:46, runtime/tools/dartfuzz/collect_data.py:99

What to do

  • Bound every outbound call: `.timeout(const Duration(seconds: 10))` on the request future for `package:http` and `dart:io`'s `HttpClient` (neither has a default), `receiveTimeout` on dio's `BaseOptions`, and a `RetryClient` (package:http/retry.dart) or `package:retry` around dependencies that fail.
  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • `teardown` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. (×3) — benchmarks/FileIOSink/dart/FileIOSink.dart:30, benchmarks/FileIOSink/dart/FileIOSink.dart:60, benchmarks/FileIOSink/dart/FileIOSink.dart:90
  • `_calcCompletionTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server/benchmark/perf/benchmarks_impl.dart:70
  • `_calcEditTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server/benchmark/perf/benchmarks_impl.dart:121
  • `_completionTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart:191
  • `collectOverrides` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server/tool/bulk_fix/parse_utils.dart:14
  • `start` is async and calls resolveSymbolicLinksSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — REDACTED:303
  • `_collectAndHandleErrors` is async and calls createSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/tool/fine/ab_mutate.dart:172
  • `_establishBaseline` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/tool/fine/ab_mutate.dart:187
  • `_runChain` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/tool/fine/ab_mutate.dart:250
  • `_runChains` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/tool/fine/ab_mutate.dart:514
  • `_setupAndBaseline` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/tool/fine/ab_mutate.dart:523
  • `generate` is async and calls deleteSync, createSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_utilities/lib/tools.dart:348
  • `generate` is async and calls writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_utilities/lib/tools.dart:394
  • `launchDevTools` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/dds/lib/devtools_server.dart:647
  • `_runBatch` is async and calls writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/dev_compiler/lib/ddc.dart:115
  • `compileAndRun` is async and calls writeAsStringSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/front_end/tool/dart_doctest_impl.dart:123
  • `run` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/front_end/tool/flame/instrumenter_suite.dart:73
  • `compile` is async and calls writeAsBytesSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/front_end/tool/fuzz/compile_helper.dart:48
  • `writeJavaScriptBundle` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/frontend_server/lib/frontend_server.dart:1184
  • `invalidateIfInitializingFromDill` is async and calls readAsBytesSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/frontend_server/lib/frontend_server.dart:1347
  • `lintFiles` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/linter/tool/test_linter.dart:35
  • `record` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/perf_witness/lib/recorder.dart:117
  • `_checkIfControlSocketIsFree` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/perf_witness/lib/recorder.dart:248
  • `_tryConnectTo` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/perf_witness/lib/recorder.dart:368
  • `_startImpl` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/perf_witness/lib/server.dart:83
  • `_shutdown` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/perf_witness/lib/server.dart:246
  • `getPackageDependencies` is async and calls readAsStringSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — REDACTED:318
  • `withTemporaryDepsCommit` is async and calls writeAsStringSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — tools/roll_browsers/git.dart:44
  • `handleAnalysisUpdateContent` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_plugin/lib/plugin/plugin.dart:288
  • `generateContent` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server/lib/src/status/pages/contents_page.dart:27
  • `_handleAnalysisUpdateContent` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analysis_server_plugin/lib/src/plugin_server.dart:928
  • `_poll` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer/lib/src/workspace/blaze_watcher.dart:525
  • `start` is async and calls writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_cli/lib/src/driver.dart:78
  • `_analyzeAll` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_cli/lib/src/driver.dart:145
  • `addYamlFileEdit` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_core.dart:225
  • `_resolveRemotePackage` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/dartdev/lib/src/commands/install.dart:384
  • `createAppBundleDirectory` is async and calls deleteSync, createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/dartdev/lib/src/commands/install.dart:557
  • `_runLocal` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — pkg/dartdev/lib/src/commands/run.dart:537

What to do

  • Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
R1 · Type Safety0.0 / 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.

  • 0 typed · 22 plain JS — the untyped files are pkg/compiler/tool/used_names/used_names.js, pkg/dartpad/asset/sandbox_flutter_patch.js, pkg/dartpad/lib/src/asset/shared-worker.js, pkg/dartpad_worker/lib/src/asset/devtools.js, REDACTED, pkg/dartpad_worker/lib/src/asset/worker.js (+16 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication8.5 / 10Strong✓ Tool-verified

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.

  • sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js:10 · sdk/lib/_internal/js_runtime/lib/preambles/d8.js:10 · sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js:7 — these 3 files are line-for-line copies of one another — 189 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. — sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js:10
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:387 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:572 — the two spans are one implementation copied and then locally edited — 324 tokens are still identical, in the same order in both spans, 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. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:387
  • REDACTED:1705 · REDACTED:1736 — all 2 copies are in the same file, 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. — REDACTED:1705
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:443 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:609 — all 2 copies are in the same file, 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. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:443
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:884 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:884
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:500 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:500
  • REDACTED:635 · REDACTED:677 — the two spans are one implementation copied and then locally edited — 57 tokens are still identical, in the same order in both spans, 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. — REDACTED:635
  • runtime/tools/graphexplorer/graphexplorer.js:1768 · runtime/tools/graphexplorer/graphexplorer.js:1813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:1768
  • REDACTED:879 · REDACTED:1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:879
  • runtime/tools/graphexplorer/graphexplorer.js:1446 · runtime/tools/graphexplorer/graphexplorer.js:1943 — all 2 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:1446
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:868 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:902 — all 2 copies are in the same file, 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. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:868
  • runtime/tools/graphexplorer/graphexplorer.js:32 · runtime/tools/graphexplorer/graphexplorer.js:46 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:32
  • runtime/tools/graphexplorer/graphexplorer.js:1078 · runtime/tools/graphexplorer/graphexplorer.js:1091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:1078
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:521 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:521
  • REDACTED:711 · REDACTED:750 — all 2 copies are in the same file, 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. — REDACTED:711
  • runtime/tools/graphexplorer/graphexplorer.js:144 · runtime/tools/graphexplorer/graphexplorer.js:299 — all 2 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:144
  • runtime/tools/graphexplorer/graphexplorer.js:1682 · runtime/tools/graphexplorer/graphexplorer.js:1695 · runtime/tools/graphexplorer/graphexplorer.js:1709 — all 3 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:1682
  • runtime/tools/graphexplorer/graphexplorer.js:326 · runtime/tools/graphexplorer/graphexplorer.js:378 · runtime/tools/graphexplorer/graphexplorer.js:573 · runtime/tools/graphexplorer/graphexplorer.js:699 · +2 more site(s) not listed — all 6 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:326
  • runtime/tools/graphexplorer/graphexplorer.js:341 · runtime/tools/graphexplorer/graphexplorer.js:359 — all 2 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:341
  • runtime/tools/graphexplorer/graphexplorer.js:392 · runtime/tools/graphexplorer/graphexplorer.js:796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:392
  • REDACTED:405 · REDACTED:879 · REDACTED:1246 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:405
  • runtime/tools/graphexplorer/graphexplorer.js:1212 · runtime/tools/graphexplorer/graphexplorer.js: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. — runtime/tools/graphexplorer/graphexplorer.js:1212
  • runtime/tools/graphexplorer/graphexplorer.js:70 · runtime/tools/graphexplorer/graphexplorer.js:202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:70
  • runtime/tools/graphexplorer/graphexplorer.js:981 · runtime/tools/graphexplorer/graphexplorer.js:994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:981
  • runtime/tools/graphexplorer/graphexplorer.js:1878 · runtime/tools/graphexplorer/graphexplorer.js:1887 — all 2 copies are in the same file, 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. — runtime/tools/graphexplorer/graphexplorer.js:1878
  • runtime/tools/graphexplorer/graphexplorer.js:1797 · runtime/tools/graphexplorer/graphexplorer.js:1805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/tools/graphexplorer/graphexplorer.js:1797

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.
R2 · Cyclomatic Complexity7.8 / 10Strong✓ Tool-verified

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.

  • onRcpMessage has cyclomatic complexity 22 and cognitive complexity 34; 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. — REDACTED:76
  • loadDartHeapSnapshot has cyclomatic complexity 21 and cognitive complexity 23; 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. — runtime/tools/graphexplorer/graphexplorer.js:155
  • rewriteEdgesForOwners has cyclomatic complexity 19 and cognitive complexity 29; 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. — runtime/tools/graphexplorer/graphexplorer.js:381
  • createTreemapTile has cyclomatic complexity 17 and cognitive complexity 34; 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. — runtime/tools/graphexplorer/graphexplorer.js:1279
  • _clone has cyclomatic complexity 17 and cognitive complexity 28; 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. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:286
  • hotRestart has cyclomatic complexity 17 and cognitive complexity 22; 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. — REDACTED:481
  • _showInfoBox has cyclomatic complexity 16 and cognitive complexity 29; 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. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:774
  • start has cyclomatic complexity 15 and cognitive complexity 26; 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. — REDACTED:652
  • safeSerialize has cyclomatic complexity 14 and cognitive complexity 17; 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. — REDACTED:367
  • load has cyclomatic complexity 12 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 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. — REDACTED:214
  • computeDominators has cyclomatic complexity 11 and cognitive complexity 23; 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. — runtime/tools/graphexplorer/graphexplorer.js:576
  • computeOwnedSizes has cyclomatic complexity 11 and cognitive complexity 20; 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. — runtime/tools/graphexplorer/graphexplorer.js:702
R3 · Large Files0.0 / 10Critical✓ 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.

  • REDACTED has 2137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • runtime/tools/graphexplorer/graphexplorer.js has 1749 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/tools/graphexplorer/graphexplorer.js:1
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js has 887 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:1
  • REDACTED has 783 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R7 · Dead Code1.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 9 application, 0 tooling and 4 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
  • no import path from any entry point (9 application, 0 tooling, 4 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) — REDACTED, REDACTED, sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

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.

S1 · Web-Security Posture1.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's Dart source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS certificate validation — facts about code that hold whether or not it serves anything itself. The TLS protocol version is not read: `dart:io` leaves the protocol floor to the platform's TLS library and has no switch that admits an obsolete version. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. This repository serves HTTP itself (sdk/lib/_http/http.dart:258 — `HttpServer.listenOn(`), so its Dart source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Dart spelling appears in production source, not proven on every route.

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

  • `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`. — pkg/dwds/lib/src/readers/proxy_server_asset_reader.dart:36
  • MD5/SHA1 is computed 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+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×4) — pkg/analysis_server/lib/src/plugin/plugin_manager.dart:1104, pkg/analyzer/lib/src/dart/analysis/file_content_cache.dart:58, pkg/analyzer/lib/src/summary/api_signature.dart:167, …
  • `https://www.gstatic.com/charts/loader.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 3 such include(s) across the repository's markup. — pkg/front_end/tool/benchmark_visualiser.html:4
  • Set: X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy, Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: sdk/lib/_http/http.dart:258 — `HttpServer.listenOn(`.

What to do

  • Stop accepting every TLS certificate: delete the `badCertificateCallback` / `onBadCertificate` / `validateCertificate` that returns `true` so the chain, hostname and expiry are verified, and trust a self-signed or private server by loading its CA into a `SecurityContext` — never by switching verification off.
  • 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 (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 4 sites, not one: `pkg/analysis_server/lib/src/plugin/plugin_manager.dart:1104` (md5.convert(…)), `pkg/analyzer/lib/src/dart/analysis/file_content_cache.dart:58` (md5.convert(…)), `pkg/analyzer/lib/src/summary/api_signature.dart:167` (md5.convert(…)), `pkg/compiler/lib/src/hash/sha1.dart:16` (sha1.startChunkedConversion(…)). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
  • Add Content-Security-Policy, Strict-Transport-Security beside the headers the Dart server already sets.
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • `forEach` takes a `void` callback and never awaits what it returns, so the Future each `async` call returns is dropped: nothing can await it, the code after this loop runs before any of the awaited work has finished (a function that `await`s around this loop still returns early, and a resource it closes next is closed under the work), and an error is never handled — it surfaces as an uncaught asynchronous error, which terminates a command-line program and reaches only the zone's error handler in Flutter. Iterate with `for (final item in items) { await … }` when the work must run in order, or `await Future.wait(items.map((item) async { … }))` when it may run concurrently, so the enclosing function finishes only when the work does and its failures reach the caller. Where firing and forgetting is genuinely intended, make the callback's whole body a `try { … } catch (e) { … }` that handles the failure, so it cannot escape. — pkg/dds/lib/src/client_manager.dart:153

What to do

  • `async` callback passed to `forEach`
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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

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

X13 · Undrained process stream7.1 / 10Strong✓ Tool-verified

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

  • `Process.start` always pipes both `stdout` and `stderr`, and here `process.stdout` is read while the child's end is awaited — but nothing in this scope ever reads `process.stderr`. Dart reads a process stream only while something listens to it, and the API's own documentation says every byte of both must be read: once the child writes more than the pipe holds to stderr (measured with Dart 3.12 on Linux: 60 KB hangs every time, and less on a box short of pipe pages), it blocks on the write, never exits, and the `exitCode` or end of stream this code awaits never comes. Nothing fails loudly: the future never completes and the stuck child holds its resources until something kills it. Consume both streams (`process.stderr.drain<void>()` to discard it, or listen to it), use `Process.run`, which collects both, or start it with `mode: ProcessStartMode.inheritStdio` when the output is not wanted. — pkg/observatory/bin/observatory.dart:83

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

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

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

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

  • `length` is read from the bytes being parsed at line 1064 (`readUint32`), then used to size a `List.filled` at line 1067 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — pkg/kernel/lib/binary/ast_from_binary.dart:1067
  • `sectionCount` is read from the bytes being parsed at line 570 (`readUint32`), then used to size a `List.generate` at line 573 — and nowhere in its scope is `sectionCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `sectionCount` against the bytes actually remaining and a maximum the format allows before allocating. — pkg/dart2native/lib/macho.dart:573
  • `length` is read from the bytes being parsed at line 289 (`readUint32`), then used to size a `Uint32List` at line 290 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — pkg/analyzer/lib/src/binary/binary_reader.dart:290

What to do

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

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

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

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

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

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

  • `convertDartToNative_Dictionary` is public, takes a document from its caller (line 65) and hands it to `_convertDartToNative_Value`, which calls itself at line 53 (`_convertDartToNative_Value`) with a piece of `value` — and nowhere in `_convertDartToNative_Value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_convertDartToNative_Value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdk/lib/html/html_common/conversions_dart2js.dart:53
  • `jsify` is public, takes a document from its caller (line 37) and hands it to `_convert`, which calls itself at line 55 (`_convert`) with a piece of `o` (and at line 61) — and nowhere in `_convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdk/lib/_internal/js_shared/lib/js_util_patch.dart:55
  • `dartify` is public and takes `Object ? o` from its caller, and it calls itself at line 703 (`dartify`) with a piece of `o` — and nowhere in `dartify` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `dartify` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdk/lib/_internal/js_shared/lib/js_util_patch.dart:703
  • `dartify` is public, takes a document from its caller (line 666) and hands it to `convert`, which calls itself at line 721 (`convert`) with a piece of `o` — and nowhere in `convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdk/lib/_internal/js_shared/lib/js_util_patch.dart:721
  • `createServiceObject` is public and takes `Object ? json` from its caller, and it calls itself at line 47 (`createServiceObject`) with a piece of `json` — and nowhere in `createServiceObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `createServiceObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/vm_service/lib/src/vm_service.dart:47
  • `wrapRecord` is public and takes `dynamic x` from its caller, and it calls itself at line 32 (`wrapRecord`) with a piece of `x` — and nowhere in `wrapRecord` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `wrapRecord` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/vm/testcases/transformations/type_flow/transformer/records.dart:32
  • `loop1` is public and takes `Object a1` from its caller, and it calls itself at line 31 (`loop1`) with a piece of `a1` — and nowhere in `loop1` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `loop1` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/vm/testcases/transformations/type_flow/summary_collector/vars.dart:31
  • `formatInstruction` is public, takes a document from its caller (line 227) and hands it to `_formatInternal`, which calls itself at line 211 (`_formatInternal`) with a piece of `instr` — and nowhere in `_formatInternal` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_formatInternal` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/vm/lib/testing/il_matchers.dart:211
  • `jsonToKernelConstant` is public and takes `Object jsonObject` from its caller, and it calls itself at line 27 (`jsonToKernelConstant`) with a piece of `jsonObject` (and at line 40, line 41) — and nowhere in `jsonToKernelConstant` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `jsonToKernelConstant` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/vm/lib/native_assets/json_to_kernel_constant.dart:27
  • `preprocess` is public and takes `Object ? obj` from its caller, and it calls itself at line 303 (`preprocess`) with a piece of `obj` (and at line 321, line 324) — and nowhere in `preprocess` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `preprocess` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/native_compiler/lib/snapshot/snapshot.dart:303
  • `deepEquals` is public, takes a document from its caller (line 723) and hands it to `_deepEquals`, which calls itself at line 769 (`_deepEquals`) with a piece of `expected` (and at line 795) — and nowhere in `_deepEquals` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_deepEquals` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/expect/lib/expect.dart:769
  • `formatPrty` is public and takes `Object ? x` from its caller, and it calls itself at line 100 (`formatPrty`) with a piece of `x` — and nowhere in `formatPrty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `formatPrty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/compiler/lib/src/tracer.dart:100
  • `writeProperty` is public, takes a document from its caller (line 47) and hands it to `_writePropertyValue`, which calls itself at line 98 (`_writePropertyValue`) with a piece of `value` — and nowhere in `_writePropertyValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_writePropertyValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/analysis_server/lib/src/status/utilities/tree_writer.dart:98
  • `normalize` is public, takes a document from its caller (line 166) and hands it to `_canonicalizeObject`, which calls itself at line 201 (`_canonicalizeObject`) with a piece of `value` (and at line 207) — and nowhere in `_canonicalizeObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_canonicalizeObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pkg/analysis_server/lib/src/session_logger/log_normalizer.dart:201

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `create` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — pkg/dartpad_worker/lib/src/asset/worker.js:12

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

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 `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) 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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

X23 · Unguarded diagnostic materialisation6.5 / 10Adequate✓ Tool-verified

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. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `finest` at line 114 is called with an argument built by `args.join('…')` (line 114), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because finest is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — pkg/dwds/lib/src/services/expression_compiler_service.dart:114
  • `fine` at line 304 is called with an argument built by `keys.toList()` (line 306), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because fine is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — pkg/dwds/lib/src/services/web_socket/web_socket_proxy_service.dart:304
  • `trace` at line 298 is called with an argument built by `command.join('…')` (line 298), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — pkg/dartdev/lib/src/core.dart:298
  • `trace` at line 256 is called with an argument built by `arguments.join('…')` (line 256), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — pkg/dartdev/lib/src/lsp_analysis_server.dart:256
  • `trace` at line 468 is called with an argument built by `arguments.join('…')` (line 468), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on. — REDACTED:468

What to do

  • In Dart, put the construction behind the logger's own check (`if (log.isLoggable(Level.FINE))` for package:logging, `if (kDebugMode)` for a line only a debug build needs), or hand the logger a closure it calls only when the record is written (`log.fine(() => 'rows: ${rows.map((r) => r.id).join(', ')}')`; package:logger's `logger.d(() => …)` likewise). Interpolating the value into the message is not the fix: Dart builds the string, and every `map`, `join` or `jsonEncode` inside it, before the call is entered.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X27 · Collection changed while being enumerated8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … in` loop leaves the `List`, `Map` or `Set` it is walking alone — Dart's collection iterators check that the collection has not changed since the loop began, so a body that adds to or removes from the very collection the loop is walking (or the map whose `keys`, `values` or `entries` it walks) makes the next step throw `ConcurrentModificationError` and the remaining elements 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.

  • `_urlToId.keys` is a live view over `_urlToId` and shares its modification count, and line 37 calls `_urlToId.remove(…)` inside the loop body — a structural change to a `Map`. Dart's collection iterators check that the collection has not changed since the loop began, so the next `moveNext()` throws `ConcurrentModificationError` (an unmodifiable or fixed-length one rejects the change itself with `UnsupportedError`): every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen. — pkg/dwds/lib/src/debugging/skip_list.dart:30

What to do

  • Each finding names the two lines that cannot both stand — the `for` over the collection (or its `keys()`/`values()`/`items()` view), and the call inside the body that changes its size. Confirm from those two, then pick one: walk a snapshot (`for k in list(d):`, `for x in s.copy():`); build the result instead of editing in place (`d = {k: v for k, v in d.items() if keep(v)}`); collect what needs removing and remove it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe. In Dart: Each finding names the two lines that cannot both stand — the `for … in` over the collection (or its `keys`/`values`/`entries` view), and the call inside the body that changes it. Confirm from those two, then pick one: replace the loop with `removeWhere`/`retainWhere`; walk a copy (`for (final x in items.toList())`, `for (final k in map.keys.toList())`); collect what needs changing and apply it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe.
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.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.3 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×25) — sdk/lib/html/html_common/device.dart:58, sdk/lib/_internal/wasm/js_common/js_string_convert.dart:47, sdk/lib/_internal/wasm/js_common/js_string_convert.dart:61, …
  • `catch (e)` 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. (×9) — sdk/lib/_internal/vm/lib/isolate_patch.dart:713, sdk/lib/_internal/js_dev_runtime/private/debugger.dart:184, pkg/vm/testcases/transformations/ffi/finalizable_late_2.dart:27, …
  • `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. (×5) — sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart:349, pkg/perf_witness/lib/server.dart:120, pkg/perf_witness/lib/src/common.dart:42, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — pkg/perf_witness/lib/src/json_rpc.dart:80

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types8.9 / 10Strong✓ Tool-verified

Other · Code Health — Whether Dart's sound null safety is on and is not undermined by null assertions — a package whose `environment: sdk:` lower bound is 2.12 or above is null safe, so `String` cannot hold null and `String?` must be checked before use, and each postfix `!` is a run-time `Null check operator used on a null value` the author has told the analyzer cannot happen.

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

  • 83/84 of this repository's Dart packages (a `pubspec.yaml` with product Dart beneath it) declare a language version of 2.12 or above in `environment: sdk:`, which is what turns sound null safety on. A pubspec with no SDK constraint, or a lower bound below 2.12, runs its code unsound: every type admits null, and a null reaching a method call throws `NoSuchMethodError` with nothing in the analyzer having said so.

What to do

  • Raise every package's `environment: sdk:` lower bound to 2.12 or above (`^3.0.0` today) and migrate with `dart migrate` on an SDK that still has it, so `String` and `String?` mean different things. Then replace assertions rather than adding to them: each `!` is a run-time null check the analyzer could not prove — promote the value with a null check or an early return, use `?.` / `??` where absence is legitimate, make the field non-nullable and `late final` only where initialisation is truly guaranteed, or change the API so the null cannot arrive.

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health26%Weak — gated by D2, R1, R3, R7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture93%ExemplaryStrongest area.
Maturity73%StrongSolid.
Readiness59%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security38%Weak — gated by D28, D29, D36, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling61%Adequate — gated by DM6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility39%Weak — gated by AC3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 4 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 40 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.
  • X7 Silent fallback defaults — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for

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

  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Dart isolates share no mutable memory, so no two requests write one object at the same instant. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — AX6 reached only 0% of this repository's production lines — dart (2,071,466 lines), cpp (360,434 lines), c (146,156 lines), python (22,927 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an Isar, ObjectBox, Floor or Hive entity, or a Serverpod table model — and no database or data-store client (sqflite, Drift, Isar, Hive, Realm, Firestore, Supabase, postgres, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a Drift table, an ObjectBox/Floor @Entity, an Isar @collection, a Hive @HiveType or a Serverpod table model — and no database or data-store client (sqflite, Firestore, Supabase, postgres, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~2876687 lines of test source are present (.py, .dart) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — no .dart test runner
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — pub package licences not graded — this pubspec declares no package pub.dev serves
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Dart, Java, JavaScript, Python, html not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.dart), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • 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.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Aggregate boundaries — not scored for Dart: aggregate-vs-value-object classification cannot be told apart in source (every class-holding-class reads alike), and a child COLLECTION (legitimate membership) vs a single embedded aggregate is indistinguishable — reported as guidance rather than measured
  • DM3 Integration-event coupling — not scored for Dart: a cross-package domain leak cannot be told apart in source from a legitimate shared-kernel package, and most repositories ship a single package — reported as guidance rather than measured
  • DM4 Rich vs anemic domain model — this Dart repository declares no domain-layer entity carrying stored data (every type is a typed-id wrapper, DTO/config, ORM row or presentation container), so DM4's rich-vs-anemic read has no population to be taken over
  • DM7 Repository granularity — not scored for Dart: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • ED5 Idempotency — 78 mutating command handler(s)/consumer(s) detected and 290 handler method(s) walked, but no persistent write was recognised in any of them — idempotency not assessed
  • 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 — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for classes extending benchmark_harness's `BenchmarkBase`, `AsyncBenchmarkBase` or `PerfBenchmarkBase` (directly or through a base of your own), `benchmark(…)` calls under the pub `benchmark` package, Flutter's `benchmarkWidgets`, `watchPerformance` or `traceAction` in a test importing flutter_test, integration_test or flutter_driver, or benchmark_harness, benchmark or web_benchmarks in a pubspec.yaml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R4 Test Coverage — 4 test file(s) reach none of 18 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 1% of this repository's production lines — dart (2,071,466 lines), cpp (360,434 lines), c (146,156 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.

Appendix A — Findings (grouped)

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

Critical — 50 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×23
  • Orphaned knowledge runtime/tools/dartfuzz/dartfuzz_api_table.dart:1 — 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 tools/dom/scripts/systemhtml.py:1 — 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 sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1 — 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 pkg/compiler/lib/src/universe/class_set.dart:1 — 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 pkg/compiler/lib/src/inferrer/typemasks/flat_type_mask.dart:1 — 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 pkg/js_ast/lib/src/template.dart:1 — 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 pkg/compiler/lib/src/js_backend/type_reference.dart:1 — 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 pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_merger.dart:1 — 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 pkg/compiler/lib/src/inferrer/abstract_value_domain.dart:1 — 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 pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:1 — 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 pkg/compiler/lib/src/inferrer/computable.dart:1 — 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 pkg/dev_compiler/lib/src/kernel/module_symbols.dart:1 — 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 pkg/compiler/lib/src/js_model/js_world_builder.dart:1 — 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 pkg/vm_snapshot_analysis/lib/v8_profile.dart:1 — 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 tools/addlatexhash.dart:1 — 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 sdk/lib/_internal/js_shared/lib/js_util_patch.dart:1 — 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 pkg/dart2js_info/lib/info.dart:1 — 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 pkg/compiler/tool/modular_test_suite_helper.dart:1 — 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 pkg/compiler/lib/src/js_backend/runtime_types_new.dart:1 — 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 pkg/compiler/lib/src/universe/member_hierarchy.dart:1 — 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 benchmarks/TypedData/dart/TypedData.dart:1 — 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 pkg/compiler/lib/src/inferrer/node_tracer.dart:1 — 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 pkg/compiler/lib/src/js_emitter/model.dart:1 — 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.
D28 · Secrets (history) · REDACTED · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×3
  • <html> without a lang pkg/front_end/tool/benchmark_visualiser.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang pkg/vm_snapshot_analysis/lib/src/assets/index.html:6 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang runtime/tools/wiki/templates/page.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
DM6 · Domain ↔ infrastructure boundary · Domain fused to persistence infrastructure · ×2
  • Domain fused to persistence infrastructure: DefinedTable pkg/wasm_builder/lib/src/ir/table.dart:60 — `DefinedTable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the drift `Table`/`@DataClassName`/`@DriftDatabase` mapping) with no separate pure-domain layer — the domain entity IS the ORM row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: ImportedTable pkg/wasm_builder/lib/src/ir/table.dart:91 — `ImportedTable` is a domain concept fused to persistence ON ITS OWN DECLARATION (the drift `Table`/`@DataClassName`/`@DriftDatabase` mapping) with no separate pure-domain layer — the domain entity IS the ORM row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label pkg/front_end/tool/benchmark_visualiser.html:68 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> pkg/front_end/tool/benchmark_visualiser.html:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AX3 · Project dependency cycles · Project dependency cycle · ×1
  • Project dependency cycle — The projects _test_circular1 → _test_circular2 → _test_circular1 form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D5 · Coupling · Circular dependency · ×1
  • Circular dependency — _test_circular1 → _test_circular2 → _test_circular1
S1 · Web-Security Posture · TLS certificate validation disabled · ×1
  • TLS certificate validation disabled pkg/dwds/lib/src/readers/proxy_server_asset_reader.dart:36 — `badCertificateCallback` returning `true` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the callback so `dart:io` validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: load its CA into a `SecurityContext` (`setTrustedCertificatesBytes`) and pass it as `HttpClient(context: …)` / `SecureSocket.connect(…, context: …)`, which keeps the chain and hostname checks on. A callback that must exist should compare the presented certificate with a pinned fingerprint, never return `true`.
Serious — 18034 finding(s)
D17 · Explicit Debt · TodoComment · ×6685
  • TodoComment PRESUBMIT.py:151 — # TODO(https://github.com/dart-lang/sdk/issues/46947): Remove this hack.
  • TodoComment PRESUBMIT.py:441 — # TODO(srawlins): Check more: — 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 tools/build_devtools.py:67 — # TODO(https://github.com/dart-lang/sdk/issues/64027): Figure out someething better.
  • TodoComment tools/copy_dart.py:56 — # TODO(sigmund): stop parsing when import/source — 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 tools/generate_idefiles.py:91 — # TODO(dacoharkes): Fetch the paths from that file. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tools/gn.py:620 — # TODO(infra): Re-enable --check. Many targets fail to use — 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 tools/publish_pkg.py:101 — # TODO(jmesserly): this code puts things in the pub cache. Useful for testing — 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 tools/task_kill.py:313 — # TODO(24086): Add result of KillDart into status once pub hang is fixed. — 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 tools/test_devtools.py:21 — # TODO(srawlins): Check how to run bash scripts on Windows, or convert the — 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 tools/test_devtools.py:237 — # TODO(srawlins): Enable devtools_extensions integration tests. — 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 tools/test_devtools.py:259 — # TODO(srawlins): Enable benchmark_performance tests. — 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 tools/utils.py:433 — # TODO(https://github.com/dart-lang/sdk/issues/51865): Don't ignore errors.
  • TodoComment tools/utils.py:454 — # TODO(https://github.com/dart-lang/sdk/issues/51865): Don't ignore errors.
  • TodoComment tools/utils.py:469 — # TODO(https://github.com/dart-lang/sdk/issues/51865): Don't ignore errors.
  • TodoComment tools/utils.py:484 — # TODO(https://github.com/dart-lang/sdk/issues/51865): Don't ignore errors.
  • TodoComment tools/utils.py:491 — # TODO(42528): Can we remove this? It's basically just an alias for Exception. — 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 tools/utils.py:708 — # todo(athom): move the logic to decide where to copy core dumps into the recipes. — 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 tools/utils.py:721 — # TODO: Figure out why windows coredump generation does not work. — 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 tools/write_dartdoc_options_file.py:28 — # TODO(jcollins-g): switch to version numbers when github has its tags synced — 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 tools/dom/dom.py:181 — # TODO(antonm): fix option name. — 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 tools/dom/src/AttributeMap.dart:49 — // TODO: generate a lazy collection instead. — 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 tools/dom/src/AttributeMap.dart:62 — // TODO: generate a lazy collection instead. — 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 tools/dom/src/AttributeMap.dart:207 — // TODO: Use lazy iterator when it is available on Map. — 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 tools/dom/src/AttributeMap.dart:261 — // TODO: Use lazy iterator when it is available on Map. — 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 tools/dom/src/CssRectangle.dart:271 — // TODO(jacobr): these methods are duplicated from _RectangleBase in dart:math — 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.
  • + 6660 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×1340
  • Low cohesion: WrapperClass (LCOM4 69) pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart:2 — WrapperClass's methods fall into 69 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 69 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: WrapperClass (LCOM4 69) pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods_2.dart:1 — WrapperClass's methods fall into 69 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 69 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: _ReferenceDependenciesCollector (LCOM4 61) pkg/dart2wasm/lib/deferred_load/dependencies.dart:205 — _ReferenceDependenciesCollector's methods fall into 61 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 61 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: Simplification (LCOM4 61) pkg/cfg/lib/passes/simplification.dart:12 — Simplification's methods fall into 61 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 61 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: LibraryElementImpl (LCOM4 61) pkg/analyzer/lib/src/dart/element/element.dart:6889 — LibraryElementImpl's methods fall into 61 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 61 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: BinaryPrinter (LCOM4 55) pkg/kernel/lib/binary/ast_to_binary.dart:14 — BinaryPrinter's methods fall into 55 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 55 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: RelevanceDataCollector (LCOM4 53) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:253 — RelevanceDataCollector's methods fall into 53 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 53 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: AnnotationsListener (LCOM4 53) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:24 — AnnotationsListener's methods fall into 53 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 53 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: CommonMasks (LCOM4 52) pkg/compiler/lib/src/inferrer/typemasks/masks.dart:46 — CommonMasks's methods fall into 52 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 52 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: FlowGraphChecker (LCOM4 49) pkg/cfg/lib/ir/flow_graph_checker.dart:14 — FlowGraphChecker's methods fall into 49 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 49 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: InferenceVisitorImpl (LCOM4 49) pkg/front_end/lib/src/type_inference/inference_visitor.dart:110 — InferenceVisitorImpl's methods fall into 49 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 49 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: MiniAstBuilder (LCOM4 48) pkg/analyzer/tool/summary/mini_ast.dart:163 — MiniAstBuilder's methods fall into 48 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 48 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: RelevanceDataCollector (LCOM4 47) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:212 — RelevanceDataCollector's methods fall into 47 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 47 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: TypeAnalyzer (LCOM4 40) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:205 — TypeAnalyzer's methods fall into 40 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 40 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: CatchVariable (LCOM4 40) pkg/kernel/lib/src/ast/variables.dart:1231 — CatchVariable's methods fall into 40 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 40 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: ProxyService (LCOM4 39) pkg/dwds/lib/src/services/proxy_service.dart:57 — ProxyService's methods fall into 39 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 39 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: ThisVariable (LCOM4 39) pkg/kernel/lib/src/ast/variables.dart:1903 — ThisVariable's methods fall into 39 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 39 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: TypeProviderImpl (LCOM4 38) pkg/analyzer/lib/src/dart/element/type_provider.dart:99 — TypeProviderImpl's methods fall into 38 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 38 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: _ElementCollector (LCOM4 38) pkg/analyzer/lib/src/fine/manifest_ast.dart:215 — _ElementCollector's methods fall into 38 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 38 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: PreTranslationAnalysis (LCOM4 37) pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:2973 — PreTranslationAnalysis's methods fall into 37 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 37 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: LocalVariable (LCOM4 36) pkg/kernel/lib/src/ast/variables.dart:180 — LocalVariable's methods fall into 36 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 36 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: LocalFunctionVariable (LCOM4 36) pkg/kernel/lib/src/ast/variables.dart:440 — LocalFunctionVariable's methods fall into 36 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 36 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: LateVariable (LCOM4 36) pkg/kernel/lib/src/ast/variables.dart:702 — LateVariable's methods fall into 36 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 36 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: ConstVariable (LCOM4 36) pkg/kernel/lib/src/ast/variables.dart:966 — ConstVariable's methods fall into 36 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 36 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: BodyBuilderContext (LCOM4 35) pkg/front_end/lib/src/kernel/body_builder_context.dart:35 — BodyBuilderContext's methods fall into 35 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 35 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.
  • + 1315 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×441
  • FileTooLong: dartfuzz/dartfuzz_type_table.dart runtime/tools/dartfuzz/dartfuzz_type_table.dart — FileTooLong — 228059 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: DartType (13-173146). The bar is 500 significant lines; this is 227559 over it, 456.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ast/ast.dart pkg/analyzer/lib/src/dart/ast/ast.dart — FileTooLong — 42278 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 41778 over it, 84.56× 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: type_inference/inference_visitor.dart pkg/front_end/lib/src/type_inference/inference_visitor.dart — FileTooLong — 10169 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: InferenceVisitorImpl (110-14509). The bar is 500 significant lines; this is 9669 over it, 20.34× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: util/parser_ast_helper.dart pkg/front_end/lib/src/util/parser_ast_helper.dart — FileTooLong — 10005 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9505 over it, 20.01× 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: kernel/body_builder.dart pkg/front_end/lib/src/kernel/body_builder.dart — FileTooLong — 7952 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7452 over it, 15.90× 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: parser/parser_impl.dart pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart — FileTooLong — 7934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7434 over it, 15.87× 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: element/element.dart pkg/analyzer/lib/src/dart/element/element.dart — FileTooLong — 7837 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7337 over it, 15.67× 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: ssa/builder.dart pkg/compiler/lib/src/ssa/builder.dart — FileTooLong — 6303 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: KernelSsaGraphBuilder (102-8611). The bar is 500 significant lines; this is 5803 over it, 12.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: kernel/compiler_new.dart pkg/dev_compiler/lib/src/kernel/compiler_new.dart — FileTooLong — 5698 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5198 over it, 11.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: kernel/internal_ast.dart pkg/front_end/lib/src/kernel/internal_ast.dart — FileTooLong — 5493 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4993 over it, 10.99× 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: kernel/compiler.dart pkg/dev_compiler/lib/src/kernel/compiler.dart — FileTooLong — 5255 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4755 over it, 10.51× 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: fasta/ast_builder.dart pkg/analyzer/lib/src/fasta/ast_builder.dart — FileTooLong — 5203 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: AstBuilder (53-6859). The bar is 500 significant lines; this is 4703 over it, 10.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: kernel/expression_generator.dart pkg/front_end/lib/src/kernel/expression_generator.dart — FileTooLong — 5126 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4626 over it, 10.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: flow_analysis/flow_analysis.dart pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart — FileTooLong — 4881 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4381 over it, 9.76× 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: type_inference/inference_visitor_base.dart pkg/front_end/lib/src/type_inference/inference_visitor_base.dart — FileTooLong — 4718 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: InferenceVisitorBase (133-5881). The bar is 500 significant lines; this is 4218 over it, 9.44× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/vm_service.dart pkg/vm_service/lib/src/vm_service.dart — FileTooLong — 4641 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4141 over it, 9.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: kernel/constant_evaluator.dart pkg/front_end/lib/src/kernel/constant_evaluator.dart — FileTooLong — 4366 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3866 over it, 8.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: resolver/type_analyzer.dart pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart — FileTooLong — 4260 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TypeAnalyzer (208-6058). The bar is 500 significant lines; this is 3760 over it, 8.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: lib/code_generator.dart pkg/dart2wasm/lib/code_generator.dart — FileTooLong — 4143 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3643 over it, 8.29× 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: builder/instructions.dart pkg/wasm_builder/lib/src/builder/instructions.dart — FileTooLong — 3974 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: InstructionsBuilder (163-6349). The bar is 500 significant lines; this is 3474 over it, 7.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: lib/intrinsics.dart pkg/dart2wasm/lib/intrinsics.dart — FileTooLong — 3752 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: Intrinsifier (535-4410). The bar is 500 significant lines; this is 3252 over it, 7.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: binary/ast_from_binary.dart pkg/kernel/lib/binary/ast_from_binary.dart — FileTooLong — 3654 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: BinaryBuilder (129-4771). The bar is 500 significant lines; this is 3154 over it, 7.31× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ast/expressions.dart pkg/kernel/lib/src/ast/expressions.dart — FileTooLong — 3458 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2958 over it, 6.92× 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: ir/instruction.dart pkg/wasm_builder/lib/src/ir/instruction.dart — FileTooLong — 3424 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2924 over it, 6.85× 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: service/object.dart pkg/observatory/lib/src/service/object.dart — FileTooLong — 3423 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2923 over it, 6.85× 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.
  • + 416 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×433
  • TooManyMethods: InstructionsBuilder pkg/wasm_builder/lib/src/builder/instructions.dart:156 — TooManyMethods — 490 methods. The bar is 30 methods; this is 460 over it, 16.33× 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: ForwardingListener pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:10 — TooManyMethods — 380 methods. The bar is 30 methods; this is 350 over it, 12.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BodyBuilderImpl pkg/front_end/lib/src/kernel/body_builder.dart:179 — TooManyMethods — 380 methods. The bar is 30 methods; this is 350 over it, 12.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Listener pkg/_fe_analyzer_shared/lib/src/parser/listener.dart:39 — TooManyMethods — 379 methods. The bar is 30 methods; this is 349 over it, 12.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractParserAstListener pkg/front_end/lib/src/util/parser_ast_helper.dart:88 — TooManyMethods — 378 methods. The bar is 30 methods; this is 348 over it, 12.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RecursiveParserAstVisitorWithDefaultNodeAsync pkg/front_end/lib/src/util/parser_ast_helper.dart:12519 — TooManyMethods — 378 methods. The bar is 30 methods; this is 348 over it, 12.60× the bar. Most of these members implement src.ParserAstVisitor (377 of 378 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ParserAstVisitor pkg/front_end/lib/src/util/parser_ast_helper.dart:10646 — TooManyMethods — 377 methods. The bar is 30 methods; this is 347 over it, 12.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RecursiveParserAstVisitor pkg/front_end/lib/src/util/parser_ast_helper.dart:11076 — TooManyMethods — 377 methods. The bar is 30 methods; this is 347 over it, 12.57× the bar. Most of these members implement src.ParserAstVisitor (377 of 377 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: LibraryCompiler pkg/dev_compiler/lib/src/kernel/compiler_new.dart:279 — TooManyMethods — 363 methods. The bar is 30 methods; this is 333 over it, 12.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProgramCompiler pkg/dev_compiler/lib/src/kernel/compiler.dart:80 — TooManyMethods — 353 methods. The bar is 30 methods; this is 323 over it, 11.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: BinaryBuilder pkg/kernel/lib/binary/ast_from_binary.dart:129 — TooManyMethods — 327 methods. The bar is 30 methods; this is 297 over it, 10.90× 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: BinaryPrinter pkg/kernel/lib/binary/ast_to_binary.dart:14 — TooManyMethods — 320 methods. The bar is 30 methods; this is 290 over it, 10.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AstBuilder pkg/analyzer/lib/src/fasta/ast_builder.dart:52 — TooManyMethods — 313 methods. The bar is 30 methods; this is 283 over it, 10.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TypeAnalyzer pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:205 — TooManyMethods — 286 methods. The bar is 30 methods; this is 256 over it, 9.53× 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: Parser pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:133 — TooManyMethods — 273 methods. The bar is 30 methods; this is 243 over it, 9.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: KernelSsaGraphBuilder pkg/compiler/lib/src/ssa/builder.dart:102 — TooManyMethods — 267 methods. The bar is 30 methods; this is 237 over it, 8.90× 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: InferenceVisitorImpl pkg/front_end/lib/src/type_inference/inference_visitor.dart:110 — TooManyMethods — 264 methods. The bar is 30 methods; this is 234 over it, 8.80× 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: Printer pkg/kernel/lib/text/ast_to_text.dart:291 — TooManyMethods — 241 methods. The bar is 30 methods; this is 211 over it, 8.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToSourceVisitor pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:9 — TooManyMethods — 236 methods. The bar is 30 methods; this is 206 over it, 7.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BytecodeGenerator pkg/dart2bytecode/lib/bytecode_generator.dart:112 — TooManyMethods — 211 methods. The bar is 30 methods; this is 181 over it, 7.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InScopeCompletionPass pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:38 — TooManyMethods — 206 methods. The bar is 30 methods; this is 176 over it, 6.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RelevanceDataCollector pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:253 — TooManyMethods — 194 methods. The bar is 30 methods; this is 164 over it, 6.47× 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: SsaCodeGenerator pkg/compiler/lib/src/ssa/codegen.dart:296 — TooManyMethods — 191 methods. The bar is 30 methods; this is 161 over it, 6.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Arm64Assembler pkg/native_compiler/lib/back_end/arm64/assembler.dart:377 — TooManyMethods — 191 methods. The bar is 30 methods; this is 161 over it, 6.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CloneVisitorNotMembers pkg/kernel/lib/clone.dart:10 — TooManyMethods — 174 methods. The bar is 30 methods; this is 144 over it, 5.80× 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.
  • + 408 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×326
  • MethodTooLong: Intrinsifier.generateStaticIntrinsic pkg/dart2wasm/lib/intrinsics.dart:1355 — MethodTooLong — generateStaticIntrinsic runs 2076 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1976 over it, 20.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Types.performSubtypeCheck pkg/kernel/lib/src/types.dart:65 — MethodTooLong — performSubtypeCheck runs 746 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 646 over it, 7.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: NodeCreator._createExpressionFromKind pkg/kernel/lib/src/node_creator.dart:820 — MethodTooLong — _createExpressionFromKind runs 521 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 421 over it, 5.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RequirementsManifest.isSatisfied pkg/analyzer/lib/src/fine/requirements.dart:1004 — MethodTooLong — isSatisfied runs 517 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 417 over it, 5.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Instruction.deserialize pkg/wasm_builder/lib/src/ir/instruction.dart:87 — MethodTooLong — deserialize runs 508 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 408 over it, 5.08× 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: JsNodeDeserializer.read pkg/compiler/lib/src/common/codegen.dart:1564 — MethodTooLong — read runs 416 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 316 over it, 4.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: Intrinsifier.generateMemberIntrinsic pkg/dart2wasm/lib/intrinsics.dart:3741 — MethodTooLong — generateMemberIntrinsic runs 410 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 310 over it, 4.10× 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: VmServerConnection._delegateRequest pkg/vm_service_interface/lib/src/vm_service_interface.dart:1403 — MethodTooLong — _delegateRequest runs 402 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 302 over it, 4.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _FfiUseSiteTransformer._visitStaticInvocation pkg/vm/lib/modular/transformations/ffi/use_sites.dart:359 — MethodTooLong — _visitStaticInvocation runs 360 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 260 over it, 3.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InferenceVisitorBase._inferInvocation pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1738 — MethodTooLong — _inferInvocation runs 357 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× 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: TypeUseGenerator.buildSelectorAccess pkg/front_end/lib/src/kernel/expression_generator.dart:4693 — MethodTooLong — buildSelectorAccess runs 342 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 242 over it, 3.42× 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: _HttpParser._doParse sdk/lib/_http/http_parser.dart:486 — MethodTooLong — _doParse runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× 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: InspectPage._visitObject pkg/observatory/lib/src/app/page.dart:249 — MethodTooLong — _visitObject runs 315 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 215 over it, 3.15× 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: InferenceVisitorBase.inferMethodInvocation pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3621 — MethodTooLong — inferMethodInvocation runs 296 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× 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: ClassMembersNodeBuilder.build pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:597 — MethodTooLong — build runs 292 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FrontendCompiler.compile pkg/frontend_server/lib/frontend_server.dart:699 — MethodTooLong — compile runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× 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: RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart:1075 — MethodTooLong — computeRuntimeTypesNeed runs 269 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 169 over it, 2.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Intrinsifier.generateInstanceIntrinsic pkg/dart2wasm/lib/intrinsics.dart:774 — MethodTooLong — generateInstanceIntrinsic runs 259 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 159 over it, 2.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: StandardBounds.getStandardUpperBoundInternal pkg/kernel/lib/src/standard_bounds.dart:593 — MethodTooLong — getStandardUpperBoundInternal runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× 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: DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:39 — MethodTooLong — DillExtensionTypeDeclarationBuilder runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.57× 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: ImpactData.apply pkg/compiler/lib/src/ir/impact_data.dart:1438 — MethodTooLong — apply runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HeapSnapshotElement._createReport pkg/observatory/lib/src/elements/heap_snapshot.dart:670 — MethodTooLong — _createReport runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InstanceViewElement._createMembers pkg/observatory/lib/src/elements/instance_view.dart:220 — MethodTooLong — _createMembers runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× 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: DartDebugAdapter.variablesRequest pkg/dap_adapters/lib/src/adapters/dart.dart:2554 — MethodTooLong — variablesRequest runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× 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: FastaErrorReporter.reportByCode pkg/analyzer/lib/src/fasta/error_converter.dart:24 — MethodTooLong — reportByCode runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 301 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×252
  • ClassTooLong: DartType runtime/tools/dartfuzz/dartfuzz_type_table.dart:9 — ClassTooLong — 142422 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 142022 over it, 356.06× 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: DartTypeNoFp runtime/tools/dartfuzz/dartfuzz_type_table.dart:173148 — ClassTooLong — 50499 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 50099 over it, 126.25× 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: DartTypeFlatTp runtime/tools/dartfuzz/dartfuzz_type_table.dart:237028 — ClassTooLong — 17795 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 17395 over it, 44.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DartTypeNoFpFlatTp runtime/tools/dartfuzz/dartfuzz_type_table.dart:261194 — ClassTooLong — 17343 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 16943 over it, 43.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: InferenceVisitorImpl pkg/front_end/lib/src/type_inference/inference_visitor.dart:110 — ClassTooLong — 10086 significant lines (blank, comment-only and punctuation-only lines excluded), 264 methods. The bar is 400 significant lines; this is 9686 over it, 25.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: KernelSsaGraphBuilder pkg/compiler/lib/src/ssa/builder.dart:102 — ClassTooLong — 5394 significant lines (blank, comment-only and punctuation-only lines excluded), 267 methods. The bar is 400 significant lines; this is 4994 over it, 13.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AstBuilder pkg/analyzer/lib/src/fasta/ast_builder.dart:52 — ClassTooLong — 4802 significant lines (blank, comment-only and punctuation-only lines excluded), 313 methods. The bar is 400 significant lines; this is 4402 over it, 12.01× 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: InferenceVisitorBase pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:133 — ClassTooLong — 4093 significant lines (blank, comment-only and punctuation-only lines excluded), 133 methods. The bar is 400 significant lines; this is 3693 over it, 10.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TypeAnalyzer pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:205 — ClassTooLong — 3978 significant lines (blank, comment-only and punctuation-only lines excluded), 286 methods. The bar is 400 significant lines; this is 3578 over it, 9.95× 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: InstructionsBuilder pkg/wasm_builder/lib/src/builder/instructions.dart:156 — ClassTooLong — 3886 significant lines (blank, comment-only and punctuation-only lines excluded), 490 methods. The bar is 400 significant lines; this is 3486 over it, 9.72× 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: BinaryBuilder pkg/kernel/lib/binary/ast_from_binary.dart:129 — ClassTooLong — 3328 significant lines (blank, comment-only and punctuation-only lines excluded), 327 methods. The bar is 400 significant lines; this is 2928 over it, 8.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BytecodeGenerator pkg/dart2bytecode/lib/bytecode_generator.dart:112 — ClassTooLong — 3290 significant lines (blank, comment-only and punctuation-only lines excluded), 211 methods. The bar is 400 significant lines; this is 2890 over it, 8.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Intrinsifier pkg/dart2wasm/lib/intrinsics.dart:531 — ClassTooLong — 3247 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 2847 over it, 8.12× 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: OutlineBuilder pkg/front_end/lib/src/source/outline_builder.dart:481 — ClassTooLong — 3180 significant lines (blank, comment-only and punctuation-only lines excluded), 158 methods. The bar is 400 significant lines; this is 2780 over it, 7.95× 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: AbstractParserAstListener pkg/front_end/lib/src/util/parser_ast_helper.dart:88 — ClassTooLong — 2872 significant lines (blank, comment-only and punctuation-only lines excluded), 378 methods. The bar is 400 significant lines; this is 2472 over it, 7.18× 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: SsaCodeGenerator pkg/compiler/lib/src/ssa/codegen.dart:296 — ClassTooLong — 2605 significant lines (blank, comment-only and punctuation-only lines excluded), 191 methods. The bar is 400 significant lines; this is 2205 over it, 6.51× 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: BinaryPrinter pkg/kernel/lib/binary/ast_to_binary.dart:14 — ClassTooLong — 2564 significant lines (blank, comment-only and punctuation-only lines excluded), 320 methods. The bar is 400 significant lines; this is 2164 over it, 6.41× 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: Arm64CodeGenerator pkg/native_compiler/lib/back_end/arm64/code_generator.dart:28 — ClassTooLong — 2522 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 400 significant lines; this is 2122 over it, 6.31× 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: Printer pkg/kernel/lib/text/ast_to_text.dart:291 — ClassTooLong — 2267 significant lines (blank, comment-only and punctuation-only lines excluded), 241 methods. The bar is 400 significant lines; this is 1867 over it, 5.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DeclarationHelper pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:29 — ClassTooLong — 2027 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 1627 over it, 5.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SourceLoader pkg/front_end/lib/src/source/source_loader.dart:104 — ClassTooLong — 1988 significant lines (blank, comment-only and punctuation-only lines excluded), 116 methods. The bar is 400 significant lines; this is 1588 over it, 4.97× 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: DartFixKind pkg/analysis_server/lib/src/services/correction/fix.dart:33 — ClassTooLong — 1961 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 1561 over it, 4.90× 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: NodeCreator pkg/kernel/lib/src/node_creator.dart:18 — ClassTooLong — 1941 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 1541 over it, 4.85× 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: FragmentFactoryImpl pkg/front_end/lib/src/source/fragment_factory_impl.dart:70 — ClassTooLong — 1844 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 400 significant lines; this is 1444 over it, 4.61× 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: DartDebugAdapter pkg/dap_adapters/lib/src/adapters/dart.dart:295 — ClassTooLong — 1749 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 1349 over it, 4.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 227 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×136
  • Duplicated block (7 lines × 2) pkg/_fe_analyzer_shared/lib/src/testing/id.dart:141 — pkg/_fe_analyzer_shared/lib/src/testing/id.dart:141-147 | pkg/_fe_analyzer_shared/lib/src/testing/id.dart:152-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:503 — pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:503-509 | pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:544-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:503` it does not close everything it opens, so those exact lines 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) pkg/cfg/lib/ir/flow_graph_checker.dart:239 — pkg/cfg/lib/ir/flow_graph_checker.dart:239-245 | pkg/cfg/lib/ir/flow_graph_checker.dart:256-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cfg/lib/ir/flow_graph_checker.dart: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `instr` to `Branch` in one and `CompareAndBranch` 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) pkg/cfg/lib/ir/flow_graph_checker.dart:249 — pkg/cfg/lib/ir/flow_graph_checker.dart:249-255 | pkg/cfg/lib/ir/flow_graph_checker.dart:521-527 — both copies are in the same file, so extract the 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 `instr` to `CompareAndBranch` in one and `Comparison` 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) pkg/cfg/lib/passes/constant_propagation.dart:571 — pkg/cfg/lib/passes/constant_propagation.dart:571-577 | pkg/cfg/lib/passes/constant_propagation.dart:602-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cfg/lib/passes/constant_propagation.dart:571` it does not close everything it opens, so those 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 `instr` to `BinaryIntOp` in one and `BinaryDoubleOp` 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) pkg/compiler/lib/src/constants/values.dart:580 — pkg/compiler/lib/src/constants/values.dart:580-586 | pkg/compiler/lib/src/constants/values.dart:711-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/constants/values.dart:580` it does not close everything it opens, so those 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, `pkg/compiler/lib/src/constants/values.dart:719` calls `write`, `toDartText` and `pkg/compiler/lib/src/constants/values.dart:588` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) pkg/compiler/lib/src/constants/values.dart:962 — pkg/compiler/lib/src/constants/values.dart:962-968 | pkg/compiler/lib/src/constants/values.dart:981-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/constants/values.dart:962` it does not close everything it opens, so those exact lines 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) pkg/compiler/lib/src/js_model/elements.dart:297 — pkg/compiler/lib/src/js_model/elements.dart:297-303 | pkg/compiler/lib/src/js_model/elements.dart:351-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) pkg/compiler/lib/src/universe/member_usage.dart:385 — pkg/compiler/lib/src/universe/member_usage.dart:385-391 | pkg/compiler/lib/src/universe/member_usage.dart:540-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) pkg/dart2bytecode/lib/declarations.dart:165 — pkg/dart2bytecode/lib/declarations.dart:165-171 | pkg/dart2bytecode/lib/declarations.dart:1125-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) pkg/dart2wasm/lib/await_transformer.dart:987 — pkg/dart2wasm/lib/await_transformer.dart:987-993 | pkg/dart2wasm/lib/await_transformer.dart:1007-1013 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `expr` to `ListLiteral` in one and `SetLiteral` 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) pkg/dart2wasm/lib/code_generator.dart:2172 — pkg/dart2wasm/lib/code_generator.dart:2172-2178 | pkg/dart2wasm/lib/state_machine.dart:1408-1414 — 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 `pkg/dart2wasm/lib/code_generator.dart:2172` it does not close everything it opens, so those 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 (7 lines × 2) pkg/dart2wasm/lib/constants.dart:649 — pkg/dart2wasm/lib/constants.dart:649-655 | pkg/dart2wasm/lib/constants.dart:685-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/constants.dart: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `constant` to `IntConstant` in one and `DoubleConstant` 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:502 — pkg/dev_compiler/lib/src/kernel/compiler.dart:502-508 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:733-739 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3491 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3491-3497 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4018-4024 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (7 lines × 2) pkg/front_end/testcases/general/constants/potentially_constant_type.dart:57 — pkg/front_end/testcases/general/constants/potentially_constant_type.dart:57-63 | pkg/front_end/testcases/general/constants/potentially_constant_type_lib1.dart:38-44 — before extracting anything, compare `pkg/front_end/testcases/general/constants/potentially_constant_type.dart` and `pkg/front_end/testcases/general/constants/potentially_constant_type_lib1.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) pkg/heap_snapshot/lib/intset.dart:54 — pkg/heap_snapshot/lib/intset.dart:54-60 | pkg/heap_snapshot/lib/intset.dart:81-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) pkg/kernel/lib/src/standard_bounds.dart:337 — pkg/kernel/lib/src/standard_bounds.dart:337-343 | pkg/kernel/lib/src/standard_bounds.dart:661-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 `pkg/kernel/lib/src/standard_bounds.dart:337` 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 `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 (7 lines × 2) pkg/linter/lib/src/rules/public_member_api_docs.dart:43 — pkg/linter/lib/src/rules/public_member_api_docs.dart:43-49 | pkg/linter/lib/src/rules/slash_for_doc_comments.dart:35-41 — 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) pkg/native_compiler/lib/snapshot/snapshot.dart:1827 — pkg/native_compiler/lib/snapshot/snapshot.dart:1827-1833 | pkg/native_compiler/lib/snapshot/snapshot.dart:1872-1878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/native_compiler/lib/snapshot/snapshot.dart:1827` it does not close everything it opens, so those exact lines 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) pkg/native_compiler/lib/snapshot/snapshot.dart:2106 — pkg/native_compiler/lib/snapshot/snapshot.dart:2106-2112 | pkg/native_compiler/lib/snapshot/snapshot.dart:2114-2120 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `List<ast.TypeParameter>` in one and `List<ast.StructuralParameter>` 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) pkg/observatory/lib/src/elements/debugger.dart:779 — pkg/observatory/lib/src/elements/debugger.dart:779-785 | pkg/observatory/lib/src/elements/debugger.dart:866-872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/debugger.dart:779` it does not close everything it opens, so those exact lines 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) pkg/observatory/lib/src/elements/heap_snapshot.dart:1256 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1256-1262 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1282-1288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/heap_snapshot.dart:1256` it does not close everything it opens, so those exact lines 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) pkg/observatory/lib/src/repositories/reachable_size.dart:8 — pkg/observatory/lib/src/repositories/reachable_size.dart:8-14 | pkg/observatory/lib/src/repositories/retained_size.dart:8-14 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) pkg/vm_service/lib/src/vm_service.dart:5236 — pkg/vm_service/lib/src/vm_service.dart:5236-5242 | pkg/vm_service/lib/src/vm_service.dart:5833-5839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 111 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×135
  • Hotspot: pkg/analyzer/lib/src/dart/ast/ast.dart pkg/analyzer/lib/src/dart/ast/ast.dart:62253 — pkg/analyzer/lib/src/dart/ast/ast.dart changed 148 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in V1Projection._toV1Expression at line 62253. 5 of those changes were fix/bug commits, and the other 143 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/ast/ast.dart`: 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: pkg/dart2wasm/lib/intrinsics.dart pkg/dart2wasm/lib/intrinsics.dart:1355 — pkg/dart2wasm/lib/intrinsics.dart changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 409 in Intrinsifier.generateStaticIntrinsic at line 1355. 2 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/dart2wasm/lib/intrinsics.dart`: 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: pkg/analyzer/lib/src/generated/error_verifier.dart pkg/analyzer/lib/src/generated/error_verifier.dart:8327 — pkg/analyzer/lib/src/generated/error_verifier.dart changed 76 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ErrorVerifier._checkUseOfDefaultValuesInParameters at line 8327. 1 of those changes was a fix/bug commit, and the other 75 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/generated/error_verifier.dart`: 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: pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:1913 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart changed 106 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in TypeAnalyzer.visitAnonymousMethodInvocation at line 1913. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart`: 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: pkg/wasm_builder/lib/src/ir/instruction.dart pkg/wasm_builder/lib/src/ir/instruction.dart:87 — pkg/wasm_builder/lib/src/ir/instruction.dart changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 241 in Instruction.deserialize at line 87. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/wasm_builder/lib/src/ir/instruction.dart`: 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: pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:53 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in PropertyElementResolver.resolveCascadeIndex at line 53. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart`: 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: pkg/analyzer/lib/src/error/element_usage_detector.dart pkg/analyzer/lib/src/error/element_usage_detector.dart:73 — pkg/analyzer/lib/src/error/element_usage_detector.dart changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ElementUsageDetector.checkUsage at line 73. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/error/element_usage_detector.dart`: 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: pkg/analyzer/lib/src/error/best_practices_verifier.dart pkg/analyzer/lib/src/error/best_practices_verifier.dart:2081 — pkg/analyzer/lib/src/error/best_practices_verifier.dart changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in _InvalidAccessVerifier._checkForOtherInvalidAccess at line 2081. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/error/best_practices_verifier.dart`: 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: pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:215 — pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in MethodInvocationResolver.resolveUnqualified at line 215. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart`: 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: pkg/analyzer/lib/src/fasta/ast_builder.dart pkg/analyzer/lib/src/fasta/ast_builder.dart:635 — pkg/analyzer/lib/src/fasta/ast_builder.dart changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in AstBuilder.buildInitializer at line 635. 5 of those changes were fix/bug commits, and the other 62 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/fasta/ast_builder.dart`: 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: pkg/analyzer/lib/src/dart/analysis/results.dart pkg/analyzer/lib/src/dart/analysis/results.dart:96 — pkg/analyzer/lib/src/dart/analysis/results.dart changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in DeclarationByElementLocator.visitNode at line 96. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/analysis/results.dart`: 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: pkg/native_compiler/lib/back_end/arm64/code_generator.dart pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2731 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in Arm64CodeGenerator.visitBinaryIntOp at line 2731. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/native_compiler/lib/back_end/arm64/code_generator.dart`: 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: pkg/front_end/lib/src/kernel/constant_evaluator.dart pkg/front_end/lib/src/kernel/constant_evaluator.dart:4300 — pkg/front_end/lib/src/kernel/constant_evaluator.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in ConstantEvaluator._handleInvocation at line 4300. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/kernel/constant_evaluator.dart`: 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: pkg/analyzer/lib/src/dart/analysis/driver.dart pkg/analyzer/lib/src/dart/analysis/driver.dart:1205 — pkg/analyzer/lib/src/dart/analysis/driver.dart changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AnalysisDriver.performWork at line 1205. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/analysis/driver.dart`: 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: pkg/analyzer/lib/src/error/use_result_verifier.dart pkg/analyzer/lib/src/error/use_result_verifier.dart:140 — pkg/analyzer/lib/src/error/use_result_verifier.dart changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in UseResultVerifier._isUsed at line 140. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/error/use_result_verifier.dart`: 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: pkg/analyzer/lib/src/summary2/informative_data.dart pkg/analyzer/lib/src/summary2/informative_data.dart:571 — pkg/analyzer/lib/src/summary2/informative_data.dart changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in _InfoBuilder.build at line 571. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/summary2/informative_data.dart`: 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: pkg/analyzer/lib/src/dart/constant/potentially_constant.dart pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:76 — pkg/analyzer/lib/src/dart/constant/potentially_constant.dart changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in _Collector.collect 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/constant/potentially_constant.dart`: 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: pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1928 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ToSourceVisitor._visitParsedExpression at line 1928. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart`: 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: pkg/front_end/lib/src/type_inference/inference_visitor.dart pkg/front_end/lib/src/type_inference/inference_visitor.dart:671 — pkg/front_end/lib/src/type_inference/inference_visitor.dart changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in InferenceVisitorImpl.visitInstantiation at line 671. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/type_inference/inference_visitor.dart`: 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: pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:1651 — pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ScopeAnalyzer._resolveType at line 1651. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart`: 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: pkg/analyzer/lib/src/error/dead_code_verifier.dart pkg/analyzer/lib/src/error/dead_code_verifier.dart:205 — pkg/analyzer/lib/src/error/dead_code_verifier.dart changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in NullSafetyDeadCodeVerifier.flowEnd at line 205. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/error/dead_code_verifier.dart`: 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: pkg/analyzer/lib/src/dart/constant/evaluation.dart pkg/analyzer/lib/src/dart/constant/evaluation.dart:1882 — pkg/analyzer/lib/src/dart/constant/evaluation.dart changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ConstantVisitor._getConstantValue at line 1882. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/dart/constant/evaluation.dart`: 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: pkg/front_end/lib/src/base/incremental_compiler.dart pkg/front_end/lib/src/base/incremental_compiler.dart:1283 — pkg/front_end/lib/src/base/incremental_compiler.dart changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in IncrementalCompiler._initializeExperimentalInvalidation at line 1283. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/base/incremental_compiler.dart`: 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: pkg/front_end/lib/src/type_inference/inference_visitor_base.dart pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5358 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in InferenceVisitorBase.createPropertyGet at line 5358. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/type_inference/inference_visitor_base.dart`: 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: pkg/analyzer/lib/src/generated/ffi_verifier.dart pkg/analyzer/lib/src/generated/ffi_verifier.dart:1972 — pkg/analyzer/lib/src/generated/ffi_verifier.dart changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in FfiVerifier._validateNativeAddressOf at line 1972. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/analyzer/lib/src/generated/ffi_verifier.dart`: 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.
  • + 110 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×130
  • Duplicated block (8 lines × 2) pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:403 — pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:403-410 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:427-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart: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.
  • Duplicated block (8 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:876 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:876-883 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:998-1008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:876` it does not close everything it opens, so those 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) pkg/_fe_analyzer_shared/lib/src/util/link.dart:25 — pkg/_fe_analyzer_shared/lib/src/util/link.dart:25-32 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link.dart:166-173 — 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 (8 lines × 2) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:101 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:101-108 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:135-142 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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 (8 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:41 — pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:41-48 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart:64-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:41` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:39 — pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:39-46 | pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart:39-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/remove_comment.dart:38 — pkg/analysis_server/lib/src/services/correction/dart/remove_comment.dart:38-45 | pkg/analysis_server/lib/src/services/correction/dart/remove_print.dart:34-41 — 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 `pkg/analysis_server/lib/src/services/correction/dart/remove_comment.dart:38` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart:68 — pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart:68-75 | pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart:94-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/remove_name_from_combinator.dart:68` 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 (8 lines × 2) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:400 — pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:400-407 | pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:871-878 — 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 `pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/analyzer/lib/src/error/annotation_verifier.dart:143 — pkg/analyzer/lib/src/error/annotation_verifier.dart:143-150 | pkg/analyzer/lib/src/error/annotation_verifier.dart:193-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.
  • Duplicated block (8 lines × 2) pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:154 — pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:154-161 | pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:342-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:34 — pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:34-41 | pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:132-139 — both copies are in the same file, so extract the 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) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2021 — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2021-2028 | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2044-2051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2021` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/compiler/lib/src/constants/values.dart:593 — pkg/compiler/lib/src/constants/values.dart:593-600 | pkg/compiler/lib/src/constants/values.dart:726-733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/constants/values.dart:593` it does not close everything it opens, so those 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, `pkg/compiler/lib/src/constants/values.dart:735` calls `write`, `toStructuredText` and `pkg/compiler/lib/src/constants/values.dart:602` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) pkg/compiler/lib/src/dump_info.dart:779 — pkg/compiler/lib/src/dump_info.dart:779-786 | pkg/compiler/lib/src/dump_info.dart:1566-1573 — both copies are in the same file, so extract the 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) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:108 — pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:108-122 | pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:173-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart: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 (8 lines × 2) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:257 — pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:257-264 | pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:324-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/compiler/lib/src/ssa/logging.dart:92 — pkg/compiler/lib/src/ssa/logging.dart:92-99 | pkg/compiler/lib/src/ssa/logging.dart:103-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/logging.dart:92` 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) pkg/compiler/lib/src/ssa/nodes.dart:158 — pkg/compiler/lib/src/ssa/nodes.dart:158-165 | pkg/compiler/lib/src/ssa/nodes.dart:421-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 `pkg/compiler/lib/src/ssa/nodes.dart: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 × 2) pkg/dart2wasm/lib/code_generator.dart:642 — pkg/dart2wasm/lib/code_generator.dart:642-649 | pkg/dart2wasm/lib/code_generator.dart:651-658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/code_generator.dart:642` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/dartdev/lib/src/commands/install.dart:514 — pkg/dartdev/lib/src/commands/install.dart:514-521 | pkg/dartdev/lib/src/commands/uninstall.dart:51-58 — 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 `pkg/dartdev/lib/src/commands/install.dart:514` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/dartdev/lib/src/commands/install.dart:513` calls `stdout` and `pkg/dartdev/lib/src/commands/uninstall.dart:50` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6144 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6144-6151 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6833-6840 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (8 lines × 2) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:276 — pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:276-283 | pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:308-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:619 — pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:619-626 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:638-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:619` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:673 — pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:673-680 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:692-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:673` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 105 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×123
  • Duplicated block (9 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:598 — pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:598-606 | pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:624-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:598` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964-1972 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1513-1521 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:82 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:82-90 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:125-133 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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.
  • Duplicated block (9 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:152 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:152-160 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:435-443 — both copies are in the same file, so extract the 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 `element` to `ClassElement` in one and `MixinElement` 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, `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:434` calls `summarizeSuperclassConstraints` and `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:151` 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) pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:206 — pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:206-214 | pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:313-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:206` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:97 — pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:97-105 | pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:188-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:97` it does not close everything it opens, so those 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, `pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:108` calls `writeParameters` and `pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:199` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:249 — pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:249-257 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:173-181 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:83 — pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:83-91 | pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart:131-139 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart: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.
  • Duplicated block (9 lines × 2) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1281 — pkg/analysis_server/tool/code_completion/completion_metrics.dart:1281-1289 | pkg/analysis_server/tool/code_completion/completion_metrics.dart:1480-1488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/code_completion/completion_metrics.dart:1281` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:7327 — pkg/analyzer/lib/src/dart/ast/ast.dart:7327-7335 | pkg/analyzer/lib/src/dart/ast/ast.dart:7340-7348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:7327` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:22333 — pkg/analyzer/lib/src/dart/ast/ast.dart:22333-22341 | pkg/analyzer/lib/src/dart/ast/ast.dart:22346-22354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:22333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:56298 — pkg/analyzer/lib/src/dart/ast/ast.dart:56298-56306 | pkg/analyzer/lib/src/dart/ast/ast.dart:56311-56319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:56298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:123 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:123-131 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:445-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:123` it does not close everything it opens, so those 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) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:252 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:252-260 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:271-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `covariant ClassDeclaration2Impl` in one and `covariant ClassTypeAlias2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:280` calls `_visitToken`, `_visitNode`, `write` and `pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:261` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/error/best_practices_verifier.dart:837 — pkg/analyzer/lib/src/error/best_practices_verifier.dart:837-845 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:863-872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/best_practices_verifier.dart:837` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `covariant TopLevelFunctionDeclarationImpl` in one and `covariant TopLevelGetterDeclarationImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/fasta/ast_builder.dart:2684 — pkg/analyzer/lib/src/fasta/ast_builder.dart:2684-2692 | pkg/analyzer/lib/src/fasta/ast_builder.dart:4029-4037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/summary2/bundle_reader.dart:259 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:259-267 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:545-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:257` calls `readBool` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:543` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/summary2/bundle_reader.dart:300 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:300-308 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:577-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:300` it does not close everything it opens, so those 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, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:310` calls `_readConstructorFragments` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:586` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/analyzer/lib/src/summary2/bundle_reader.dart:576 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:576-584 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:648-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:576` it does not close everything it opens, so those 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, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:657` calls `_readConstructorFragments` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:585` 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) pkg/analyzer/tool/generators/ast_generator.dart:736 — pkg/analyzer/tool/generators/ast_generator.dart:736-744 | pkg/analyzer/tool/generators/ast_generator.dart:751-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/generators/ast_generator.dart:736` it does not close everything it opens, so those 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) pkg/cfg/lib/ir/flow_graph_checker.dart:579 — pkg/cfg/lib/ir/flow_graph_checker.dart:579-587 | pkg/cfg/lib/ir/flow_graph_checker.dart:601-609 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `instr` to `BoxSimd` in one and `UnboxSimd` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) pkg/compiler/lib/src/inferrer/builder.dart:2268 — pkg/compiler/lib/src/inferrer/builder.dart:2268-2276 | pkg/compiler/lib/src/inferrer/builder.dart:2299-2307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:5755 — pkg/compiler/lib/src/ssa/builder.dart:5755-5763 | pkg/compiler/lib/src/ssa/builder.dart:5765-5773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:5755` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/compiler/lib/src/ssa/optimize.dart:2675 — pkg/compiler/lib/src/ssa/optimize.dart:2675-2683 | pkg/compiler/lib/src/ssa/optimize.dart:2724-2732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `HIsTest` in one and `HIsTestSimple` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) pkg/compiler/lib/src/universe/codegen_world_builder.dart:241 — pkg/compiler/lib/src/universe/codegen_world_builder.dart:241-249 | pkg/compiler/lib/src/universe/resolution_world_builder.dart:413-421 — before extracting anything, compare `pkg/compiler/lib/src/universe/codegen_world_builder.dart` and `pkg/compiler/lib/src/universe/resolution_world_builder.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/universe/codegen_world_builder.dart: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. 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.
  • + 98 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×108
  • Duplicated block (10 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:975 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:975-984 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:943-952 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:975` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1278 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1278-1287 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1947-1956 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1278` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2164 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2164-2173 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2725-2734 — both copies are in the same file, so extract the 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 `node` to `MethodInvocation` in one and `PropertyAccess` 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 (10 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:99 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:99-108 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:75-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 both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:72` calls `writeReference`, `write` and `pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:98` 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 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:508 — pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:508-517 | pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:524-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:508` it does not close everything it opens, so those 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 `node` to `PostfixExpression` in one and `PrefixExpression` 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 (10 lines × 2) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_semantic_token_full_in_big_file.dart:78 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_semantic_token_full_in_big_file.dart:78-87 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file_ask_for_completion.dart:80-89 — 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 `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_semantic_token_full_in_big_file.dart:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:758 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:758-767 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1090-1101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:758` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:770` calls `DynamicPropertyWriteResolutionImpl` and `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1103` 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 lines × 2) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:165 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:165-174 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:398-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:302 — pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:302-311 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:816-825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:302` 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 (10 lines × 2) pkg/analyzer/lib/src/fine/library_manifest.dart:210 — pkg/analyzer/lib/src/fine/library_manifest.dart:210-219 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:476-485 — 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 `pkg/analyzer/lib/src/fine/library_manifest.dart:210` 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) pkg/analyzer/lib/src/summary2/bundle_reader.dart:298 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:298-307 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:492-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:298` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/summary2/informative_data.dart:167 — pkg/analyzer/lib/src/summary2/informative_data.dart:167-176 | pkg/analyzer/lib/src/summary2/informative_data.dart:462-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/informative_data.dart:167` 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, `pkg/analyzer/lib/src/summary2/informative_data.dart:461` calls `_applyToTypeParameters` and `pkg/analyzer/lib/src/summary2/informative_data.dart:166` 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 (10 lines × 2) pkg/analyzer/lib/src/summary2/informative_data.dart:913 — pkg/analyzer/lib/src/summary2/informative_data.dart:913-922 | pkg/analyzer/lib/src/summary2/informative_data.dart:929-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/informative_data.dart:913` it does not close everything it opens, so those 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 `node` to `FunctionTypeAlias2` in one and `GenericTypeAlias2` 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 (10 lines × 2) pkg/analyzer/tool/wolf/generate.dart:96 — pkg/analyzer/tool/wolf/generate.dart:96-105 | pkg/analyzer/tool/wolf/generate.dart:110-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 (10 lines × 2) pkg/cfg/lib/front_end/ast_to_ir.dart:1077 — pkg/cfg/lib/front_end/ast_to_ir.dart:1077-1086 | pkg/cfg/lib/front_end/ast_to_ir.dart:1131-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) pkg/cfg/lib/front_end/ast_to_ir.dart:1781 — pkg/cfg/lib/front_end/ast_to_ir.dart:1781-1790 | pkg/cfg/lib/front_end/ast_to_ir.dart:1806-1815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cfg/lib/front_end/ast_to_ir.dart:1781` 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 (10 lines × 2) pkg/compiler/lib/src/constants/values.dart:715 — pkg/compiler/lib/src/constants/values.dart:715-724 | pkg/compiler/lib/src/constants/values.dart:1162-1171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/constants/values.dart:715` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/compiler/lib/src/constants/values.dart:714` calls `_unparseTypeArguments` and `pkg/compiler/lib/src/constants/values.dart:1161` 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 (10 lines × 2) pkg/compiler/lib/src/constants/values.dart:731 — pkg/compiler/lib/src/constants/values.dart:731-740 | pkg/compiler/lib/src/constants/values.dart:1177-1186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/constants/values.dart:731` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) pkg/compiler/lib/src/deferred_load/import_set.dart:285 — pkg/compiler/lib/src/deferred_load/import_set.dart:285-294 | pkg/dart2wasm/lib/deferred_load/import_set.dart:279-288 — 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 `pkg/compiler/lib/src/deferred_load/import_set.dart: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. 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) pkg/compiler/lib/src/inferrer/engine.dart:286 — pkg/compiler/lib/src/inferrer/engine.dart:286-295 | pkg/compiler/lib/src/inferrer/engine.dart:302-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/inferrer/engine.dart:286` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `info` to `ListTypeInformation` in one and `SetTypeInformation` 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 (10 lines × 2) pkg/compiler/lib/src/inferrer/type_system.dart:838 — pkg/compiler/lib/src/inferrer/type_system.dart:838-847 | pkg/compiler/lib/src/inferrer/type_system.dart:857-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) pkg/compiler/lib/src/js_backend/annotations.dart:544 — pkg/compiler/lib/src/js_backend/annotations.dart:544-553 | pkg/compiler/lib/src/js_backend/annotations.dart:559-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) pkg/compiler/lib/src/kernel/element_map_impl.dart:1415 — pkg/compiler/lib/src/kernel/element_map_impl.dart:1415-1424 | pkg/compiler/lib/src/kernel/element_map_impl.dart:1489-1498 — both copies are in the same file, so extract the 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 `node` to `ir.Procedure` in one and `ir.Field` 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 (10 lines × 2) pkg/dart2native/lib/macho.dart:1007 — pkg/dart2native/lib/macho.dart:1007-1016 | pkg/dart2native/lib/macho.dart:1300-1309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2native/lib/macho.dart:1007` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) pkg/dart2wasm/lib/cfg/to_wasm.dart:326 — pkg/dart2wasm/lib/cfg/to_wasm.dart:326-335 | pkg/dart2wasm/lib/cfg/to_wasm.dart:337-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/cfg/to_wasm.dart:326` 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 `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.
  • + 83 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×105
  • Duplicated block (11 lines × 2) pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200 — pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200-210 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:281-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1939 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1939-1949 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1804-1814 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1933` calls `scanUntilLineEnd`, `current` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1802` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:326 — pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:326-336 | pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:345-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:326` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:119 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:119-129 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:153-163 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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 (11 lines × 2) pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:23 — pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:23-33 | pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart:23-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:23` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1787 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1787-1797 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1857-1867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1787` 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 `node` to `IfElement` in one and `IfStatement` 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) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:870 — pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:870-880 | pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:954-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:870` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:186 — pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:186-196 | pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:325-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:186` 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) pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:62 — pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:62-72 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart:85-97 — 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 `pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart:56 — pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart:56-66 | pkg/linter/lib/src/rules/prefer_for_elements_to_map_fromIterable.dart:58-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:25-35 | pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart:25-35 — 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 `pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:25` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/status/pages/plugins_page.dart:33 — pkg/analysis_server/lib/src/status/pages/plugins_page.dart:33-43 | pkg/analysis_server/lib/src/status/pages/plugins_page.dart:89-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2542 — pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2542-2552 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2618-2628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2542` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/tool/instrumentation/page/stats_page.dart:205 — pkg/analysis_server/tool/instrumentation/page/stats_page.dart:205-215 | pkg/analysis_server/tool/instrumentation/page/stats_page.dart:241-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/instrumentation/page/stats_page.dart:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:8024 — pkg/analyzer/lib/src/dart/ast/ast.dart:8024-8034 | pkg/analyzer/lib/src/dart/ast/ast.dart:8857-8867 — both copies are in the same file, so extract the 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, `pkg/analyzer/lib/src/dart/ast/ast.dart:8868` calls `addToken`, `addNode` and `pkg/analyzer/lib/src/dart/ast/ast.dart:8035` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:8389 — pkg/analyzer/lib/src/dart/ast/ast.dart:8389-8399 | pkg/analyzer/lib/src/dart/ast/ast.dart:9175-9185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/constant/value.dart:1150 — pkg/analyzer/lib/src/dart/constant/value.dart:1150-1160 | pkg/analyzer/lib/src/dart/constant/value.dart:2148-2158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/value.dart:1150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/constant/value.dart:1172 — pkg/analyzer/lib/src/dart/constant/value.dart:1172-1182 | pkg/analyzer/lib/src/dart/constant/value.dart:2170-2180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/value.dart:1172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/constant/value.dart:1250 — pkg/analyzer/lib/src/dart/constant/value.dart:1250-1260 | pkg/analyzer/lib/src/dart/constant/value.dart:2246-2256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/value.dart:1250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/constant/value.dart:1272 — pkg/analyzer/lib/src/dart/constant/value.dart:1272-1282 | pkg/analyzer/lib/src/dart/constant/value.dart:2268-2278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/value.dart:1272` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:432 — pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:432-442 | pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:1226-1236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:432` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:63 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:63-73 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:151-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:63` 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) pkg/analyzer/lib/src/fasta/ast_builder.dart:2166 — pkg/analyzer/lib/src/fasta/ast_builder.dart:2166-2176 | pkg/analyzer/lib/src/fasta/ast_builder.dart:2187-2197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fasta/ast_builder.dart:2166` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/summary2/bundle_writer.dart:649 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:649-659 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:813-823 — both copies are in the same file, so extract the 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 (11 lines × 2) pkg/analyzer/lib/src/summary2/informative_data.dart:378 — pkg/analyzer/lib/src/summary2/informative_data.dart:378-388 | pkg/analyzer/lib/src/summary2/informative_data.dart:511-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/informative_data.dart:378` 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.
  • + 80 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×103
  • Duplicated block (13 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1517 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1517-1529 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1484-1496 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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) pkg/_fe_analyzer_shared/lib/src/util/options.dart:197 — pkg/_fe_analyzer_shared/lib/src/util/options.dart:197-209 | pkg/_fe_analyzer_shared/lib/src/util/options.dart:222-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/util/options.dart:197` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart:21 — pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart:21-33 | pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart:21-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart:21` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart:155 — pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart:155-167 | pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart:66-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_definition.dart: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. 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) pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart:43 — pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart:43-55 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:61-73 — 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 `pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart:43` it does not close everything it opens, so those 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 (13 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:225 — pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:225-237 | pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:251-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:225` it does not close everything it opens, so those 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 (13 lines × 2) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2870 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2870-2882 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3061-3073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2870` 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 `node` to `RedirectingConstructorInvocation` in one and `SuperConstructorInvocation` 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) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:63 — pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:63-75 | pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:89-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:102` calls `writeType`, `write` and `pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:76` 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) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:181 — pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:181-193 | pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:139-151 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart` and `pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:291 — pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:291-303 | pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:355-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:291` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:180 — pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:180-192 | pkg/analysis_server/lib/src/services/correction/dart/move_doc_comment_to_library_directive.dart:51-63 — 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 `pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart: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 (13 lines × 2) pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:129 — pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:129-141 | pkg/analysis_server/lib/src/services/refactoring/remove_constructor_name.dart:76-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/analysis_server/lib/src/services/refactoring/add_import_prefix.dart:136 — pkg/analysis_server/lib/src/services/refactoring/add_import_prefix.dart:136-148 | pkg/analysis_server/lib/src/services/refactoring/remove_import_prefix.dart:72-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 both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2572 — pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2572-2584 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2648-2660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2572` 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) pkg/analyzer/lib/src/dart/ast/ast.dart:1694 — pkg/analyzer/lib/src/dart/ast/ast.dart:1694-1706 | pkg/analyzer/lib/src/dart/ast/ast.dart:35894-35906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:1936 — pkg/analyzer/lib/src/dart/ast/ast.dart:1936-1948 | pkg/analyzer/lib/src/dart/ast/ast.dart:2220-2232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:2007 — pkg/analyzer/lib/src/dart/ast/ast.dart:2007-2019 | pkg/analyzer/lib/src/dart/ast/ast.dart:2291-2303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:11269 — pkg/analyzer/lib/src/dart/ast/ast.dart:11269-11281 | pkg/analyzer/lib/src/dart/ast/ast.dart:11286-11298 — both copies are in the same file, so extract the 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 (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:14060 — pkg/analyzer/lib/src/dart/ast/ast.dart:14060-14072 | pkg/analyzer/lib/src/dart/ast/ast.dart:42397-42409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:18998 — pkg/analyzer/lib/src/dart/ast/ast.dart:18998-19010 | pkg/analyzer/lib/src/dart/ast/ast.dart:32132-32144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:18998` it does not close everything it opens, so those 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 (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:21254 — pkg/analyzer/lib/src/dart/ast/ast.dart:21254-21266 | pkg/analyzer/lib/src/dart/ast/ast.dart:42474-42486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:21254` it does not close everything it opens, so those 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 (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:27158 — pkg/analyzer/lib/src/dart/ast/ast.dart:27158-27170 | pkg/analyzer/lib/src/dart/ast/ast.dart:46044-46056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:38402 — pkg/analyzer/lib/src/dart/ast/ast.dart:38402-38414 | pkg/analyzer/lib/src/dart/ast/ast.dart:39004-39016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:47000 — pkg/analyzer/lib/src/dart/ast/ast.dart:47000-47012 | pkg/analyzer/lib/src/dart/ast/ast.dart:47561-47573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:49983 — pkg/analyzer/lib/src/dart/ast/ast.dart:49983-49995 | pkg/analyzer/lib/src/dart/ast/ast.dart:50177-50189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 78 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×95
  • Duplicated block (12 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2108 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2108-2119 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1373-1384 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2108` 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2374 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2374-2385 | pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2423-2434 — both copies are in the same file, so extract the 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2415 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2415-2426 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1631-1642 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:206 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:206-217 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:32-43 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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 (12 lines × 2) pkg/analysis_server/lib/src/computer/computer_highlights.dart:866 — pkg/analysis_server/lib/src/computer/computer_highlights.dart:866-877 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:892-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ClassDeclaration` in one and `ClassTypeAlias` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242 — pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242-253 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:497-508 — before extracting anything, compare `pkg/analysis_server/lib/src/protocol/protocol_internal.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:970 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:970-981 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3603-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 `pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:970` 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 `node` to `DoStatement` in one and `WhileStatement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) pkg/analysis_server/lib/src/status/pages/analysis_options_page.dart:21 — pkg/analysis_server/lib/src/status/pages/analysis_options_page.dart:21-32 | pkg/analysis_server/lib/src/status/pages/contexts_page.dart:37-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/status/pages/analysis_options_page.dart:21` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:111 — pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:111-122 | pkg/analysis_server/lib/src/status/pages/plugins_page.dart:296-307 — 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 (12 lines × 2) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:79 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:79-90 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:290-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:79` 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 (12 lines × 2) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:255 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:255-266 | pkg/front_end/tool/fuzz/analyzer_helper.dart:468-479 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart` and `pkg/front_end/tool/fuzz/analyzer_helper.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:255` 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 (12 lines × 2) pkg/analyzer/lib/src/dart/analysis/index.dart:1228 — pkg/analyzer/lib/src/dart/analysis/index.dart:1228-1240 | pkg/analyzer/lib/src/dart/analysis/index.dart:1293-1304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/analysis/index.dart:1228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `RedirectingConstructorInvocation` in one and `SuperConstructorInvocation` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:84 — pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:84-95 | pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:117-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:84` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ClassDeclaration2Impl` in one and `ExtensionTypeDeclaration2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/analysis/search.dart:313 — pkg/analyzer/lib/src/dart/analysis/search.dart:313-324 | pkg/analyzer/lib/src/dart/analysis/search.dart:428-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/analysis/search.dart:313` 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 `node` to `DotShorthandMethodInvocation` in one and `UnqualifiedFunctionInvocation` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:14127 — pkg/analyzer/lib/src/dart/ast/ast.dart:14127-14138 | pkg/analyzer/lib/src/dart/ast/ast.dart:42478-42489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:14124 — pkg/analyzer/lib/src/dart/ast/ast.dart:14124-14135 | pkg/analyzer/lib/src/dart/ast/ast.dart:21091-21102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:14124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:26995 — pkg/analyzer/lib/src/dart/ast/ast.dart:26995-27006 | pkg/analyzer/lib/src/dart/ast/ast.dart:27585-27596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:26995` it does not close everything it opens, so those 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, `pkg/analyzer/lib/src/dart/ast/ast.dart:27007` calls `_containsOffset` and `pkg/analyzer/lib/src/dart/ast/ast.dart:27597` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:28988 — pkg/analyzer/lib/src/dart/ast/ast.dart:28988-28999 | pkg/analyzer/lib/src/dart/ast/ast.dart:29148-29159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:28988` 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 (12 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:30261 — pkg/analyzer/lib/src/dart/ast/ast.dart:30261-30272 | pkg/analyzer/lib/src/dart/ast/ast.dart:31055-31066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:30261` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:383 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:383-394 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:709-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:217 — pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:217-228 | pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:231-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:217` 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 `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 (12 lines × 2) pkg/analyzer/lib/src/dart/constant/value.dart:2375 — pkg/analyzer/lib/src/dart/constant/value.dart:2375-2386 | pkg/analyzer/lib/src/dart/constant/value.dart:2395-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/constant/value.dart:2375` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/element/type.dart:974 — pkg/analyzer/lib/src/dart/element/type.dart:974-985 | pkg/analyzer/lib/src/dart/element/type.dart:1012-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/element/type.dart:974` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:106 — pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:106-117 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:688-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:106` 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 (12 lines × 2) pkg/analyzer/lib/src/summary2/bundle_writer.dart:425 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:425-436 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:827-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_writer.dart:827` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `elements` to `List<FieldElementImpl>` in one and `List<TopLevelVariableElementImpl>` 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.
  • + 70 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×92
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/universe/member_usage.dart:382 — pkg/compiler/lib/src/universe/member_usage.dart:382-392 | pkg/compiler/lib/src/universe/member_usage.dart:537-547 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:295 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:295-305 | pkg/dds/lib/src/devtools/memory_profile.dart:335-346 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/serialization/source.dart:648 — pkg/compiler/lib/src/serialization/source.dart:648-658 | pkg/dart2js_info/lib/src/binary/source.dart:122-133 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:644 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:644-654 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2138-2151 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/lib/collection/list.dart:200 — sdk/lib/collection/list.dart:200-210 | sdk/lib/internal/iterable.dart:202-212 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/ssa/optimize.dart:1375 — pkg/compiler/lib/src/ssa/optimize.dart:1375-1387 | pkg/compiler/lib/src/ssa/optimize.dart:1401-1411 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:479 — pkg/dev_compiler/lib/src/js_ast/template.dart:479-489 | pkg/dev_compiler/lib/src/js_ast/template.dart:491-501 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/lib/io/file_impl.dart:343 — sdk/lib/io/file_impl.dart:343-353 | sdk/lib/io/link.dart:296-309 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/heap_snapshot/lib/intset.dart:52 — pkg/heap_snapshot/lib/intset.dart:52-62 | pkg/heap_snapshot/lib/intset.dart:79-95 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:96 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:96-106 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:683-693 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/analyzer/lib/src/fine/manifest_item.dart:1047 — pkg/analyzer/lib/src/fine/manifest_item.dart:1047-1058 | pkg/analyzer/lib/src/fine/requirements.dart:128-138 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/ir/visitors.dart:302 — pkg/compiler/lib/src/ir/visitors.dart:302-316 | pkg/compiler/lib/src/ir/visitors.dart:318-328 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dart2wasm/lib/constants.dart:1832 — pkg/dart2wasm/lib/constants.dart:1832-1843 | pkg/dart2wasm/lib/constants.dart:1845-1855 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dartpad_worker/lib/src/tools/sandbox.dart:217 — pkg/dartpad_worker/lib/src/tools/sandbox.dart:217-229 | pkg/dartpad_worker/lib/src/tools/sandbox.dart:231-241 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:283 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:283-293 | pkg/dds/lib/src/devtools/memory_profile.dart:323-333 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/js_ast/lib/src/template.dart:735 — pkg/js_ast/lib/src/template.dart:735-745 | pkg/js_ast/lib/src/template.dart:747-758 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:356 — sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:356-366 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:409-419 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/insert_body.dart:21 — pkg/analysis_server/lib/src/services/correction/dart/insert_body.dart:21-31 | pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart:25-42 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_merger.dart:312 — pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_merger.dart:312-322 | pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_merger.dart:398-409 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dart2bytecode/lib/assembler.dart:181 — pkg/dart2bytecode/lib/assembler.dart:181-191 | pkg/dart2bytecode/lib/assembler.dart:193-204 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart:140 — pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart:140-151 | pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart:209-219 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/dart2wasm/lib/code_generator.dart:1334 — pkg/dart2wasm/lib/code_generator.dart:1334-1344 | pkg/dart2wasm/lib/code_generator.dart:1346-1362 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:750 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:750-760 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:784-794 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/kernel/lib/src/ast/constants.dart:62 — pkg/kernel/lib/src/ast/constants.dart:62-72 | pkg/kernel/lib/src/ast/constants.dart:151-164 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/kernel/lib/src/norm.dart:98 — pkg/kernel/lib/src/norm.dart:98-108 | pkg/kernel/lib/src/norm.dart:110-123 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 67 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×92
  • Duplicated block (6 lines × 2) pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:632 — pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:632-637 | pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:813-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:632` it does not close everything it opens, so those 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) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:230 — pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:230-235 | pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:186-191 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart` and `pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:230` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/utilities/string_search.dart:89 — pkg/analyzer/lib/src/utilities/string_search.dart:89-94 | pkg/analyzer/lib/src/utilities/string_search.dart:127-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/utilities/string_search.dart:89` it does not close everything it opens, so those exact lines 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) pkg/compiler/lib/src/js_model/closure.dart:1235 — pkg/compiler/lib/src/js_model/closure.dart:1235-1240 | pkg/compiler/lib/src/js_model/records.dart:382-387 — 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 (6 lines × 2) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1705 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1705-1710 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1822-1827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1705` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1712 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1712-1717 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1829-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1719 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1719-1724 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1836-1841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1719` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2497 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2497-2502 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2545-2550 — both copies are in the same file, so extract the 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 `instr` to `BoxDouble` in one and `BoxSimd` 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 × 2) pkg/observatory/lib/src/elements/heap_snapshot.dart:1179 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1179-1184 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1198-1203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/heap_snapshot.dart:1179` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:172 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:172-177 | sdk/lib/_internal/js_runtime/lib/js_array.dart:252-259 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 `sdk/lib/_internal/js_dev_runtime/private/js_array.dart: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `test` to `bool Function(E)` in one and `bool Function(E element)` 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 × 2) sdk/lib/_internal/vm/lib/mirrors_impl.dart:757 — sdk/lib/_internal/vm/lib/mirrors_impl.dart:757-762 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:986-991 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:720 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:720-725 | sdk/lib/_internal/wasm/common/compact_hash.dart:678-683 — before extracting anything, compare `sdk/lib/_internal/vm_shared/lib/compact_hash.dart` and `sdk/lib/_internal/wasm/common/compact_hash.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 194 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 `sdk/lib/_internal/vm_shared/lib/compact_hash.dart:720` it does not close everything it opens, so those exact lines 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) sdk/lib/internal/internal.dart:216 — sdk/lib/internal/internal.dart:216-221 | sdk/lib/internal/internal.dart:226-231 — both copies are in the same file, so extract the 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, `sdk/lib/internal/internal.dart:232` calls `combine` and `sdk/lib/internal/internal.dart:222` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2358 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2358-2363 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2658-2663 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:723 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:723-728 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:741-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/vm_shared/lib/compact_hash.dart:723` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) pkg/front_end/testcases/dartdevc/factory_patch/patch_lib.dart:14 — pkg/front_end/testcases/dartdevc/factory_patch/patch_lib.dart:14-19 | pkg/front_end/testcases/general/factory_patch/patch_lib.dart:14-19 — before extracting anything, compare `pkg/front_end/testcases/dartdevc/factory_patch/patch_lib.dart` and `pkg/front_end/testcases/general/factory_patch/patch_lib.dart` as WHOLE FILES: 87% 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 (6 lines × 2) pkg/front_end/testcases/offsets/switch_encoding.dart:18 — pkg/front_end/testcases/offsets/switch_encoding.dart:18-23 | pkg/front_end/testcases/patterns/switch_encoding.dart:18-23 — `pkg/front_end/testcases/offsets/switch_encoding.dart` and `pkg/front_end/testcases/patterns/switch_encoding.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 6 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 2) pkg/_fe_analyzer_shared/lib/src/util/link.dart:108 — pkg/_fe_analyzer_shared/lib/src/util/link.dart:108-113 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link.dart:42-47 — 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) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:136 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:136-141 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:112-117 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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.
  • Duplicated block (6 lines × 2) pkg/analyzer/lib/src/binary/binary_reader.dart:281 — pkg/analyzer/lib/src/binary/binary_reader.dart:281-286 | pkg/kernel/lib/binary/ast_from_binary.dart:234-239 — 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) pkg/analyzer/lib/src/fine/library_manifest_ids.dart:67 — pkg/analyzer/lib/src/fine/library_manifest_ids.dart:67-72 | pkg/analyzer/lib/src/fine/manifest_item.dart:117-122 — 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 (6 lines × 2) pkg/compiler/lib/src/js/js.dart:370 — pkg/compiler/lib/src/js/js.dart:370-375 | pkg/js_ast/lib/src/nodes.dart:792-797 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) pkg/compiler/lib/src/js/js.dart:377 — pkg/compiler/lib/src/js/js.dart:377-382 | pkg/js_ast/lib/src/nodes.dart:799-804 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) pkg/compiler/lib/src/js_backend/enqueuer.dart:68 — pkg/compiler/lib/src/js_backend/enqueuer.dart:68-73 | pkg/compiler/lib/src/resolution/enqueuer.dart:71-76 — `pkg/compiler/lib/src/js_backend/enqueuer.dart` and `pkg/compiler/lib/src/resolution/enqueuer.dart` 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 60 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 2) pkg/compiler/lib/src/js_backend/enqueuer.dart:151 — pkg/compiler/lib/src/js_backend/enqueuer.dart:151-156 | pkg/compiler/lib/src/resolution/enqueuer.dart:152-157 — `pkg/compiler/lib/src/js_backend/enqueuer.dart` and `pkg/compiler/lib/src/resolution/enqueuer.dart` 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 60 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.
  • + 67 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×88
  • Edited copy of a member (10 corresponding lines) pkg/vm_service/lib/src/vm_service.dart:3567 — pkg/vm_service/lib/src/vm_service.dart:3567-3578 | pkg/vm_service/lib/src/vm_service.dart:3643-3652 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:3019 — pkg/compiler/lib/src/js/rewrite_async.dart:3019-3028 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3156-3165 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/js_model/type_recipe.dart:119 — pkg/compiler/lib/src/js_model/type_recipe.dart:119-131 | pkg/compiler/lib/src/js_model/type_recipe.dart:326-335 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/observatory/lib/src/elements/field_view.dart:305 — pkg/observatory/lib/src/elements/field_view.dart:305-314 | pkg/observatory/lib/src/elements/function_view.dart:411-420 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/dart2wasm/lib/intrinsics.dart:80 — pkg/dart2wasm/lib/intrinsics.dart:80-89 | pkg/dart2wasm/lib/intrinsics.dart:509-518 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:3258 — pkg/compiler/lib/src/js/rewrite_async.dart:3258-3267 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3343-3352 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:240 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:240-249 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:254-263 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:453 — pkg/dev_compiler/lib/src/js_ast/template.dart:453-462 | pkg/dev_compiler/lib/src/js_ast/template.dart:650-660 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/observatory/lib/src/repositories/metric.dart:104 — pkg/observatory/lib/src/repositories/metric.dart:104-113 | pkg/observatory/lib/src/repositories/metric.dart:132-141 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/cfg/lib/ir/flow_graph_checker.dart:236 — pkg/cfg/lib/ir/flow_graph_checker.dart:236-245 | pkg/cfg/lib/ir/flow_graph_checker.dart:264-274 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1177 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1177-1186 | pkg/js_ast/lib/src/builder.dart:1025-1034 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/ssa/logging.dart:90 — pkg/compiler/lib/src/ssa/logging.dart:90-99 | pkg/compiler/lib/src/ssa/logging.dart:101-110 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1269 — pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1269-1278 | pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1299-1308 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/dart2bytecode/lib/constant_pool.dart:911 — pkg/dart2bytecode/lib/constant_pool.dart:911-920 | pkg/dart2bytecode/lib/object_table.dart:2131-2142 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/js_model/closure.dart:1393 — pkg/compiler/lib/src/js_model/closure.dart:1393-1403 | pkg/compiler/lib/src/js_model/env.dart:893-902 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/observatory/lib/src/service/object.dart:1877 — pkg/observatory/lib/src/service/object.dart:1877-1886 | pkg/observatory/lib/src/service/object.dart:1888-1901 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:631 — sdk/lib/_internal/wasm/js_common/js_string.dart:631-642 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:464-473 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:4106 — pkg/analyzer/lib/src/fasta/ast_builder.dart:4106-4120 | pkg/analyzer/lib/src/fasta/ast_builder.dart:5951-5960 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/analyzer/lib/src/fine/manifest_item.dart:532 — pkg/analyzer/lib/src/fine/manifest_item.dart:532-541 | pkg/analyzer/lib/src/fine/manifest_item.dart:1503-1512 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/front_end/lib/src/kernel/invalid_type.dart:145 — pkg/front_end/lib/src/kernel/invalid_type.dart:145-154 | pkg/kernel/lib/src/bounds_checks.dart:1183-1192 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/analyzer/lib/src/analysis_options/linter_rule_options_validator.dart:25 — pkg/analyzer/lib/src/analysis_options/linter_rule_options_validator.dart:25-34 | pkg/analyzer/lib/src/analysis_options/linter_rule_options_validator.dart:36-45 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart:41 — pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart:41-50 | pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart:52-62 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/compiler/lib/src/js_model/closure.dart:706 — pkg/compiler/lib/src/js_model/closure.dart:706-715 | pkg/compiler/lib/src/js_model/closure.dart:764-774 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/kernel/lib/type_checker.dart:716 — pkg/kernel/lib/type_checker.dart:716-725 | pkg/kernel/lib/type_checker.dart:727-736 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1615 — sdk/lib/_internal/vm/lib/convert_patch.dart:1615-1624 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1445-1454 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 63 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×87
  • Edited copy of a member (9 corresponding lines) pkg/wasm_builder/lib/src/ir/instruction.dart:2952 — pkg/wasm_builder/lib/src/ir/instruction.dart:2952-2960 | pkg/wasm_builder/lib/src/ir/instruction.dart:3000-3010 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:1383 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1383-1391 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1413-1425 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/io/io_resource_info.dart:125 — sdk/lib/io/io_resource_info.dart:125-133 | sdk/lib/io/io_resource_info.dart:200-210 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:539 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:539-547 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:874-886 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/async/future_impl.dart:447 — sdk/lib/async/future_impl.dart:447-458 | sdk/lib/async/future_impl.dart:478-486 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:594 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:594-602 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2082-2090 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/wasm_builder/lib/src/builder/elements.dart:84 — pkg/wasm_builder/lib/src/builder/elements.dart:84-92 | pkg/wasm_builder/lib/src/builder/elements.dart:138-146 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/_internal/vm/lib/array.dart:259 — sdk/lib/_internal/vm/lib/array.dart:259-267 | sdk/lib/_internal/wasm/common/list.dart:39-51 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/dart2wasm/lib/intrinsics.dart:91 — pkg/dart2wasm/lib/intrinsics.dart:91-103 | pkg/dart2wasm/lib/intrinsics.dart:520-528 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/_internal/vm/lib/string_patch.dart:587 — sdk/lib/_internal/vm/lib/string_patch.dart:587-596 | sdk/lib/_internal/vm/lib/string_patch.dart:598-606 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/compiler/lib/src/constants/values.dart:639 — pkg/compiler/lib/src/constants/values.dart:639-647 | pkg/compiler/lib/src/constants/values.dart:649-658 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/kernel/lib/src/ast/patterns.dart:2329 — pkg/kernel/lib/src/ast/patterns.dart:2329-2337 | pkg/kernel/lib/src/ast/patterns.dart:2339-2347 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/vm_service/lib/src/vm_service.dart:7987 — pkg/vm_service/lib/src/vm_service.dart:7987-7996 | pkg/vm_service/lib/src/vm_service.dart:8661-8669 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:122 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:122-130 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:682-690 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/dartpad_worker/lib/src/worker.dart:380 — pkg/dartpad_worker/lib/src/worker.dart:380-388 | pkg/dartpad_worker/lib/src/worker.dart:390-398 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/_internal/vm_shared/lib/map_patch.dart:16 — sdk/lib/_internal/vm_shared/lib/map_patch.dart:16-24 | sdk/lib/_internal/vm_shared/lib/map_patch.dart:28-36 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/vmservice/message.dart:51 — sdk/lib/vmservice/message.dart:51-59 | sdk/lib/vmservice/message.dart:62-70 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/compiler/lib/src/ssa/tracer.dart:511 — pkg/compiler/lib/src/ssa/tracer.dart:511-519 | pkg/compiler/lib/src/ssa/tracer.dart:551-560 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/analyzer/lib/src/binary/binary_reader.dart:222 — pkg/analyzer/lib/src/binary/binary_reader.dart:222-230 | pkg/analyzer/lib/src/binary/binary_reader.dart:232-240 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:82 — pkg/compiler/lib/src/ssa/value_range_analyzer.dart:82-90 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:92-100 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/_http/http_impl.dart:1760 — sdk/lib/_http/http_impl.dart:1760-1768 | sdk/lib/io/data_transformer.dart:477-486 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) sdk/lib/io/io_resource_info.dart:113 — sdk/lib/io/io_resource_info.dart:113-121 | sdk/lib/io/io_resource_info.dart:187-198 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/analysis_server/lib/src/status/pages.dart:117 — pkg/analysis_server/lib/src/status/pages.dart:117-125 | pkg/analysis_server/lib/src/status/pages.dart:156-164 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/dtd_impl/lib/src/dart_tooling_daemon.dart:484 — pkg/dtd_impl/lib/src/dart_tooling_daemon.dart:484-503 | pkg/dwds/lib/src/services/debug_service.dart:270-278 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pkg/vm/lib/transformations/type_flow/summary_collector.dart:2267 — pkg/vm/lib/transformations/type_flow/summary_collector.dart:2267-2279 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:2289-2297 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 62 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×86
  • Edited copy of a member (15 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:720 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:720-734 | sdk/lib/_internal/wasm/common/compact_hash.dart:678-692 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:109 — sdk/lib/_internal/wasm/js_common/js_string.dart:109-123 | sdk/lib/_internal/wasm/js_common/js_string.dart:125-148 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/front_end/testcases/general/pure_index_expressions.dart:92 — pkg/front_end/testcases/general/pure_index_expressions.dart:92-106 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:104-119 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/front_end/testcases/general/pure_index_expressions.dart:196 — pkg/front_end/testcases/general/pure_index_expressions.dart:196-210 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:214-229 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:1063 — sdk/lib/_internal/wasm/common/typed_data.dart:1063-1081 | sdk/lib/_internal/wasm/common/typed_data.dart:1109-1123 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:290 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:290-304 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:615-629 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:387 — pkg/dev_compiler/lib/src/js_ast/template.dart:387-401 | pkg/js_ast/lib/src/template.dart:378-394 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/collection/set.dart:242 — sdk/lib/collection/set.dart:242-257 | sdk/lib/collection/set.dart:259-273 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/kernel/lib/src/ast/constants.dart:514 — pkg/kernel/lib/src/ast/constants.dart:514-528 | pkg/kernel/lib/src/ast/expressions.dart:4985-5002 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:967 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:967-981 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3600-3614 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart:77 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart:77-91 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter.dart:183-199 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1464 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1464-1478 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1480-1494 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/front_end/lib/src/type_inference/type_inference_engine.dart:74 — pkg/front_end/lib/src/type_inference/type_inference_engine.dart:74-91 | pkg/kernel/lib/src/find_type_visitor.dart:17-31 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:573 — pkg/observatory/lib/src/elements/heap_snapshot.dart:573-590 | pkg/observatory/lib/src/elements/process_snapshot.dart:304-318 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/_http/http_headers.dart:751 — sdk/lib/_http/http_headers.dart:751-765 | sdk/lib/_http/http_headers.dart:781-796 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/compiler/lib/src/elements/types.dart:211 — pkg/compiler/lib/src/elements/types.dart:211-228 | pkg/kernel/lib/src/assumptions.dart:72-86 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:5851 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5851-5867 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6506-6520 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/io/file_impl.dart:1104 — sdk/lib/io/file_impl.dart:1104-1119 | sdk/lib/io/file_impl.dart:1133-1147 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/compiler/lib/src/inferrer/engine.dart:281 — pkg/compiler/lib/src/inferrer/engine.dart:281-295 | pkg/compiler/lib/src/inferrer/engine.dart:297-312 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/dartpad_worker/lib/src/tools/vm_service/isolate_manager.dart:289 — pkg/dartpad_worker/lib/src/tools/vm_service/isolate_manager.dart:289-303 | pkg/dartpad_worker/lib/src/tools/vm_service/isolate_manager.dart:305-319 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/front_end/tool/bench_maker.dart:113 — pkg/front_end/tool/bench_maker.dart:113-127 | pkg/front_end/tool/bench_maker.dart:129-146 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/observatory/lib/src/service/object.dart:807 — pkg/observatory/lib/src/service/object.dart:807-821 | pkg/observatory/lib/src/service/object.dart:1794-1810 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/lib/convert/string_conversion.dart:136 — sdk/lib/convert/string_conversion.dart:136-151 | sdk/lib/io/stdio.dart:450-464 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/analyzer/lib/src/summary2/bundle_writer.dart:534 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:534-548 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:757-771 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pkg/dart2bytecode/lib/bytecode_serialization.dart:239 — pkg/dart2bytecode/lib/bytecode_serialization.dart:239-253 | pkg/native_compiler/lib/snapshot/snapshot.dart:3067-3081 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 61 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×86
  • Edited copy of a member (13 corresponding lines) pkg/wasm_builder/lib/src/builder/types.dart:402 — pkg/wasm_builder/lib/src/builder/types.dart:402-414 | pkg/wasm_builder/lib/src/ir/type.dart:992-1007 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/analyzer/lib/src/dart/micro/utils.dart:535 — pkg/analyzer/lib/src/dart/micro/utils.dart:535-555 | pkg/analyzer/lib/src/dart/micro/utils.dart:700-712 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/tools/heapsnapshot/lib/src/cli.dart:173 — runtime/tools/heapsnapshot/lib/src/cli.dart:173-185 | runtime/tools/heapsnapshot/lib/src/cli.dart:208-220 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:543 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:543-555 | sdk/lib/_internal/wasm/common/compact_hash.dart:508-520 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:145 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:145-157 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:110-122 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/remove_character.dart:27 — pkg/analysis_server/lib/src/services/correction/dart/remove_character.dart:27-39 | pkg/analysis_server/lib/src/services/correction/dart/replace_with_unicode_escape.dart:22-37 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/observatory/lib/src/elements/script_inset.dart:379 — pkg/observatory/lib/src/elements/script_inset.dart:379-394 | pkg/observatory/lib/src/elements/script_inset.dart:396-408 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dart2wasm/lib/code_generator.dart:3313 — pkg/dart2wasm/lib/code_generator.dart:3313-3331 | pkg/dart2wasm/lib/code_generator.dart:3333-3345 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/compiler/lib/src/js_backend/namer.dart:183 — pkg/compiler/lib/src/js_backend/namer.dart:183-195 | pkg/compiler/lib/src/js_backend/namer.dart:209-224 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8449 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8449-8461 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8463-8477 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/vm/lib/transformations/type_flow/rta.dart:169 — pkg/vm/lib/transformations/type_flow/rta.dart:169-181 | pkg/vm/lib/transformations/type_flow/rta.dart:183-195 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/compiler/lib/src/dump_info.dart:409 — pkg/compiler/lib/src/dump_info.dart:409-421 | pkg/compiler/lib/src/dump_info.dart:1193-1206 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dart2wasm/lib/functions.dart:209 — pkg/dart2wasm/lib/functions.dart:209-226 | pkg/dart2wasm/lib/functions.dart:228-240 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:3987 — pkg/kernel/lib/src/ast/expressions.dart:3987-3999 | pkg/kernel/lib/src/ast/expressions.dart:4001-4013 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:121 — sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:121-143 | sdk/lib/convert/utf.dart:668-680 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:4504 — pkg/kernel/lib/binary/ast_from_binary.dart:4504-4516 | pkg/kernel/lib/binary/ast_from_binary.dart:4518-4535 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1623 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1623-1635 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1758-1770 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dart2js_info/lib/src/binary/sink.dart:371 — pkg/dart2js_info/lib/src/binary/sink.dart:371-383 | pkg/kernel/lib/binary/ast_to_binary.dart:3869-3882 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dart2wasm/lib/state_machine.dart:909 — pkg/dart2wasm/lib/state_machine.dart:909-927 | pkg/dart2wasm/lib/state_machine.dart:1274-1286 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/analyzer/tool/summary/mini_ast.dart:218 — pkg/analyzer/tool/summary/mini_ast.dart:218-230 | pkg/analyzer/tool/summary/mini_ast.dart:503-519 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dart2wasm/lib/functions.dart:316 — pkg/dart2wasm/lib/functions.dart:316-329 | pkg/dart2wasm/lib/functions.dart:331-343 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:4614 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4614-4626 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5216-5236 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/front_end/tool/parser_ast_indexer.dart:175 — pkg/front_end/tool/parser_ast_indexer.dart:175-187 | pkg/front_end/tool/parser_ast_indexer.dart:212-226 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/vm/lib/transformations/type_flow/transformer.dart:2044 — pkg/vm/lib/transformations/type_flow/transformer.dart:2044-2056 | pkg/vm/lib/transformations/type_flow/transformer.dart:2083-2098 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1594 — sdk/lib/_internal/vm/lib/convert_patch.dart:1594-1606 | sdk/lib/_internal/wasm/common/convert_patch.dart:1929-1941 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 61 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×85
  • Duplicated block (14 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:575 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:575-588 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:623-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:575` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1400 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1400-1413 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1498-1511 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (14 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1415 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1415-1428 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1749-1762 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 before the matched lines, `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1744` calls `tokenizePercent` and `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1412` 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 × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1568 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1568-1581 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1709-1722 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1568` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2268 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2268-2281 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1318-1331 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2268` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2283 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2283-2296 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1333-1346 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2283` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2443 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2443-2456 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1655-1668 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:143 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:143-156 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:97-110 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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 (14 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:41 — pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:41-54 | pkg/analysis_server/lib/src/lsp/handlers/code_actions/pubspec.dart:43-56 — 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 `pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:182 — pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:182-195 | pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:238-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:182` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:160 — pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:160-173 | pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:214-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 (14 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart:169 — pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart:169-182 | pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart:61-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:394 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:394-407 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:435-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:394` 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) pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/use_eq_eq_null.dart:25-38 | pkg/analysis_server/lib/src/services/correction/dart/use_not_eq_null.dart:25-38 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:1992 — pkg/analyzer/lib/src/dart/ast/ast.dart:1992-2005 | pkg/analyzer/lib/src/dart/ast/ast.dart:2276-2289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:8027 — pkg/analyzer/lib/src/dart/ast/ast.dart:8027-8040 | pkg/analyzer/lib/src/dart/ast/ast.dart:8393-8406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:8027` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:36770 — pkg/analyzer/lib/src/dart/ast/ast.dart:36770-36783 | pkg/analyzer/lib/src/dart/ast/ast.dart:54047-54060 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:37020 — pkg/analyzer/lib/src/dart/ast/ast.dart:37020-37033 | pkg/analyzer/lib/src/dart/ast/ast.dart:39805-39818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:40018 — pkg/analyzer/lib/src/dart/ast/ast.dart:40018-40031 | pkg/analyzer/lib/src/dart/ast/ast.dart:58516-58529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:40018` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:46827 — pkg/analyzer/lib/src/dart/ast/ast.dart:46827-46840 | pkg/analyzer/lib/src/dart/ast/ast.dart:46846-46859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:46827` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:52492 — pkg/analyzer/lib/src/dart/ast/ast.dart:52492-52505 | pkg/analyzer/lib/src/dart/ast/ast.dart:56028-56041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:60352 — pkg/analyzer/lib/src/dart/ast/ast.dart:60352-60365 | pkg/analyzer/lib/src/dart/ast/ast.dart:60370-60383 — both copies are in the same file, so extract the 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 (14 lines × 2) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:137 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:137-150 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:454-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart: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. 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) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:248 — pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:248-261 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:321-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4267 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4267-4280 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4418-4431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4267` 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 `node` to `covariant RedirectingConstructorInvocationImpl` in one and `covariant SuperConstructorInvocationImpl` 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.
  • + 60 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×83
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2793 — sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2793-2804 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2810-2826 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:630 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:630-643 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1758-1769 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:113 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:113-125 | sdk/lib/_internal/js_runtime/lib/js_array.dart:195-206 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:192 — sdk/lib/_internal/wasm/js_common/js_string.dart:192-203 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:130-141 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:299 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:299-312 | sdk/lib/_internal/js_runtime/lib/js_number.dart:334-345 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/compiler/lib/src/constants/values.dart:580 — pkg/compiler/lib/src/constants/values.dart:580-591 | pkg/compiler/lib/src/constants/values.dart:593-605 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:58 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:58-69 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1550-1565 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/front_end/testcases/extension_types/field_access.dart:34 — pkg/front_end/testcases/extension_types/field_access.dart:34-45 | pkg/front_end/testcases/extension_types/field_access.dart:68-79 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:560 — pkg/observatory/lib/src/elements/heap_snapshot.dart:560-571 | pkg/observatory/lib/src/elements/process_snapshot.dart:291-302 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/wasm/common/type.dart:320 — sdk/lib/_internal/wasm/common/type.dart:320-331 | sdk/lib/_internal/wasm/common/type.dart:630-647 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/collection/list.dart:187 — sdk/lib/collection/list.dart:187-198 | sdk/lib/internal/iterable.dart:189-200 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/front_end/lib/src/source/source_loader.dart:3704 — pkg/front_end/lib/src/source/source_loader.dart:3704-3715 | pkg/front_end/lib/src/source/source_loader.dart:3717-3730 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/wasm/js_common/convert_js_patch.dart:27 — sdk/lib/_internal/wasm/js_common/convert_js_patch.dart:27-38 | sdk/lib/_internal/wasm/standalone/convert_standalone_patch.dart:22-34 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:195 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:195-206 | sdk/lib/_internal/js_runtime/lib/js_number.dart:234-245 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:2464 — pkg/kernel/lib/binary/ast_to_binary.dart:2464-2476 | pkg/kernel/lib/binary/ast_to_binary.dart:3162-3173 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/compiler/lib/src/elements/types.dart:1283 — pkg/compiler/lib/src/elements/types.dart:1283-1294 | pkg/compiler/lib/src/js_model/js_to_frontend_map.dart:486-497 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:784 — pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:784-797 | pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:799-810 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:9091 — pkg/front_end/lib/src/kernel/body_builder.dart:9091-9102 | pkg/front_end/lib/src/kernel/body_builder.dart:11297-11314 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:311 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:311-322 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:324-336 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/front_end/tool/flame/instrumenter.dart:357 — pkg/front_end/tool/flame/instrumenter.dart:357-368 | pkg/front_end/tool/flame/instrumenter.dart:370-382 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:1451 — pkg/kernel/lib/binary/ast_from_binary.dart:1451-1467 | pkg/kernel/lib/binary/ast_from_binary.dart:1469-1480 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/analyzer/lib/src/dart/element/display_string_builder.dart:479 — pkg/analyzer/lib/src/dart/element/display_string_builder.dart:479-492 | pkg/analyzer/lib/src/dart/element/display_string_builder.dart:501-512 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/navigation/navigation_dart.dart:464 — pkg/analyzer_plugin/lib/src/utilities/navigation/navigation_dart.dart:464-475 | pkg/analyzer_plugin/lib/src/utilities/navigation/navigation_dart.dart:736-748 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/dart2bytecode/lib/object_table.dart:1440 — pkg/dart2bytecode/lib/object_table.dart:1440-1451 | pkg/kernel/lib/src/ast/helpers.dart:224-237 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1146 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1146-1157 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1883-1894 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 58 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×80
  • Edited copy of a member (14 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:159 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:159-176 | sdk/lib/_internal/js_runtime/lib/js_string.dart:144-157 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:259 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:259-272 | sdk/lib/_internal/wasm/common/compact_hash.dart:229-242 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/native_stack_traces/lib/src/elf.dart:361 — pkg/native_stack_traces/lib/src/elf.dart:361-380 | pkg/native_stack_traces/lib/src/elf.dart:502-515 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/analyzer/lib/src/dart/micro/utils.dart:610 — pkg/analyzer/lib/src/dart/micro/utils.dart:610-625 | pkg/analyzer/lib/src/dart/micro/utils.dart:637-650 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:1203 — pkg/compiler/lib/src/ssa/value_range_analyzer.dart:1203-1216 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:1218-1232 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) sdk/lib/_internal/vm/lib/stopwatch_patch.dart:23 — sdk/lib/_internal/vm/lib/stopwatch_patch.dart:23-38 | sdk/lib/_internal/vm/lib/stopwatch_patch.dart:40-53 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:168 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:168-183 | sdk/lib/_internal/js_runtime/lib/js_number.dart:209-222 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/wasm_builder/lib/src/builder/instructions.dart:2119 — pkg/wasm_builder/lib/src/builder/instructions.dart:2119-2132 | pkg/wasm_builder/lib/src/builder/instructions.dart:2134-2147 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1110 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1110-1124 | pkg/compiler/lib/src/kernel/element_map_impl.dart:789-802 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/front_end/testcases/general/pure_index_expressions.dart:77 — pkg/front_end/testcases/general/pure_index_expressions.dart:77-90 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:88-102 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:82 — pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:82-95 | pkg/analyzer/lib/src/dart/analysis/referenced_names.dart:112-128 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:645 — pkg/compiler/lib/src/js_model/element_map_impl.dart:645-659 | pkg/compiler/lib/src/kernel/element_map_impl.dart:319-332 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/front_end/testcases/general/pure_index_expressions.dart:181 — pkg/front_end/testcases/general/pure_index_expressions.dart:181-194 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:198-212 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/kernel/kernel_impact.dart:905 — pkg/compiler/lib/src/kernel/kernel_impact.dart:905-918 | pkg/compiler/lib/src/kernel/kernel_impact.dart:920-933 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/kernel/lib/src/bounds_checks.dart:123 — pkg/kernel/lib/src/bounds_checks.dart:123-136 | pkg/kernel/lib/type_algebra.dart:708-723 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/dart_runtime_service_dds/lib/src/bazel_uri_converter.dart:155 — pkg/dart_runtime_service_dds/lib/src/bazel_uri_converter.dart:155-168 | pkg/dds/lib/src/bazel_uri_converter.dart:137-150 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/observatory/lib/src/elements/instance_ref.dart:97 — pkg/observatory/lib/src/elements/instance_ref.dart:97-110 | pkg/observatory/lib/src/elements/strongly_reachable_instances.dart:111-128 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/ordered_typeset.dart:146 — pkg/compiler/lib/src/ordered_typeset.dart:146-159 | pkg/compiler/lib/src/ordered_typeset.dart:161-178 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1630 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1630-1643 | pkg/js_ast/lib/src/builder.dart:1426-1439 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:247 — pkg/dev_compiler/lib/src/js_ast/template.dart:247-260 | pkg/js_ast/lib/src/template.dart:766-779 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:486 — pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:486-499 | pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:536-549 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/compiler/lib/src/js_model/js_world.dart:781 — pkg/compiler/lib/src/js_model/js_world.dart:781-794 | pkg/compiler/lib/src/js_model/js_world.dart:796-809 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/kernel/lib/src/ast/statements.dart:1250 — pkg/kernel/lib/src/ast/statements.dart:1250-1263 | pkg/kernel/lib/src/ast/statements.dart:1265-1278 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/linter/lib/src/rules/avoid_redundant_argument_values.dart:29 — pkg/linter/lib/src/rules/avoid_redundant_argument_values.dart:29-42 | pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:291-304 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/analyzer/lib/src/summary2/informative_data.dart:372 — pkg/analyzer/lib/src/summary2/informative_data.dart:372-390 | pkg/analyzer/lib/src/summary2/informative_data.dart:508-521 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 55 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×74
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/wasm/standalone/embedder_string.dart:74 — sdk/lib/_internal/wasm/standalone/embedder_string.dart:74-80 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:82-94 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/native_stack_traces/lib/src/macho.dart:411 — pkg/native_stack_traces/lib/src/macho.dart:411-420 | pkg/native_stack_traces/lib/src/macho.dart:466-472 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/tools/compiler_layering_check.py:98 — runtime/tools/compiler_layering_check.py:98-104 | runtime/tools/embedder_layering_check.py:59-68 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:228 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:228-235 | sdk/lib/_internal/js_runtime/lib/js_array.dart:327-333 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/observatory/lib/src/elements/cpu_profile_table.dart:334 — pkg/observatory/lib/src/elements/cpu_profile_table.dart:334-340 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:382-388 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:1988 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:1988-1994 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2183-2189 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:1995 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:1995-2001 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2191-2197 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/compiler/lib/src/ssa/tracer.dart:377 — pkg/compiler/lib/src/ssa/tracer.dart:377-383 | pkg/compiler/lib/src/ssa/tracer.dart:521-527 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:604 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:604-610 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2092-2101 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:2280 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:2280-2287 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:485-491 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/js_ast/lib/src/equivalence_visitor.dart:295 — pkg/js_ast/lib/src/equivalence_visitor.dart:295-301 | pkg/js_ast/lib/src/equivalence_visitor.dart:303-309 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_runtime/lib/core_patch.dart:214 — sdk/lib/_internal/js_runtime/lib/core_patch.dart:214-222 | sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:203-209 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:681 — pkg/dev_compiler/lib/src/js_ast/template.dart:681-687 | pkg/js_ast/lib/src/template.dart:677-683 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:248 — sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:248-255 | sdk/lib/_internal/js_runtime/lib/math_patch.dart:243-249 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/collection/list.dart:451 — sdk/lib/collection/list.dart:451-457 | sdk/lib/collection/list.dart:459-465 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/analyzer/lib/src/fine/manifest_type.dart:268 — pkg/analyzer/lib/src/fine/manifest_type.dart:268-274 | pkg/analyzer/lib/src/fine/manifest_type.dart:460-466 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:553 — pkg/dev_compiler/lib/src/js_ast/template.dart:553-559 | pkg/dev_compiler/lib/src/js_ast/template.dart:573-580 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/io/file_impl.dart:359 — sdk/lib/io/file_impl.dart:359-365 | sdk/lib/io/link.dart:311-317 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:266 — sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:266-272 | sdk/lib/_internal/js_runtime/lib/js_patch.dart:378-384 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:430 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:430-436 | sdk/lib/_internal/js_runtime/lib/js_string.dart:407-413 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/async/zone_delegate.dart:65 — sdk/lib/async/zone_delegate.dart:65-73 | sdk/lib/async/zone_delegate.dart:92-98 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:391 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:391-397 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:457-463 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/compiler/lib/src/kernel/dart2js_target.dart:144 — pkg/compiler/lib/src/kernel/dart2js_target.dart:144-150 | pkg/dev_compiler/lib/src/kernel/target.dart:166-172 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:127 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:127-133 | sdk/lib/_internal/js_runtime/lib/js_array.dart:208-214 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:848 — pkg/compiler/lib/src/js_model/element_map_impl.dart:848-855 | pkg/compiler/lib/src/kernel/element_map_impl.dart:547-553 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 49 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×73
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:55 — sdk/lib/_internal/wasm/common/simd.dart:55-62 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1697-1706 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:159 — sdk/lib/_internal/wasm/common/simd.dart:159-166 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2610-2619 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/native_compiler/lib/snapshot/snapshot.dart:2105 — pkg/native_compiler/lib/snapshot/snapshot.dart:2105-2112 | pkg/native_compiler/lib/snapshot/snapshot.dart:2113-2120 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:3411 — sdk/lib/_internal/js_shared/lib/rti.dart:3411-3418 | sdk/lib/_internal/js_shared/lib/rti.dart:3420-3428 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:416 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:416-423 | sdk/lib/_internal/js_runtime/lib/js_array.dart:520-529 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_runtime/lib/constant_map.dart:86 — sdk/lib/_internal/js_runtime/lib/constant_map.dart:86-93 | sdk/lib/collection/maps.dart:79-86 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:362 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:362-369 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:906-913 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/js_ast/lib/src/equivalence_visitor.dart:226 — pkg/js_ast/lib/src/equivalence_visitor.dart:226-233 | pkg/js_ast/lib/src/equivalence_visitor.dart:235-242 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:277 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:277-291 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/map.dart:125-132 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:55 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:55-62 | pkg/dds/lib/src/devtools/client.dart:66-76 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:1177 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1177-1184 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1196-1203 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/dds/lib/dds_launcher.dart:257 — pkg/dds/lib/dds_launcher.dart:257-264 | pkg/dds/lib/dds_launcher.dart:266-276 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:251 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:251-258 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:265-274 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/js_ast/lib/src/equivalence_visitor.dart:311 — pkg/js_ast/lib/src/equivalence_visitor.dart:311-318 | pkg/js_ast/lib/src/equivalence_visitor.dart:353-360 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/js_ast/lib/src/equivalence_visitor.dart:336 — pkg/js_ast/lib/src/equivalence_visitor.dart:336-343 | pkg/js_ast/lib/src/equivalence_visitor.dart:510-517 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/convert/base64.dart:486 — sdk/lib/convert/base64.dart:486-495 | sdk/lib/convert/base64.dart:505-512 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart:63 — sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart:63-70 | sdk/lib/_internal/js_dev_runtime/private/identity_hash_set.dart:39-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart:284 — pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart:284-294 | pkg/_fe_analyzer_shared/lib/src/metadata/proto.dart:358-365 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:2186 — sdk/lib/_internal/js_shared/lib/rti.dart:2186-2193 | sdk/lib/_internal/js_shared/lib/rti.dart:3982-3990 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:668 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:668-676 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1148-1155 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:544 — pkg/dev_compiler/lib/src/js_ast/template.dart:544-551 | pkg/js_ast/lib/src/template.dart:534-541 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:2417 — sdk/lib/_internal/wasm/common/typed_data.dart:2417-2424 | sdk/lib/_internal/wasm/common/typed_data.dart:2438-2450 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/analysis_server/lib/src/lsp/lsp_packet_transformer.dart:119 — pkg/analysis_server/lib/src/lsp/lsp_packet_transformer.dart:119-126 | pkg/dap_adapters/lib/src/protocol_stream_transformers.dart:97-104 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/observatory/lib/src/repositories/instance.dart:8 — pkg/observatory/lib/src/repositories/instance.dart:8-15 | pkg/observatory/lib/src/repositories/object.dart:9-16 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) sdk/lib/_internal/js_runtime/lib/js_array.dart:177 — sdk/lib/_internal/js_runtime/lib/js_array.dart:177-184 | sdk/lib/_internal/js_runtime/lib/js_array.dart:186-193 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 48 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×70
  • Edited copy of a member (19 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:1393 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1393-1411 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1427-1450 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:390 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:390-408 | sdk/lib/_internal/js_runtime/lib/js_string.dart:365-383 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/remove_comment.dart:26 — pkg/analysis_server/lib/src/services/correction/dart/remove_comment.dart:26-51 | pkg/analysis_server/lib/src/services/correction/dart/remove_print.dart:30-48 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analyzer/lib/src/fine/library_manifest_ids.dart:45 — pkg/analyzer/lib/src/fine/library_manifest_ids.dart:45-65 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:200-218 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:190 — pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:190-208 | pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:210-228 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1035 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1035-1053 | sdk/lib/_internal/wasm/common/compact_hash.dart:955-973 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:410 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:410-428 | sdk/lib/_internal/js_runtime/lib/js_string.dart:385-405 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:2975 — pkg/compiler/lib/src/js/rewrite_async.dart:2975-2993 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3112-3130 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:774 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:774-792 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:794-815 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:133 — pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:133-151 | pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:153-175 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:438 — pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:438-457 | pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:470-488 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart:30 — pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_iterable.dart:30-48 | pkg/analysis_server/lib/src/services/correction/dart/replace_return_type_stream.dart:30-48 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1276 — pkg/analysis_server/tool/code_completion/completion_metrics.dart:1276-1294 | pkg/analysis_server/tool/code_completion/completion_metrics.dart:1475-1495 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/io/file.dart:1122 — sdk/lib/io/file.dart:1122-1142 | sdk/lib/io/socket.dart:1431-1449 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:135 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:135-156 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/map.dart:19-37 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/compiler/lib/src/dump_info.dart:775 — pkg/compiler/lib/src/dump_info.dart:775-793 | pkg/compiler/lib/src/dump_info.dart:1562-1581 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:4340 — pkg/front_end/lib/src/kernel/body_builder.dart:4340-4358 | pkg/front_end/lib/src/kernel/body_builder.dart:4360-4380 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/_internal/wasm/common/hash_factories.dart:22 — sdk/lib/_internal/wasm/common/hash_factories.dart:22-40 | sdk/lib/_internal/wasm/common/hash_factories.dart:51-69 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/compiler/lib/src/ir/scope_visitor.dart:924 — pkg/compiler/lib/src/ir/scope_visitor.dart:924-942 | pkg/compiler/lib/src/ir/scope_visitor.dart:944-967 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analyzer/lib/src/summary2/bundle_reader.dart:706 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:706-726 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1322-1340 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/front_end/lib/src/builder/function_type_builder.dart:270 — pkg/front_end/lib/src/builder/function_type_builder.dart:270-294 | pkg/front_end/lib/src/builder/record_type_builder.dart:365-383 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analyzer/lib/src/summary2/bundle_reader.dart:681 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:681-704 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1302-1320 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:4004 — pkg/front_end/lib/src/kernel/internal_ast.dart:4004-4022 | pkg/front_end/lib/src/kernel/internal_ast.dart:4306-4330 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:227 — sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:227-246 | sdk/lib/_internal/js_runtime/lib/math_patch.dart:223-241 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart_snippet_request.dart:54 — pkg/analysis_server/lib/src/services/snippets/dart_snippet_request.dart:54-72 | pkg/analysis_server/lib/src/services/snippets/dart_snippet_request.dart:74-93 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 45 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×67
  • Edited copy of a member (17 corresponding lines) sdk/lib/_internal/vm/lib/string_patch.dart:1135 — sdk/lib/_internal/vm/lib/string_patch.dart:1135-1151 | sdk/lib/_internal/vm/lib/string_patch.dart:1389-1405 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/convert/ascii.dart:281 — sdk/lib/convert/ascii.dart:281-297 | sdk/lib/convert/latin1.dart:188-205 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:218 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:218-234 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:555-574 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:351 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:351-368 | sdk/lib/_internal/js_runtime/lib/js_string.dart:331-347 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:247 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:247-264 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:808-824 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/compiler/lib/src/universe/codegen_world_builder.dart:241 — pkg/compiler/lib/src/universe/codegen_world_builder.dart:241-257 | pkg/compiler/lib/src/universe/resolution_world_builder.dart:413-429 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:340 — pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:340-360 | pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:362-378 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analysis_server/lib/src/status/pages.dart:264 — pkg/analysis_server/lib/src/status/pages.dart:264-284 | pkg/analysis_server/lib/src/status/pages.dart:286-302 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/front_end/lib/src/source/source_compilation_unit.dart:304 — pkg/front_end/lib/src/source/source_compilation_unit.dart:304-320 | pkg/front_end/lib/src/source/source_library_builder.dart:293-309 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analyzer/lib/src/fine/manifest_item.dart:307 — pkg/analyzer/lib/src/fine/manifest_item.dart:307-324 | pkg/analyzer/lib/src/fine/manifest_item.dart:1605-1621 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:3650 — pkg/front_end/lib/src/kernel/internal_ast.dart:3650-3666 | pkg/front_end/lib/src/kernel/internal_ast.dart:3740-3757 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/front_end/lib/src/source/source_property_builder.dart:292 — pkg/front_end/lib/src/source/source_property_builder.dart:292-316 | pkg/front_end/lib/src/source/source_property_builder.dart:365-381 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/observatory/lib/src/elements/allocation_profile.dart:64 — pkg/observatory/lib/src/elements/allocation_profile.dart:64-80 | pkg/observatory/lib/src/elements/persistent_handles.dart:50-71 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/cfg/lib/passes/constant_propagation.dart:569 — pkg/cfg/lib/passes/constant_propagation.dart:569-585 | pkg/cfg/lib/passes/constant_propagation.dart:600-616 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:956 — pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:956-973 | pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:975-991 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:488 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:488-504 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1009-1025 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/linter/lib/src/rules/discarded_futures.dart:28 — pkg/linter/lib/src/rules/discarded_futures.dart:28-45 | pkg/linter/lib/src/rules/unawaited_futures.dart:29-45 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:654 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:654-674 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1497-1513 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:37874 — pkg/analyzer/lib/src/dart/ast/ast.dart:37874-37890 | pkg/analyzer/lib/src/dart/ast/ast.dart:60107-60123 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:12164 — pkg/analyzer/lib/src/dart/ast/ast.dart:12164-12181 | pkg/analyzer/lib/src/dart/ast/ast.dart:40333-40349 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/vm_service/lib/src/_stream_helpers.dart:192 — pkg/vm_service/lib/src/_stream_helpers.dart:192-208 | pkg/vm_service/lib/src/_stream_helpers.dart:210-227 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) sdk/lib/io/file_impl.dart:301 — sdk/lib/io/file_impl.dart:301-317 | sdk/lib/io/link.dart:249-269 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:472 — pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:472-488 | pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:490-506 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:736 — pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:736-752 | pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:824-840 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:60348 — pkg/analyzer/lib/src/dart/ast/ast.dart:60348-60365 | pkg/analyzer/lib/src/dart/ast/ast.dart:60367-60383 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 42 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×67
  • Edited copy of a member (6 corresponding lines) sdk/lib/core/uri.dart:2378 — sdk/lib/core/uri.dart:2378-2383 | sdk/lib/core/uri.dart:4715-4722 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/observatory/lib/src/elements/debugger.dart:822 — pkg/observatory/lib/src/elements/debugger.dart:822-828 | pkg/observatory/lib/src/elements/debugger.dart:915-920 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:3380 — sdk/lib/_internal/js_shared/lib/rti.dart:3380-3385 | sdk/lib/_internal/js_shared/lib/rti.dart:3387-3392 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:68 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:68-73 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:83-88 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:83 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:83-88 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:98-103 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:90 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:90-95 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:105-110 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:628 — sdk/lib/_internal/wasm/common/simd.dart:628-633 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2227-2232 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:635 — sdk/lib/_internal/wasm/common/simd.dart:635-640 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2234-2239 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2199 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2199-2204 | sdk/lib/_internal/wasm/common/simd.dart:592-599 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2206 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2206-2211 | sdk/lib/_internal/wasm/common/simd.dart:601-608 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2213 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2213-2218 | sdk/lib/_internal/wasm/common/simd.dart:610-617 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2220 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2220-2225 | sdk/lib/_internal/wasm/common/simd.dart:619-626 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2703 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2703-2710 | sdk/lib/_internal/wasm/common/simd.dart:263-268 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:364 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:364-369 | sdk/lib/_internal/js_runtime/lib/js_array.dart:473-478 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/compiler/lib/src/inferrer/builder.dart:3143 — pkg/compiler/lib/src/inferrer/builder.dart:3143-3148 | pkg/compiler/lib/src/inferrer/locals_handler.dart:646-651 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:545 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:545-550 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:927-932 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:503 — pkg/dev_compiler/lib/src/js_ast/template.dart:503-508 | pkg/js_ast/lib/src/template.dart:494-499 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:510 — pkg/dev_compiler/lib/src/js_ast/template.dart:510-515 | pkg/js_ast/lib/src/template.dart:501-506 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:3284 — pkg/compiler/lib/src/js/rewrite_async.dart:3284-3289 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3363-3368 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/compiler/lib/src/common/codegen.dart:2239 — pkg/compiler/lib/src/common/codegen.dart:2239-2244 | pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:176-181 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:689 — pkg/dev_compiler/lib/src/js_ast/template.dart:689-694 | pkg/js_ast/lib/src/template.dart:685-690 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:696 — pkg/dev_compiler/lib/src/js_ast/template.dart:696-701 | pkg/js_ast/lib/src/template.dart:692-697 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:5550 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5550-5555 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6160-6165 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) pkg/dart_runtime_service_dds/lib/src/dds_backend.dart:385 — pkg/dart_runtime_service_dds/lib/src/dds_backend.dart:385-390 | pkg/dartpad_worker/lib/src/tools/vm_service/vm_service.dart:128-135 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) sdk/lib/async/stream_controller.dart:849 — sdk/lib/async/stream_controller.dart:849-854 | sdk/lib/async/stream_pipe.dart:99-112 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 42 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×62
  • Edited copy of a member (16 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2276 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2276-2291 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2293-2312 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/native_stack_traces/lib/src/macho.dart:244 — pkg/native_stack_traces/lib/src/macho.dart:244-261 | pkg/native_stack_traces/lib/src/macho.dart:308-323 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/wasm_builder/lib/src/builder/instructions.dart:2149 — pkg/wasm_builder/lib/src/builder/instructions.dart:2149-2164 | pkg/wasm_builder/lib/src/builder/instructions.dart:2166-2181 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:326 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:326-341 | sdk/lib/_internal/js_runtime/lib/js_array.dart:434-450 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:298 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:298-313 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:315-330 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:11936 — pkg/analyzer/lib/src/dart/ast/ast.dart:11936-11951 | pkg/analyzer/lib/src/dart/ast/ast.dart:12271-12287 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5730 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:5730-5745 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:5747-5767 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/front_end/lib/src/kernel/invalid_type.dart:84 — pkg/front_end/lib/src/kernel/invalid_type.dart:84-99 | pkg/kernel/lib/src/bounds_checks.dart:1117-1135 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1698 — pkg/compiler/lib/src/js/rewrite_async.dart:1698-1713 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1748-1763 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/observatory/lib/src/sample_profile/sample_profile.dart:137 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:137-152 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:451-469 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/tools/dartfuzz/dartfuzz.dart:659 — runtime/tools/dartfuzz/dartfuzz.dart:659-676 | runtime/tools/dartfuzz/dartfuzz.dart:1637-1652 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/kernel/lib/verifier.dart:692 — pkg/kernel/lib/verifier.dart:692-707 | pkg/kernel/lib/verifier.dart:1041-1059 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:1668 — pkg/kernel/lib/binary/ast_to_binary.dart:1668-1683 | pkg/kernel/lib/binary/ast_to_binary.dart:1685-1700 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/compiler/lib/src/js_backend/namer.dart:1367 — pkg/compiler/lib/src/js_backend/namer.dart:1367-1382 | pkg/compiler/lib/src/js_backend/namer.dart:1408-1424 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:661 — pkg/compiler/lib/src/js_model/element_map_impl.dart:661-677 | pkg/compiler/lib/src/kernel/element_map_impl.dart:334-349 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analysis_server/lib/src/computer/computer_outline.dart:128 — pkg/analysis_server/lib/src/computer/computer_outline.dart:128-143 | pkg/analysis_server/lib/src/computer/computer_outline.dart:145-160 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:10280 — pkg/analyzer/lib/src/dart/ast/ast.dart:10280-10295 | pkg/analyzer/lib/src/dart/ast/ast.dart:10297-10312 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/front_end/lib/src/util/outline_extractor.dart:764 — pkg/front_end/lib/src/util/outline_extractor.dart:764-780 | pkg/front_end/lib/src/util/outline_extractor.dart:1000-1015 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/dwds/lib/src/loaders/build_runner_strategy_provider.dart:217 — pkg/dwds/lib/src/loaders/build_runner_strategy_provider.dart:217-238 | pkg/dwds/lib/src/loaders/frontend_server_strategy_provider.dart:89-104 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart:255 — pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart:255-270 | pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart:284-299 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/front_end/lib/src/dill/dill_class_builder.dart:372 — pkg/front_end/lib/src/dill/dill_class_builder.dart:372-388 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:440-455 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:10348 — pkg/analyzer/lib/src/dart/ast/ast.dart:10348-10363 | pkg/analyzer/lib/src/dart/ast/ast.dart:10365-10380 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22631 — pkg/analyzer/lib/src/dart/ast/ast.dart:22631-22648 | pkg/analyzer/lib/src/dart/ast/ast.dart:59908-59923 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:177 — pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:177-192 | pkg/analysis_server/lib/src/services/correction/dart/move_doc_comment_to_library_directive.dart:48-63 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/analysis_server/tool/code_completion/code_metrics.dart:362 — pkg/analysis_server/tool/code_completion/code_metrics.dart:362-378 | pkg/analysis_server/tool/code_completion/code_metrics.dart:838-853 — 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.
  • + 37 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×58
  • Duplicated block (5 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:93 — pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:93-98 | pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:201-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:723 — pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:723-727 | pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:768-772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:723` 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 (5 lines × 2) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:454 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:454-458 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:465-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:454` it does not close everything it opens, so those exact lines 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) pkg/compiler/lib/src/ir/impact_data.dart:635 — pkg/compiler/lib/src/ir/impact_data.dart:635-639 | pkg/compiler/lib/src/ir/impact_data.dart:741-745 — both copies are in the same file, so extract the 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 `node` to `ir.InstanceInvocation` in one and `ir.InstanceGetterInvocation` 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) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:110 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:110-114 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:116-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) pkg/dartdev/lib/src/utils.dart:387 — pkg/dartdev/lib/src/utils.dart:387-391 | pkg/dartdev/lib/src/utils.dart:399-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dartdev/lib/src/utils.dart:387` it does not close everything it opens, so those exact lines 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) pkg/kernel/lib/src/replacement_visitor.dart:352 — pkg/kernel/lib/src/replacement_visitor.dart:352-356 | pkg/kernel/lib/src/replacement_visitor.dart:386-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/src/replacement_visitor.dart:352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) pkg/observatory/lib/src/elements/debugger.dart:823 — pkg/observatory/lib/src/elements/debugger.dart:823-828 | pkg/observatory/lib/src/elements/debugger.dart:916-920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) pkg/observatory/lib/src/elements/isolate_view.dart:110 — pkg/observatory/lib/src/elements/isolate_view.dart:110-114 | pkg/observatory/lib/src/elements/objectstore_view.dart:78-82 — 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 `pkg/observatory/lib/src/elements/isolate_view.dart: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.
  • Duplicated block (5 lines × 2) pkg/observatory/lib/src/elements/library_view.dart:114 — pkg/observatory/lib/src/elements/library_view.dart:114-118 | pkg/observatory/lib/src/elements/script_view.dart:97-102 — 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 `pkg/observatory/lib/src/elements/library_view.dart: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 (5 lines × 2) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:160 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:160-164 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:734-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_runtime/lib/collection_patch.dart:160` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/vm/lib/string_patch.dart:1264 — sdk/lib/_internal/vm/lib/string_patch.dart:1264-1268 | sdk/lib/_internal/vm/lib/string_patch.dart:1295-1299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/vm/lib/string_patch.dart:1264` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:61 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:61-65 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:86-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/vm_shared/lib/collection_patch.dart:61` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:401 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:401-405 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:413-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/vm_shared/lib/collection_patch.dart:401` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1924 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1924-1928 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1798-1802 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1933` calls `scanUntilLineEnd`, `current` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1804` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2036 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2036-2040 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:197-201 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2629 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2629-2633 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:2139-2143 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) pkg/_fe_analyzer_shared/lib/src/util/link.dart:70 — pkg/_fe_analyzer_shared/lib/src/util/link.dart:70-74 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link.dart:153-157 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link.dart:152` calls `singleWhere`, `f`, `orElse` and `pkg/_fe_analyzer_shared/lib/src/util/link.dart:68` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) pkg/compiler/lib/src/js_backend/enqueuer.dart:312 — pkg/compiler/lib/src/js_backend/enqueuer.dart:312-316 | pkg/compiler/lib/src/resolution/enqueuer.dart:313-317 — `pkg/compiler/lib/src/js_backend/enqueuer.dart` and `pkg/compiler/lib/src/resolution/enqueuer.dart` 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 60 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 2) pkg/compiler/lib/src/source_file_provider.dart:186 — pkg/compiler/lib/src/source_file_provider.dart:186-190 | pkg/compiler/lib/src/util/memory_source_file_helper.dart: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.
  • Duplicated block (5 lines × 2) pkg/dart_runtime_service_vm/lib/src/native_bindings.dart:182 — pkg/dart_runtime_service_vm/lib/src/native_bindings.dart:182-186 | sdk/lib/vmservice/message.dart:150-154 — 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) pkg/dev_compiler/lib/src/js_ast/printer.dart:1786 — pkg/dev_compiler/lib/src/js_ast/printer.dart:1786-1790 | pkg/js_ast/lib/src/printer.dart:1962-1966 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/printer.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 157 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `Node` in one and `DeferredStatement` 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) pkg/dev_compiler/lib/src/js_ast/printer.dart:1896 — pkg/dev_compiler/lib/src/js_ast/printer.dart:1896-1900 | pkg/js_ast/lib/src/printer.dart:2076-2080 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/printer.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 157 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:1164 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1164-1168 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1457-1461 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2435 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2435-2439 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2741-2745 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:2435` it does not close everything it opens, so those 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.
  • + 33 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×57
  • Duplicated block (15 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531-1545 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1686-1700 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531` it does not close everything it opens, so those 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 before the matched lines, `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1681` calls `tokenizeMultiply` and `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1528` 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 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608-1622 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1225-1239 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608` it does not close everything it opens, so those exact lines 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1810 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1810-1824 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1899-1913 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 × 2) pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:190 — pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart:190-204 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart:63-77 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/util/link_implementation.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link_implementation.dart` as WHOLE FILES: this scan already matched 13 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 (15 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:83 — pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:83-97 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:103-117 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1192 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1192-1207 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:1520-1534 — before extracting anything, compare `pkg/analysis_server/tool/code_completion/relevance_metrics.dart` and `pkg/analysis_server/tool/code_completion/relevance_table_generator.dart` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 312 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 `pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1192` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2554 — pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2554-2568 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2630-2644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2554` it does not close everything it opens, so those exact lines 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) pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:156 — pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:156-170 | pkg/analyzer_plugin/lib/protocol/protocol.dart:186-200 — before extracting anything, compare `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart` and `pkg/analyzer_plugin/lib/protocol/protocol.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:156` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/analysis_options/analysis_options.dart:320 — pkg/analyzer/lib/src/analysis_options/analysis_options.dart:320-334 | pkg/analyzer/lib/src/analysis_options/analysis_options.dart:351-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/analysis_options/analysis_options.dart:320` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/analysis_options/analysis_options.dart:336` calls `addString` and `pkg/analyzer/lib/src/analysis_options/analysis_options.dart:366` 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 lines × 2) pkg/analyzer/lib/src/dart/analysis/index.dart:746 — pkg/analyzer/lib/src/dart/analysis/index.dart:746-760 | pkg/analyzer/lib/src/dart/analysis/index.dart:1023-1037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `node` to `CompoundAssignment` in one and `IfNullAssignment` 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) pkg/analyzer/lib/src/dart/ast/ast.dart:5579 — pkg/analyzer/lib/src/dart/ast/ast.dart:5579-5593 | pkg/analyzer/lib/src/dart/ast/ast.dart:50360-50374 — both copies are in the same file, so extract the 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 `receiver` to `InstanceReceiverImpl` in one and `NamedReceiverImpl` 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) pkg/analyzer/lib/src/dart/ast/ast.dart:17812 — pkg/analyzer/lib/src/dart/ast/ast.dart:17812-17826 | pkg/analyzer/lib/src/dart/ast/ast.dart:17831-17845 — both copies are in the same file, so extract the 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 (15 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:18930 — pkg/analyzer/lib/src/dart/ast/ast.dart:18930-18944 | pkg/analyzer/lib/src/dart/ast/ast.dart:32063-32077 — both copies are in the same file, so extract the 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 × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:21094 — pkg/analyzer/lib/src/dart/ast/ast.dart:21094-21108 | pkg/analyzer/lib/src/dart/ast/ast.dart:21258-21272 — both copies are in the same file, so extract the 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 (15 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:21603 — pkg/analyzer/lib/src/dart/ast/ast.dart:21603-21617 | pkg/analyzer/lib/src/dart/ast/ast.dart:21778-21792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:21603` 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 (15 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:49257 — pkg/analyzer/lib/src/dart/ast/ast.dart:49257-49271 | pkg/analyzer/lib/src/dart/ast/ast.dart:49276-49290 — both copies are in the same file, so extract the 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 (15 lines × 2) pkg/analyzer/lib/src/fine/manifest_context.dart:65 — pkg/analyzer/lib/src/fine/manifest_context.dart:65-79 | pkg/analyzer/lib/src/fine/manifest_context.dart:356-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:2558 — pkg/compiler/lib/src/js_model/element_map_impl.dart:2558-2572 | pkg/compiler/lib/src/kernel/element_map_impl.dart:2030-2044 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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. 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) pkg/compiler/lib/src/js_model/element_map_impl.dart:2676 — pkg/compiler/lib/src/js_model/element_map_impl.dart:2676-2690 | pkg/compiler/lib/src/kernel/element_map_impl.dart:2127-2141 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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. 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) pkg/compiler/lib/src/js_model/elements.dart:783 — pkg/compiler/lib/src/js_model/elements.dart:783-797 | pkg/compiler/lib/src/js_model/elements.dart:859-873 — both copies are in the same file, so extract the 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 × 2) pkg/dart2js_info/lib/src/binary/sink.dart:335 — pkg/dart2js_info/lib/src/binary/sink.dart:335-349 | pkg/kernel/lib/binary/ast_to_binary.dart:3831-3845 — 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 `pkg/dart2js_info/lib/src/binary/sink.dart:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/kernel/lib/binary/ast_to_binary.dart:3847` calls `pragma` and `pkg/dart2js_info/lib/src/binary/sink.dart:351` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:677 — pkg/dev_compiler/lib/src/js_ast/builder.dart:677-691 | pkg/js_ast/lib/src/builder.dart:555-569 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/builder.dart` and `pkg/js_ast/lib/src/builder.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 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 `pkg/dev_compiler/lib/src/js_ast/builder.dart:677` it does not close everything it opens, so those exact lines 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) pkg/dev_compiler/lib/src/js_ast/printer.dart:590 — pkg/dev_compiler/lib/src/js_ast/printer.dart:590-604 | pkg/js_ast/lib/src/printer.dart:648-662 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/printer.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 157 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 × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5391 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5391-5405 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6001-6015 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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) pkg/front_end/lib/src/dill/dill_extension_builder.dart:182 — pkg/front_end/lib/src/dill/dill_extension_builder.dart:182-196 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:301-315 — before extracting anything, compare `pkg/front_end/lib/src/dill/dill_extension_builder.dart` and `pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 110 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 `pkg/front_end/lib/src/dill/dill_extension_builder.dart:182` 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.
  • + 32 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×53
  • Duplicated block (16 lines × 2) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:207 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:207-222 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/map.dart:52-67 — 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 `pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) pkg/analysis_server/lib/src/analysis_server.dart:1325 — pkg/analysis_server/lib/src/analysis_server.dart:1325-1340 | pkg/analysis_server/lib/src/analysis_server.dart:1359-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/analysis_server.dart:1325` 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 (16 lines × 2) pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:112 — pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:112-127 | pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart:238-253 — before extracting anything, compare `pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart` and `pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:112` 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 (16 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_to_constant_pattern.dart:22 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_constant_pattern.dart:22-37 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_wildcard_pattern.dart:22-37 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/convert_to_constant_pattern.dart` and `pkg/analysis_server/lib/src/services/correction/dart/convert_to_wildcard_pattern.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_to_constant_pattern.dart: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. 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) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:151 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:151-166 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:244-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) pkg/analysis_server/lib/src/services/refactoring/client_side_validators.dart:110 — pkg/analysis_server/lib/src/services/refactoring/client_side_validators.dart:110-125 | pkg/analysis_server/lib/src/services/refactoring/client_side_validators.dart:128-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/refactoring/client_side_validators.dart:110` 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 (16 lines × 2) pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:137 — pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:137-152 | pkg/analyzer_plugin/lib/protocol/protocol.dart:167-182 — before extracting anything, compare `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart` and `pkg/analyzer_plugin/lib/protocol/protocol.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:137` it does not close everything it opens, so those exact lines 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) pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:270 — pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:270-285 | pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:300-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:270` 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 (16 lines × 2) pkg/analyzer/lib/src/dart/analysis/results.dart:337 — pkg/analyzer/lib/src/dart/analysis/results.dart:337-352 | pkg/analyzer/lib/src/dart/analysis/results.dart:492-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/analysis/results.dart:337` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/ast/ast.dart:5674 — pkg/analyzer/lib/src/dart/ast/ast.dart:5674-5689 | pkg/analyzer/lib/src/dart/ast/ast.dart:50455-50470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:27814 — pkg/analyzer/lib/src/dart/ast/ast.dart:27814-27829 | pkg/analyzer/lib/src/dart/ast/ast.dart:28589-28604 — both copies are in the same file, so extract the 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) pkg/analyzer/lib/src/dart/ast/ast.dart:29389 — pkg/analyzer/lib/src/dart/ast/ast.dart:29389-29404 | pkg/analyzer/lib/src/dart/ast/ast.dart:58980-58995 — both copies are in the same file, so extract the 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) pkg/analyzer/lib/src/dart/constant/value.dart:2651 — pkg/analyzer/lib/src/dart/constant/value.dart:2651-2666 | pkg/analyzer/lib/src/dart/constant/value.dart:3051-3066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) pkg/analyzer/lib/src/error/inheritance_override.dart:60 — pkg/analyzer/lib/src/error/inheritance_override.dart:60-75 | pkg/analyzer/lib/src/error/inheritance_override.dart:104-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/inheritance_override.dart:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:532 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:532-547 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1773-1788 — both copies are in the same file, so extract the 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) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:549 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:549-564 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1791-1806 — both copies are in the same file, so extract the 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) pkg/analyzer/lib/src/summary2/library_builder.dart:508 — pkg/analyzer/lib/src/summary2/library_builder.dart:508-523 | pkg/analyzer/lib/src/summary2/library_builder.dart:527-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/library_builder.dart:508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) pkg/analyzer/tool/generators/ast_generator.dart:555 — pkg/analyzer/tool/generators/ast_generator.dart:555-570 | pkg/analyzer/tool/generators/ast_generator.dart:599-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/generators/ast_generator.dart:555` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) pkg/analyzer_cli/lib/src/error_formatter.dart:501 — pkg/analyzer_cli/lib/src/error_formatter.dart:501-516 | pkg/dartdev/lib/src/commands/analyze.dart:676-691 — 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 (16 lines × 2) pkg/compiler/lib/src/js/size_estimator.dart:264 — pkg/compiler/lib/src/js/size_estimator.dart:264-279 | pkg/js_ast/lib/src/printer.dart:523-538 — before extracting anything, compare `pkg/compiler/lib/src/js/size_estimator.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 154 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 `pkg/compiler/lib/src/js/size_estimator.dart: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.
  • Duplicated block (16 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:704 — pkg/dev_compiler/lib/src/js_ast/builder.dart:704-719 | pkg/js_ast/lib/src/builder.dart:622-637 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/builder.dart` and `pkg/js_ast/lib/src/builder.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 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 (16 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5886 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5886-5901 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6539-6554 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (16 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7999 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7999-8014 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8865-8880 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (16 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8375 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8375-8390 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9244-9259 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (16 lines × 2) pkg/front_end/lib/src/base/incremental_compiler_utils.dart:20 — pkg/front_end/lib/src/base/incremental_compiler_utils.dart:20-35 | pkg/front_end/lib/src/base/incremental_compiler_utils.dart:49-64 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/base/incremental_compiler_utils.dart:20` 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.
  • + 28 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×52
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:250 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:250-267 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:269-287 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1446 — pkg/compiler/lib/src/js/rewrite_async.dart:1446-1463 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1487-1506 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/dart_runtime_service_vm/lib/src/native_bindings.dart:188 — pkg/dart_runtime_service_vm/lib/src/native_bindings.dart:188-217 | sdk/lib/vmservice/message.dart:156-173 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/compiler/lib/src/constants/values.dart:957 — pkg/compiler/lib/src/constants/values.dart:957-974 | pkg/compiler/lib/src/constants/values.dart:976-993 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:243 — pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:243-260 | pkg/analyzer/lib/src/dart/analysis/search.dart:1325-1342 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/compiler/lib/src/universe/codegen_world_builder.dart:342 — pkg/compiler/lib/src/universe/codegen_world_builder.dart:342-359 | pkg/compiler/lib/src/universe/resolution_world_builder.dart:541-560 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1278 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1278-1297 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1947-1964 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/front_end/tool/generate_ast_coverage.dart:46 — pkg/front_end/tool/generate_ast_coverage.dart:46-63 | pkg/front_end/tool/generate_ast_coverage.dart:65-89 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_redeclare.dart:24 — pkg/analysis_server/lib/src/services/correction/dart/add_redeclare.dart:24-41 | pkg/analysis_server/lib/src/services/correction/dart/add_reopen.dart:26-43 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/front_end/lib/src/fragment/method/encoding.dart:694 — pkg/front_end/lib/src/fragment/method/encoding.dart:694-711 | pkg/front_end/lib/src/fragment/setter/encoding.dart:764-781 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) sdk/lib/_internal/js_runtime/lib/js_number.dart:113 — sdk/lib/_internal/js_runtime/lib/js_number.dart:113-130 | sdk/lib/_internal/js_runtime/lib/js_number.dart:132-149 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:1271 — pkg/analyzer/lib/src/fine/library_manifest.dart:1271-1290 | pkg/analyzer/lib/src/fine/library_manifest.dart:1292-1309 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/dart_runtime_service_dds/lib/devtools_server.dart:850 — pkg/dart_runtime_service_dds/lib/devtools_server.dart:850-870 | pkg/dds/lib/devtools_server.dart:824-841 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:46822 — pkg/analyzer/lib/src/dart/ast/ast.dart:46822-46840 | pkg/analyzer/lib/src/dart/ast/ast.dart:46842-46859 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) sdk/lib/collection/queue.dart:348 — sdk/lib/collection/queue.dart:348-365 | sdk/lib/collection/queue.dart:367-384 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:2029 — pkg/compiler/lib/src/js/rewrite_async.dart:2029-2046 | pkg/compiler/lib/src/js/rewrite_async.dart:2736-2754 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/kernel/lib/library_index.dart:344 — pkg/kernel/lib/library_index.dart:344-361 | pkg/kernel/lib/library_index.dart:374-394 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:17808 — pkg/analyzer/lib/src/dart/ast/ast.dart:17808-17826 | pkg/analyzer/lib/src/dart/ast/ast.dart:17828-17845 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:28676 — pkg/analyzer/lib/src/dart/ast/ast.dart:28676-28694 | pkg/analyzer/lib/src/dart/ast/ast.dart:28696-28713 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:49253 — pkg/analyzer/lib/src/dart/ast/ast.dart:49253-49271 | pkg/analyzer/lib/src/dart/ast/ast.dart:49273-49290 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/compiler/lib/src/ssa/codegen.dart:3927 — pkg/compiler/lib/src/ssa/codegen.dart:3927-3945 | pkg/compiler/lib/src/ssa/codegen.dart:4013-4030 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1313 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1313-1330 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:243-260 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1241 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1241-1258 | pkg/js_ast/lib/src/builder.dart:1087-1104 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/front_end/lib/src/type_inference/type_inference_engine.dart:847 — pkg/front_end/lib/src/type_inference/type_inference_engine.dart:847-864 | pkg/front_end/lib/src/type_inference/type_inference_engine.dart:890-907 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:271 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:271-288 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:599-616 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 27 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×47
  • Duplicated block (17 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5946 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5946-5962 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5977-5993 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8064 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8064-8080 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8087-8103 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:108 — pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:108-124 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:132-148 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:16057 — pkg/analyzer/lib/src/dart/ast/ast.dart:16057-16073 | pkg/analyzer/lib/src/dart/ast/ast.dart:34066-34082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:20415 — pkg/analyzer/lib/src/dart/ast/ast.dart:20415-20431 | pkg/analyzer/lib/src/dart/ast/ast.dart:20594-20610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:20415` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:27831 — pkg/analyzer/lib/src/dart/ast/ast.dart:27831-27847 | pkg/analyzer/lib/src/dart/ast/ast.dart:28606-28622 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:29406 — pkg/analyzer/lib/src/dart/ast/ast.dart:29406-29422 | pkg/analyzer/lib/src/dart/ast/ast.dart:58997-59013 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:54280 — pkg/analyzer/lib/src/dart/ast/ast.dart:54280-54296 | pkg/analyzer/lib/src/dart/ast/ast.dart:59303-59319 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:54298 — pkg/analyzer/lib/src/dart/ast/ast.dart:54298-54314 | pkg/analyzer/lib/src/dart/ast/ast.dart:59321-59337 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:54375 — pkg/analyzer/lib/src/dart/ast/ast.dart:54375-54391 | pkg/analyzer/lib/src/dart/ast/ast.dart:59398-59414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:361 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:361-377 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:434-450 — both copies are in the same file, so extract the 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 (17 lines × 2) pkg/analyzer/lib/src/dart/element/subtype.dart:433 — pkg/analyzer/lib/src/dart/element/subtype.dart:433-449 | pkg/analyzer/lib/src/dart/element/subtype.dart:461-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/element/subtype.dart:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) pkg/analyzer/lib/src/fasta/ast_builder.dart:5597 — pkg/analyzer/lib/src/fasta/ast_builder.dart:5597-5613 | pkg/analyzer/lib/src/fasta/ast_builder.dart:5677-5693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fasta/ast_builder.dart:5597` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) pkg/analyzer/lib/src/summary2/element_builder.dart:1713 — pkg/analyzer/lib/src/summary2/element_builder.dart:1713-1729 | pkg/analyzer/lib/src/summary2/element_builder.dart:2147-2163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/element_builder.dart:1713` 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 `node` to `covariant FieldFormalParameterImpl` in one and `covariant SuperFormalParameterImpl` 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 (17 lines × 2) pkg/analyzer/lib/src/summary2/element_builder.dart:2205 — pkg/analyzer/lib/src/summary2/element_builder.dart:2205-2221 | pkg/analyzer/lib/src/summary2/element_builder.dart:2236-2252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/element_builder.dart:2205` it does not close everything it opens, so those 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 `node` to `covariant TopLevelGetterDeclarationImpl` in one and `covariant TopLevelSetterDeclarationImpl` 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 (17 lines × 2) pkg/analyzer/lib/src/summary2/informative_data.dart:284 — pkg/analyzer/lib/src/summary2/informative_data.dart:284-300 | pkg/analyzer/lib/src/summary2/informative_data.dart:478-494 — both copies are in the same file, so extract the 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 `fragment` to `EnumFragmentImpl` in one and `MixinFragmentImpl` 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 (17 lines × 2) pkg/analyzer/lib/src/summary2/variance_builder.dart:154 — pkg/analyzer/lib/src/summary2/variance_builder.dart:154-170 | pkg/analyzer/lib/src/summary2/variance_builder.dart:189-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `FunctionTypeAlias2Impl` in one and `GenericTypeAlias2Impl` 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 (17 lines × 2) pkg/compiler/lib/src/dump_info.dart:1849 — pkg/compiler/lib/src/dump_info.dart:1849-1865 | pkg/compiler/lib/src/dump_info.dart:1935-1951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/dump_info.dart:1849` 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 (17 lines × 2) pkg/compiler/lib/src/js/size_estimator.dart:702 — pkg/compiler/lib/src/js/size_estimator.dart:702-718 | pkg/js_ast/lib/src/printer.dart:1075-1091 — before extracting anything, compare `pkg/compiler/lib/src/js/size_estimator.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 154 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 (17 lines × 2) pkg/compiler/lib/src/serialization/binary_sink.dart:96 — pkg/compiler/lib/src/serialization/binary_sink.dart:96-112 | pkg/dart2js_info/lib/src/binary/sink.dart:279-295 — 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 (17 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:6434 — pkg/compiler/lib/src/ssa/builder.dart:6434-6450 | pkg/compiler/lib/src/ssa/builder.dart:6457-6473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:6434` 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 × 2) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1222 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1222-1238 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1390-1406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1222` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:365 — pkg/dev_compiler/lib/src/js_ast/builder.dart:365-381 | pkg/js_ast/lib/src/strings.dart:122-138 — 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 `pkg/dev_compiler/lib/src/js_ast/builder.dart:365` 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 (17 lines × 2) pkg/dev_compiler/lib/src/js_ast/printer.dart:233 — pkg/dev_compiler/lib/src/js_ast/printer.dart:233-249 | pkg/js_ast/lib/src/printer.dart:306-322 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/printer.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 157 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 `pkg/dev_compiler/lib/src/js_ast/printer.dart:233` 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 × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7527 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7527-7543 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8394-8410 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×46
  • Edited copy of a member (22 corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:1871 — pkg/kernel/lib/src/ast/expressions.dart:1871-1895 | pkg/kernel/lib/src/ast/expressions.dart:5138-5162 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/observatory/lib/src/elements/debugger.dart:220 — pkg/observatory/lib/src/elements/debugger.dart:220-241 | pkg/observatory/lib/src/elements/debugger.dart:296-317 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:478 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:478-499 | sdk/lib/_internal/wasm/common/compact_hash.dart:437-460 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/dart2js_tools/lib/src/trace.dart:84 — pkg/dart2js_tools/lib/src/trace.dart:84-105 | pkg/sourcemap_testing/lib/src/stacktrace_helper.dart:407-428 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/analyzer/lib/src/dart/analysis/unlinked_api_signature.dart:136 — pkg/analyzer/lib/src/dart/analysis/unlinked_api_signature.dart:136-166 | pkg/analyzer/lib/src/dart/analysis/unlinked_api_signature.dart:247-268 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:4091 — pkg/front_end/lib/src/kernel/internal_ast.dart:4091-4116 | pkg/front_end/lib/src/kernel/internal_ast.dart:4184-4205 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:548 — pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:548-569 | pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:581-602 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:867 — pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:867-888 | pkg/linter/lib/src/rules/use_enums.dart:105-126 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:531 — pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:531-554 | pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:633-654 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:2449 — sdk/lib/_internal/js_shared/lib/rti.dart:2449-2472 | sdk/lib/_internal/js_shared/lib/rti.dart:2490-2511 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:571 — sdk/lib/_internal/wasm/js_common/js_string.dart:571-596 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:414-435 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/observatory/lib/src/elements/stack_trace_tree_config.dart:174 — pkg/observatory/lib/src/elements/stack_trace_tree_config.dart:174-195 | pkg/observatory/lib/src/elements/stack_trace_tree_config.dart:205-226 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) sdk/lib/_internal/vm/lib/async_patch.dart:315 — sdk/lib/_internal/vm/lib/async_patch.dart:315-336 | sdk/lib/_internal/vm/lib/async_patch.dart:338-364 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/dart2wasm/lib/static_dispatch_table.dart:44 — pkg/dart2wasm/lib/static_dispatch_table.dart:44-65 | pkg/dart2wasm/lib/table_based_globals.dart:83-107 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/observatory/lib/src/sample_profile/sample_profile.dart:82 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:82-103 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:232-253 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/front_end/lib/src/dill/dill_loader.dart:181 — pkg/front_end/lib/src/dill/dill_loader.dart:181-202 | pkg/front_end/lib/src/source/source_loader.dart:939-961 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/compiler/lib/src/js/js.dart:191 — pkg/compiler/lib/src/js/js.dart:191-214 | pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:879-900 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/compiler/lib/src/js_model/js_to_frontend_map.dart:352 — pkg/compiler/lib/src/js_model/js_to_frontend_map.dart:352-373 | pkg/compiler/lib/src/js_model/js_to_frontend_map.dart:375-400 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/kernel/lib/type_algebra.dart:881 — pkg/kernel/lib/type_algebra.dart:881-902 | pkg/kernel/lib/type_algebra.dart:1439-1460 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:363 — pkg/observatory/lib/src/elements/heap_snapshot.dart:363-387 | pkg/observatory/lib/src/elements/process_snapshot.dart:93-114 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/front_end/tool/coverage_merger.dart:1677 — pkg/front_end/tool/coverage_merger.dart:1677-1699 | pkg/front_end/tool/coverage_merger.dart:1723-1744 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:2779 — pkg/kernel/lib/binary/ast_from_binary.dart:2779-2800 | pkg/kernel/lib/binary/ast_from_binary.dart:2802-2826 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:179 — pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:179-200 | pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:202-238 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11475 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11475-11496 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11498-11519 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart:40 — pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart:40-62 | pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart:64-85 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×46
  • Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:71 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:71-115 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:296-336 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1292-1339 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1567-1613 — 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) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351-2399 | pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2401-2469 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1575-1619 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1621-1679 — 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) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:239 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:239-261 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:278-296 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:313-329 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:465-481 — 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) pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:29 — pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:29-50 | pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart:29-50 | pkg/analysis_server/lib/src/services/refactoring/inline_local_variable.dart:27-45 | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart:27-45 — 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) pkg/analysis_server/lib/src/status/pages/assists_page.dart:27 — pkg/analysis_server/lib/src/status/pages/assists_page.dart:27-66 | pkg/analysis_server/lib/src/status/pages/code_completion_page.dart:28-66 | pkg/analysis_server/lib/src/status/pages/fixes_page.dart:27-66 | pkg/analysis_server/lib/src/status/pages/refactorings_page.dart:28-67 — 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) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:157 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:157-167 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:169-179 | pkg/front_end/tool/fuzz/analyzer_helper.dart:397-407 | pkg/front_end/tool/fuzz/analyzer_helper.dart:409-419 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:6292 — pkg/analyzer/lib/src/dart/ast/ast.dart:6292-6304 | pkg/analyzer/lib/src/dart/ast/ast.dart:15762-15774 | pkg/analyzer/lib/src/dart/ast/ast.dart:16499-16511 | pkg/analyzer/lib/src/dart/ast/ast.dart:61535-61547 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:6360 — pkg/analyzer/lib/src/dart/ast/ast.dart:6360-6372 | pkg/analyzer/lib/src/dart/ast/ast.dart:15837-15849 | pkg/analyzer/lib/src/dart/ast/ast.dart:16570-16582 | pkg/analyzer/lib/src/dart/ast/ast.dart:61610-61622 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:7945 — pkg/analyzer/lib/src/dart/ast/ast.dart:7945-7970 | pkg/analyzer/lib/src/dart/ast/ast.dart:8333-8358 | pkg/analyzer/lib/src/dart/ast/ast.dart:8781-8806 | pkg/analyzer/lib/src/dart/ast/ast.dart:9126-9151 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:8024 — pkg/analyzer/lib/src/dart/ast/ast.dart:8024-8040 | pkg/analyzer/lib/src/dart/ast/ast.dart:8389-8406 | pkg/analyzer/lib/src/dart/ast/ast.dart:8857-8874 | pkg/analyzer/lib/src/dart/ast/ast.dart:9175-9193 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:14124 — pkg/analyzer/lib/src/dart/ast/ast.dart:14124-14138 | pkg/analyzer/lib/src/dart/ast/ast.dart:21091-21108 | pkg/analyzer/lib/src/dart/ast/ast.dart:21254-21272 | pkg/analyzer/lib/src/dart/ast/ast.dart:42474-42489 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:18997 — pkg/analyzer/lib/src/dart/ast/ast.dart:18997-19016 | pkg/analyzer/lib/src/dart/ast/ast.dart:19018-19036 | pkg/analyzer/lib/src/dart/ast/ast.dart:32131-32155 | pkg/analyzer/lib/src/dart/ast/ast.dart:32157-32175 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:22368 — pkg/analyzer/lib/src/dart/ast/ast.dart:22368-22384 | pkg/analyzer/lib/src/dart/ast/ast.dart:24347-24362 | pkg/analyzer/lib/src/dart/ast/ast.dart:52674-52690 | pkg/analyzer/lib/src/dart/ast/ast.dart:56333-56349 — 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) pkg/analyzer/lib/src/dart/ast/ast.dart:36754 — pkg/analyzer/lib/src/dart/ast/ast.dart:36754-36768 | pkg/analyzer/lib/src/dart/ast/ast.dart:37004-37018 | pkg/analyzer/lib/src/dart/ast/ast.dart:39789-39803 | pkg/analyzer/lib/src/dart/ast/ast.dart:54031-54045 — 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) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:350 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:350-370 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:450-469 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:471-489 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:491-509 — 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) pkg/analyzer/lib/src/fine/library_manifest.dart:320 — pkg/analyzer/lib/src/fine/library_manifest.dart:320-346 | pkg/analyzer/lib/src/fine/library_manifest.dart:422-448 | pkg/analyzer/lib/src/fine/library_manifest.dart:505-531 | pkg/analyzer/lib/src/fine/library_manifest.dart:703-729 — 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) pkg/analyzer/lib/src/fine/manifest_item.dart:50 — pkg/analyzer/lib/src/fine/manifest_item.dart:50-77 | pkg/analyzer/lib/src/fine/manifest_item.dart:242-267 | pkg/analyzer/lib/src/fine/manifest_item.dart:431-458 | pkg/analyzer/lib/src/fine/manifest_item.dart:1288-1317 — 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) pkg/compiler/lib/src/js_model/closure.dart:631 — pkg/compiler/lib/src/js_model/closure.dart:631-647 | pkg/compiler/lib/src/js_model/closure.dart:687-704 | pkg/compiler/lib/src/js_model/closure.dart:743-762 | pkg/compiler/lib/src/js_model/closure.dart:842-885 — 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) pkg/compiler/lib/src/js_model/elements.dart:563 — pkg/compiler/lib/src/js_model/elements.dart:563-595 | pkg/compiler/lib/src/js_model/elements.dart:699-728 | pkg/compiler/lib/src/js_model/elements.dart:779-806 | pkg/compiler/lib/src/js_model/elements.dart:855-882 — 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) pkg/compiler/lib/src/js_model/elements.dart:597 — pkg/compiler/lib/src/js_model/elements.dart:597-615 | pkg/compiler/lib/src/js_model/elements.dart:730-747 | pkg/compiler/lib/src/js_model/elements.dart:808-824 | pkg/compiler/lib/src/js_model/elements.dart:884-900 — 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) pkg/front_end/lib/src/fragment/class/declaration.dart:69 — pkg/front_end/lib/src/fragment/class/declaration.dart:69-88 | pkg/front_end/lib/src/fragment/class/declaration.dart:135-154 | pkg/front_end/lib/src/fragment/class/declaration.dart:202-221 | pkg/front_end/lib/src/fragment/class/declaration.dart:323-342 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:330 — pkg/front_end/lib/src/fragment/getter/encoding.dart:330-368 | pkg/front_end/lib/src/fragment/getter/encoding.dart:630-668 | pkg/front_end/lib/src/fragment/setter/encoding.dart:354-373 | pkg/front_end/lib/src/fragment/setter/encoding.dart:681-700 — 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) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1108 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1108-1144 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1146-1178 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1660-1696 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1698-1730 — 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) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5514 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:5514-5584 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5597-5672 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5674-5746 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5748-5893 — 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) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6283 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6283-6347 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6349-6480 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840-7086 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462-8711 — 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.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×44
  • Edited copy of a member (23 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:195 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:195-225 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart:122-144 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:19-41 | pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart:19-41 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/linter/lib/src/rules/public_member_api_docs.dart:31 — pkg/linter/lib/src/rules/public_member_api_docs.dart:31-58 | pkg/linter/lib/src/rules/slash_for_doc_comments.dart:29-51 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/front_end/lib/src/codes/type_labeler.dart:344 — pkg/front_end/lib/src/codes/type_labeler.dart:344-367 | pkg/front_end/lib/src/codes/type_labeler.dart:474-496 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/dwds/lib/src/dwds_vm_client.dart:344 — pkg/dwds/lib/src/dwds_vm_client.dart:344-366 | pkg/dwds/lib/src/dwds_vm_client.dart:685-708 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1095 — pkg/analysis_server/tool/code_completion/completion_metrics.dart:1095-1119 | pkg/analysis_server/tool/code_completion/completion_metrics.dart:1161-1183 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/observatory/lib/src/elements/script_inset.dart:41 — pkg/observatory/lib/src/elements/script_inset.dart:41-67 | pkg/observatory/lib/src/elements/source_inset.dart:33-55 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart:32 — pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart:32-54 | pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware_upwards.dart:32-54 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/front_end/lib/src/source/outline_builder.dart:3849 — pkg/front_end/lib/src/source/outline_builder.dart:3849-3872 | pkg/front_end/lib/src/source/outline_builder.dart:3874-3896 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:162 — pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:162-184 | pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:220-245 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:192 — pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:192-214 | pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:204-232 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:7465 — pkg/analyzer/lib/src/dart/ast/ast.dart:7465-7488 | pkg/analyzer/lib/src/dart/ast/ast.dart:7490-7512 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/front_end/lib/src/util/outline_extractor.dart:822 — pkg/front_end/lib/src/util/outline_extractor.dart:822-844 | pkg/front_end/lib/src/util/outline_extractor.dart:885-916 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1628 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1628-1650 | pkg/analyzer/lib/src/fasta/ast_builder.dart:2366-2395 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:12074 — pkg/analyzer/lib/src/dart/ast/ast.dart:12074-12096 | pkg/analyzer/lib/src/dart/ast/ast.dart:12337-12365 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/kernel/lib/src/ast/functions.dart:550 — pkg/kernel/lib/src/ast/functions.dart:550-572 | pkg/kernel/lib/src/ast/functions.dart:574-599 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:24 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:24-46 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:343-377 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:55 — pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:55-79 | pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:125-147 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:339 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:339-361 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:669-691 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/kernel/lib/verifier.dart:447 — pkg/kernel/lib/verifier.dart:447-469 | pkg/kernel/lib/verifier.dart:471-493 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:257 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:257-284 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:286-308 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/dart/analysis/library_context.dart:618 — pkg/analyzer/lib/src/dart/analysis/library_context.dart:618-640 | pkg/analyzer/lib/src/dart/analysis/library_diagnostics.dart:70-95 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/analyzer/lib/src/error/override_verifier.dart:136 — pkg/analyzer/lib/src/error/override_verifier.dart:136-158 | pkg/analyzer/lib/src/error/redeclare_verifier.dart:64-95 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:354 — pkg/dev_compiler/lib/src/js_ast/builder.dart:354-381 | pkg/js_ast/lib/src/strings.dart:116-138 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/cfg/lib/front_end/ast_to_ir.dart:788 — pkg/cfg/lib/front_end/ast_to_ir.dart:788-810 | pkg/cfg/lib/front_end/ast_to_ir.dart:848-871 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×43
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/array_patch.dart:35 — sdk/lib/_internal/vm/lib/array_patch.dart:35-38 | sdk/lib/_internal/wasm/common/array_patch.dart:29-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:147 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:147-150 | pkg/dds/lib/src/devtools/client.dart:144-149 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/observatory/lib/src/repositories/script.dart:8 — pkg/observatory/lib/src/repositories/script.dart:8-11 | pkg/observatory/lib/src/repositories/type_arguments.dart:8-11 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/_fe_analyzer_shared/lib/src/util/link.dart:65 — pkg/_fe_analyzer_shared/lib/src/util/link.dart:65-68 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/link.dart:146-149 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart:13 — pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart:13-16 | pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart:13-16 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:2092 — sdk/lib/_internal/wasm/common/typed_data.dart:2092-2095 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:574-577 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:219 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:219-222 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:219-222 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:4396 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4396-4399 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4992-4995 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1649 — sdk/lib/_internal/vm/lib/convert_patch.dart:1649-1652 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1478-1481 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1681 — sdk/lib/_internal/vm/lib/convert_patch.dart:1681-1684 | sdk/lib/_internal/wasm/common/convert_patch.dart:2080-2083 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:5827 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5827-5830 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6482-6485 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:178 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:178-182 | sdk/lib/_internal/vm/lib/string_patch.dart:436-439 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:803 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:803-806 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1016-1020 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:705 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:705-708 | sdk/lib/_internal/wasm/common/compact_hash.dart:663-666 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:776 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:776-779 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:989-993 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1654 — sdk/lib/_internal/vm/lib/convert_patch.dart:1654-1657 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1483-1486 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1117 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1117-1120 | sdk/lib/_internal/wasm/common/compact_hash.dart:1037-1040 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/async/stream.dart:2325 — sdk/lib/async/stream.dart:2325-2328 | tools/dom/src/EventStreamProvider.dart:340-343 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/compiler/lib/src/source_file_provider.dart:474 — pkg/compiler/lib/src/source_file_provider.dart:474-477 | pkg/compiler/lib/src/util/output_util.dart:13-17 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:12 — sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:12-15 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:30-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1631 — sdk/lib/_internal/vm/lib/convert_patch.dart:1631-1634 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1460-1465 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:5998 — pkg/analyzer/lib/src/fasta/ast_builder.dart:5998-6001 | pkg/analyzer/tool/summary/mini_ast.dart:733-736 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) pkg/front_end/testcases/general/colon_default_value.dart:8 — pkg/front_end/testcases/general/colon_default_value.dart:8-11 | pkg/front_end/testcases/general/colon_default_value_legacy.dart:10-13 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:392 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:392-395 | sdk/lib/_internal/vm_shared/lib/map_patch.dart:38-41 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1674 — sdk/lib/_internal/vm/lib/convert_patch.dart:1674-1679 | sdk/lib/_internal/wasm/common/convert_patch.dart:2075-2078 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×42
  • Duplicated block (18 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:22 — pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:22-39 | pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart:22-39 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart` and `pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart: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 (18 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart:217 — pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart:217-234 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:54-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart:217` 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 (18 lines × 2) pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:33 — pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:33-50 | pkg/analysis_server/lib/src/services/snippets/dart/switch_statement.dart:36-53 — 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 `pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:33` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/lib/src/services/snippets/dart/switch_statement.dart:33` calls `addSimpleLinkedEdit`, `writeln`, `writeIndented` and `pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:32` 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) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:35 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:35-52 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:59-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:35` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:9014 — pkg/analyzer/lib/src/dart/ast/ast.dart:9014-9031 | pkg/analyzer/lib/src/dart/ast/ast.dart:9246-9263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:9014` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/ast/ast.dart:9032` calls `_containsOffset` and `pkg/analyzer/lib/src/dart/ast/ast.dart:9264` 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) pkg/analyzer/lib/src/dart/ast/ast.dart:18911 — pkg/analyzer/lib/src/dart/ast/ast.dart:18911-18928 | pkg/analyzer/lib/src/dart/ast/ast.dart:32044-32061 — both copies are in the same file, so extract the 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) pkg/analyzer/lib/src/dart/ast/ast.dart:25087 — pkg/analyzer/lib/src/dart/ast/ast.dart:25087-25104 | pkg/analyzer/lib/src/dart/ast/ast.dart:25567-25584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:440 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:440-457 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:536-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:440` 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 `node` to `ImportPrefixedNameExpressionImpl` in one and `ReceiverIndexAssignmentTargetImpl` 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 (18 lines × 2) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:534 — pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:534-551 | pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:645-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:534` 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 (18 lines × 2) pkg/analyzer/lib/src/summary2/element_builder.dart:832 — pkg/analyzer/lib/src/summary2/element_builder.dart:832-849 | pkg/analyzer/lib/src/summary2/element_builder.dart:889-906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/element_builder.dart:832` 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) pkg/compiler/lib/src/dump_info.dart:1831 — pkg/compiler/lib/src/dump_info.dart:1831-1848 | pkg/compiler/lib/src/dump_info.dart:1916-1933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/dump_info.dart:1831` 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 (18 lines × 2) pkg/compiler/lib/src/universe/codegen_world_builder.dart:543 — pkg/compiler/lib/src/universe/codegen_world_builder.dart:543-560 | pkg/compiler/lib/src/universe/resolution_world_builder.dart:856-873 — before extracting anything, compare `pkg/compiler/lib/src/universe/codegen_world_builder.dart` and `pkg/compiler/lib/src/universe/resolution_world_builder.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/universe/codegen_world_builder.dart:543` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/compiler/lib/src/universe/resolution_world_builder.dart:852` calls `_hasInvokedSetter`, `union`, `write` and `pkg/compiler/lib/src/universe/codegen_world_builder.dart:540` 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) pkg/dartdev/lib/src/commands/build.dart:145 — pkg/dartdev/lib/src/commands/build.dart:145-162 | pkg/dartdev/lib/src/commands/compile.dart:385-402 — 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 `pkg/dartdev/lib/src/commands/build.dart:145` 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) pkg/dartdev/lib/src/commands/development_service.dart:40 — pkg/dartdev/lib/src/commands/development_service.dart:40-57 | pkg/dartdev/lib/src/commands/tooling_daemon.dart:34-51 — before extracting anything, compare `pkg/dartdev/lib/src/commands/development_service.dart` and `pkg/dartdev/lib/src/commands/tooling_daemon.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `pkg/dartdev/lib/src/commands/development_service.dart:40` 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 (18 lines × 2) pkg/dartdev/lib/src/processes.dart:37 — pkg/dartdev/lib/src/processes.dart:37-54 | pkg/dartdev/lib/src/processes.dart:77-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dartdev/lib/src/processes.dart:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/dartdev/lib/src/processes.dart:73` calls `startsWith`, `endsWith` and `pkg/dartdev/lib/src/processes.dart:35` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3604 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3604-3621 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4205-4222 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4033 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4033-4050 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4629-4646 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:4033` it does not close everything it opens, so those 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:4477 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4477-4494 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5079-5096 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (18 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8016 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8016-8033 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8882-8899 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:8016` 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) pkg/front_end/lib/src/dill/dill_target.dart:47 — pkg/front_end/lib/src/dill/dill_target.dart:47-64 | pkg/front_end/lib/src/kernel/kernel_target.dart:219-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `loader` to `DillLoader` in one and `SourceLoader` 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 (18 lines × 2) pkg/front_end/lib/src/fragment/constructor/declaration.dart:1068 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:1068-1085 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1487-1504 — both copies are in the same file, so extract the 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) pkg/front_end/lib/src/fragment/constructor/encoding.dart:246 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:246-263 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:950-967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/constructor/encoding.dart:246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) pkg/front_end/lib/src/kernel/constant_int_folder.dart:154 — pkg/front_end/lib/src/kernel/constant_int_folder.dart:154-171 | pkg/front_end/lib/src/kernel/constant_int_folder.dart:294-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_int_folder.dart:154` 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) pkg/front_end/lib/src/kernel/expression_generator.dart:836 — pkg/front_end/lib/src/kernel/expression_generator.dart:836-853 | pkg/front_end/lib/src/kernel/expression_generator.dart:1287-1304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/expression_generator.dart:836` it does not close everything it opens, so those 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) pkg/front_end/lib/src/kernel/type_builder_computer.dart:163 — pkg/front_end/lib/src/kernel/type_builder_computer.dart:163-180 | pkg/front_end/lib/src/kernel/type_builder_computer.dart:190-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/type_builder_computer.dart:163` 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 `node` to `InterfaceType` in one and `ExtensionType` 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.
  • + 17 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking benchmarks/FileIOSink/dart/FileIOSink.dart:30 — `teardown` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking benchmarks/FileIOSink/dart/FileIOSink.dart:60 — `teardown` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking benchmarks/FileIOSink/dart/FileIOSink.dart:90 — `teardown` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analysis_server/benchmark/perf/benchmarks_impl.dart:70 — `_calcCompletionTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analysis_server/benchmark/perf/benchmarks_impl.dart:121 — `_calcEditTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analysis_server/benchmark/perf/flutter_completion_benchmark.dart:191 — `_completionTiming` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analysis_server/tool/bulk_fix/parse_utils.dart:14 — `collectOverrides` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking REDACTED:303 — `start` is async and calls resolveSymbolicLinksSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer/tool/fine/ab_mutate.dart:172 — `_collectAndHandleErrors` is async and calls createSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer/tool/fine/ab_mutate.dart:187 — `_establishBaseline` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer/tool/fine/ab_mutate.dart:250 — `_runChain` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer/tool/fine/ab_mutate.dart:514 — `_runChains` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer/tool/fine/ab_mutate.dart:523 — `_setupAndBaseline` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer_utilities/lib/tools.dart:348 — `generate` is async and calls deleteSync, createSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/analyzer_utilities/lib/tools.dart:394 — `generate` is async and calls writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/dds/lib/devtools_server.dart:647 — `launchDevTools` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/dev_compiler/lib/ddc.dart:115 — `_runBatch` is async and calls writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/front_end/tool/dart_doctest_impl.dart:123 — `compileAndRun` is async and calls writeAsStringSync, deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/front_end/tool/flame/instrumenter_suite.dart:73 — `run` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/front_end/tool/fuzz/compile_helper.dart:48 — `compile` is async and calls writeAsBytesSync, writeAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/frontend_server/lib/frontend_server.dart:1184 — `writeJavaScriptBundle` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/frontend_server/lib/frontend_server.dart:1347 — `invalidateIfInitializingFromDill` is async and calls readAsBytesSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/linter/tool/test_linter.dart:35 — `lintFiles` is async and calls readAsStringSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/perf_witness/lib/recorder.dart:117 — `record` is async and calls createSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking pkg/perf_witness/lib/recorder.dart:248 — `_checkIfControlSocketIsFree` is async and calls deleteSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • + 15 more in this group — see findings.md.
D17 · Explicit Debt · FixmeComment · ×39
  • FixmeComment tools/dom/src/native_DOMImplementation.dart:331 — // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is fine w/ it. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/src/native_DOMImplementation.dart:486 — // FIXME: use a real Dart tokenizer. The following regular expressions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/src/native_DOMImplementation.dart:1044 — // FIXME: add copy method. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/database.py:126 — # FIXME: Speed this up by multi-threading. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/generator.py:500 — # FIXME: Optional constructors arguments should not be treated — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/generator.py:572 — # FIXME(leafp) We may wish to eliminate this special treatment of optional — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/htmldartgenerator.py:339 — # FIXME: When we pass in operations[0] below, we're assuming all — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/htmldartgenerator.py:347 — # FIXME: item should be renamed to operator[], not removed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/idlnode.py:675 — # FIXME: use regexp search instead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/systemnative.py:529 — # FIXME: We need this to access the WrapperTypeInfo. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tools/dom/scripts/systemnative.py:1186 — # FIXME: this should be configurable. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_directory_test.dart:32 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_directory_test.dart:72 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_file_test.dart:31 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_file_test.dart:73 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_link_test.dart:51 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_link_test.dart:66 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_link_test.dart:112 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_link_test.dart:126 — // FIXME(bkonyi): reenable when rawPath is exposed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_file_test.dart:42 — // FIXME(bkonyi): this isn"t true on some versions of MacOS. Why? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/standalone/io/non_utf8_file_test.dart:84 — // FIXME(bkonyi): this isn"t true on some versions of MacOS. Why? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/lib/html/document_test.dart:24 — // FIXME: nifty way crashes, do it boring way. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/lib/html/document_test.dart:46 — // FIXME: nifty way crashes, do it boring way. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/lib/html/htmloptionscollection_test.dart:11 — // FIXME: we need some massaging to dart:html to enable HTMLOptionsCollection.add — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/lib/html/instance_of_test.dart:65 — // FIXME(b/5286633): Interface injection type check workaround. — 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×39
  • Duplicated block (19 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11478 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11478-11496 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11501-11519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11478` 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 (19 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088-2106 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1353-1371 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088` it does not close everything it opens, so those 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) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:209 — pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:209-227 | pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:167-185 — before extracting anything, compare `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart` and `pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 `pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:209` 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 (19 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:29485 — pkg/analyzer/lib/src/dart/ast/ast.dart:29485-29503 | pkg/analyzer/lib/src/dart/ast/ast.dart:59076-59094 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) pkg/analyzer/lib/src/fine/library_manifest.dart:1948 — pkg/analyzer/lib/src/fine/library_manifest.dart:1948-1966 | pkg/analyzer/lib/src/fine/library_manifest.dart:2213-2231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fine/library_manifest.dart:1948` 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 (19 lines × 2) pkg/analyzer/lib/src/workspace/blaze.dart:663 — pkg/analyzer/lib/src/workspace/blaze.dart:663-681 | pkg/analyzer/lib/src/workspace/blaze.dart:685-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:2538 — pkg/compiler/lib/src/js_model/element_map_impl.dart:2538-2556 | pkg/compiler/lib/src/kernel/element_map_impl.dart:2010-2028 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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. 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) pkg/compiler/lib/src/ssa/builder.dart:4192 — pkg/compiler/lib/src/ssa/builder.dart:4192-4210 | pkg/compiler/lib/src/ssa/builder.dart:4279-4297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:4192` 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 `node` to `ir.SetLiteral` in one and `ir.MapLiteral` 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 (19 lines × 2) pkg/dartdev/lib/src/commands/compile.dart:156 — pkg/dartdev/lib/src/commands/compile.dart:156-174 | pkg/dartdev/lib/src/commands/compile.dart:211-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dartdev/lib/src/commands/compile.dart:156` 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 (19 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:1069 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1069-1087 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1377-1395 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:1069` 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 (19 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4419 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4419-4437 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5015-5033 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:5253 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5253-5271 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5863-5881 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:5426 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5426-5444 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6036-6054 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:7647 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7647-7665 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8514-8532 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7647` it does not close everything it opens, so those 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:7888 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7888-7906 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8756-8774 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7888` it does not close everything it opens, so those 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) pkg/front_end/lib/src/builder/type_parameter_builder.dart:264 — pkg/front_end/lib/src/builder/type_parameter_builder.dart:264-282 | pkg/front_end/lib/src/builder/type_parameter_builder.dart:588-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/builder/type_parameter_builder.dart:264` 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 (19 lines × 2) pkg/front_end/lib/src/fragment/constructor/declaration.dart:989 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:989-1007 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1327-1345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/constructor/declaration.dart:989` 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 (19 lines × 2) pkg/front_end/lib/src/fragment/getter/declaration.dart:164 — pkg/front_end/lib/src/fragment/getter/declaration.dart:164-182 | pkg/front_end/lib/src/fragment/setter/declaration.dart:167-185 — `pkg/front_end/lib/src/fragment/getter/declaration.dart` and `pkg/front_end/lib/src/fragment/setter/declaration.dart` 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 41 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 `pkg/front_end/lib/src/fragment/getter/declaration.dart:164` 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 (19 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:3556 — pkg/front_end/lib/src/kernel/body_builder.dart:3556-3578 | pkg/front_end/lib/src/kernel/body_builder.dart:3704-3722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:3556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:6178 — pkg/front_end/lib/src/kernel/body_builder.dart:6178-6196 | pkg/front_end/lib/src/kernel/body_builder.dart:6205-6223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:6178` 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 (19 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:8915 — pkg/front_end/lib/src/kernel/body_builder.dart:8915-8933 | pkg/front_end/lib/src/kernel/body_builder.dart:8944-8962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:8915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) pkg/front_end/lib/src/kernel/inferred_collections.dart:92 — pkg/front_end/lib/src/kernel/inferred_collections.dart:92-110 | pkg/front_end/lib/src/kernel/inferred_collections.dart:139-157 — both copies are in the same file, so extract the 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, `pkg/front_end/lib/src/kernel/inferred_collections.dart:91` calls `toTextInternal` and `pkg/front_end/lib/src/kernel/inferred_collections.dart:138` 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 (19 lines × 2) pkg/front_end/lib/src/kernel/internal_ast.dart:4098 — pkg/front_end/lib/src/kernel/internal_ast.dart:4098-4116 | pkg/front_end/lib/src/kernel/internal_ast.dart:4187-4205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/internal_ast.dart:4098` 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 (19 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13977 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:13977-13995 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:14025-14043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:13977` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) pkg/front_end/lib/src/type_inference/matching_expressions.dart:120 — pkg/front_end/lib/src/type_inference/matching_expressions.dart:120-138 | pkg/front_end/lib/src/type_inference/matching_expressions.dart:333-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/matching_expressions.dart:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ListPattern` in one and `MapPattern` 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×38
  • Duplicated block (20 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2176 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2176-2195 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1915-1934 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:128 — pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:128-147 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:180-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:128` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `TypeHierarchySubtypesParams` in one and `TypeHierarchySupertypesParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:29 — pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:29-48 | pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart:29-48 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart` and `pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:51 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:51-70 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:40-59 — 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:51` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/ast/ast.dart:7469 — pkg/analyzer/lib/src/dart/ast/ast.dart:7469-7488 | pkg/analyzer/lib/src/dart/ast/ast.dart:7493-7512 — both copies are in the same file, so extract the 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 (20 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:18547 — pkg/analyzer/lib/src/dart/ast/ast.dart:18547-18566 | pkg/analyzer/lib/src/dart/ast/ast.dart:18740-18759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:18547` 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 (20 lines × 2) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:263 — pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:263-282 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:854-873 — both copies are in the same file, so extract the 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 (20 lines × 2) pkg/analyzer/lib/src/summary2/bundle_reader.dart:825 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:825-844 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1169-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 `pkg/analyzer/lib/src/summary2/bundle_reader.dart:825` 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) pkg/analyzer/lib/src/summary2/bundle_reader.dart:852 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:852-871 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1196-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:852` 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) pkg/analyzer/lib/src/summary2/types_builder.dart:234 — pkg/analyzer/lib/src/summary2/types_builder.dart:234-253 | pkg/analyzer/lib/src/summary2/types_builder.dart:435-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `FieldFormalParameterImpl` in one and `SuperFormalParameterImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:135 — pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:135-154 | pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:158-177 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ForElement` in one and `ForStatement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) pkg/compiler/lib/src/inferrer/builder.dart:1727 — pkg/compiler/lib/src/inferrer/builder.dart:1727-1746 | pkg/compiler/lib/src/inferrer/builder.dart:1748-1767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/inferrer/builder.dart:1727` 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 (20 lines × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:2655 — pkg/compiler/lib/src/js_model/element_map_impl.dart:2655-2674 | pkg/compiler/lib/src/kernel/element_map_impl.dart:2106-2125 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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. 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) pkg/compiler/lib/src/serialization/member_data.dart:150 — pkg/compiler/lib/src/serialization/member_data.dart:150-169 | pkg/compiler/lib/src/serialization/member_data.dart:199-218 — both copies are in the same file, so extract the 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) pkg/compiler/lib/src/ssa/builder.dart:6691 — pkg/compiler/lib/src/ssa/builder.dart:6691-6710 | pkg/compiler/lib/src/ssa/builder.dart:6727-6746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:6691` 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 (20 lines × 2) pkg/dartdev/lib/src/commands/compile.dart:240 — pkg/dartdev/lib/src/commands/compile.dart:240-259 | pkg/dartdev/lib/src/commands/compile.dart:372-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:438 — pkg/dev_compiler/lib/src/js_ast/builder.dart:438-457 | pkg/js_ast/lib/src/builder.dart:370-389 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/builder.dart` and `pkg/js_ast/lib/src/builder.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 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 `pkg/dev_compiler/lib/src/js_ast/builder.dart:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:1457 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1457-1476 | pkg/js_ast/lib/src/builder.dart:1264-1283 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/builder.dart` and `pkg/js_ast/lib/src/builder.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 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 `pkg/dev_compiler/lib/src/js_ast/builder.dart:1457` 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 (20 lines × 2) pkg/dev_compiler/lib/src/js_ast/builder.dart:1483 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1483-1502 | pkg/js_ast/lib/src/builder.dart:1290-1309 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/builder.dart` and `pkg/js_ast/lib/src/builder.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 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 `pkg/dev_compiler/lib/src/js_ast/builder.dart:1483` 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 (20 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2600 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2600-2619 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2911-2930 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (20 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5232 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5232-5251 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5842-5861 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5987 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5987-6006 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6676-6695 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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) pkg/front_end/lib/src/fragment/setter/encoding.dart:354 — pkg/front_end/lib/src/fragment/setter/encoding.dart:354-373 | pkg/front_end/lib/src/fragment/setter/encoding.dart:681-700 — both copies are in the same file, so extract the 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) pkg/front_end/lib/src/kernel/body_builder.dart:1601 — pkg/front_end/lib/src/kernel/body_builder.dart:1601-1620 | pkg/front_end/lib/src/kernel/body_builder.dart:2080-2099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:1601` 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 (20 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:519 — pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:519-538 | pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:546-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:519` 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.
  • + 13 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×34
  • Change coupling: run.dart ↔ test.dart pkg/dartdev/lib/src/commands/run.dart:1 — `pkg/dartdev/lib/src/commands/run.dart` and `pkg/dartdev/lib/src/commands/test.dart` change together 100% of the time (11 of the 11 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `ca102718` [dartdev] Erase transient progress lines and share grace period acros…; `a8539697` Bump pub to eca8f8ada939be70f0be3189db31e421dd0be7fd; `ed26759e` Reland "[dartdev] Move executable compilation out of pub into dartdev" — run `git show` on any of them.
  • Change coupling: assist.dart ↔ assist_internal.dart pkg/analysis_server/lib/src/services/correction/assist.dart:1 — `pkg/analysis_server/lib/src/services/correction/assist.dart` and `pkg/analysis_server/lib/src/services/correction/assist_internal.dart` change together 92% of the time (12 of the 13 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `dd66887e` Add an assist to move a field initializer into the declaration; `bda52677` [DAS] Adds assist to "Add type name" on dot-shorthands; `cdd8ca2d` Add an assist to convert a non-declaring parameter into a declaring p… — run `git show` on any of them.
  • Change coupling: declaration.dart ↔ declaration.dart pkg/front_end/lib/src/fragment/getter/declaration.dart:1 — `pkg/front_end/lib/src/fragment/getter/declaration.dart` and `pkg/front_end/lib/src/fragment/setter/declaration.dart` change together 90% of the time (9 of the 10 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `d56a2c6f` [cfe][augmentations] Support unordered property augmentation; `94eac2cb` [cfe] Propagate ScopeProviderInfo objects to all new FunctionNodes; `d3544010` [cfe] Don't create old variables when the experiment is enabled — run `git show` on any of them.
  • Change coupling: ast_binary_reader.dart ↔ ast_binary_writer.dart pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1 — `pkg/analyzer/lib/src/summary2/ast_binary_reader.dart` and `pkg/analyzer/lib/src/summary2/ast_binary_writer.dart` change together 89% of the time (25 of the 28 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `7b4e4a32` CQ. Serialize token types by their scanner index.; `966de0e5` AST. Preserve token types of names in serialized ASTs.; `5c0fa8b7` AST. Split dot shorthand contexts into missing and invalid, keep the … — run `git show` on any of them.
  • Change coupling: native_typed_data.dart ↔ simd.dart sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1 — `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/wasm/common/simd.dart` change together 83% of the time (15 of the 18 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `dfceaabf` [typed_data] Add Int32x4.operator *; `cd6cf73d` [typed_data] Implement Float32x4 and Float64x2 clamp with min and max; `41464f01` [typed_data] Implement IEEE min/max for Float32x4/Float64x2 and add a… — run `git show` on any of them.
  • Change coupling: default_value_resolver.dart ↔ top_level_inference.dart pkg/analyzer/lib/src/summary2/default_value_resolver.dart:1 — `pkg/analyzer/lib/src/summary2/default_value_resolver.dart` and `pkg/analyzer/lib/src/summary2/top_level_inference.dart` change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `7cd82b7c` Elements. Remove ConstantInitializerImpl and the cached constant init…; `18e5788d` Issue 64687. Resolve default values and constant initializers of all …; `1eb07a8a` RR. Resolve LibraryAnalyzer units through AstResolver.resolveUnit — run `git show` on any of them.
  • Change coupling: compile.dart ↔ dart2wasm.dart pkg/dart2wasm/lib/compile.dart:1 — `pkg/dart2wasm/lib/compile.dart` and `pkg/dart2wasm/lib/dart2wasm.dart` change together 75% of the time (15 of the 20 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `ff3d378d` [dart2wasm] Add ability to dump CFG log & CFG annotated wat; `0b79bdfb` [dart2wasm] Add non-es6 module loading option to mjs runtime file.; `1c34e924` [dart2wasm] Require `js-string` builtins to be supported — run `git show` on any of them.
  • Change coupling: edit_get_fixes.dart ↔ driver.dart pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart:1 — `pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart` and `pkg/analyzer_cli/lib/src/driver.dart` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `803b9714` AO. Add AnalysisOptionsParseSession and AnalysisOptionsParseResult.; `ba7394de` AO. Use File and Folder, don't go down to path during validation.; `06487866` AO. Simplify AnalysisOptionsValidator to 'validate(File)'. — run `git show` on any of them.
  • Change coupling: context_manager.dart ↔ edit_get_fixes.dart pkg/analysis_server/lib/src/context_manager.dart:1 — `pkg/analysis_server/lib/src/context_manager.dart` and `pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `803b9714` AO. Add AnalysisOptionsParseSession and AnalysisOptionsParseResult.; `ba7394de` AO. Use File and Folder, don't go down to path during validation.; `06487866` AO. Simplify AnalysisOptionsValidator to 'validate(File)'. — run `git show` on any of them.
  • Change coupling: internal_patch.dart ↔ internal_patch.dart sdk/lib/_internal/js_runtime/lib/internal_patch.dart:1 — `sdk/lib/_internal/js_runtime/lib/internal_patch.dart` and `sdk/lib/_internal/wasm/common/internal_patch.dart` change together 70% of the time (7 of the 10 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `999fefcf` [vm] Move IsolateGroup from dart:_internal to dart:_vm; `cd2d0d05` [core] Move IsolateExperimental out of dart:_internal into dart:_vm; `f28f3d27` [vm/shared] Unship isolate api related to isolate groups proposal. — run `git show` on any of them.
  • Change coupling: element_usage_detector.dart ↔ sdk_constraint_verifier.dart pkg/analyzer/lib/src/error/element_usage_detector.dart:1 — `pkg/analyzer/lib/src/error/element_usage_detector.dart` and `pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart` change together 67% of the time (8 of the 12 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `1d2049de` AST. Remove dead checks for other V1-only expressions.; `29f9fb4c` AST. Remove dead checks for V1-only identifiers and property accesses.; `35059d06` AST. Add NamedAssignmentTarget. — run `git show` on any of them.
  • Change coupling: scope_context.dart ↔ type_analyzer.dart pkg/analyzer/lib/src/dart/resolver/scope_context.dart:1 — `pkg/analyzer/lib/src/dart/resolver/scope_context.dart` and `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart` change together 64% of the time (16 of the 25 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c4eba0a8` Issue 64687. Use fragment formal parameters for flow analysis.; `f69581d4` AST. Clean up TopLevelGetterDeclaration after the V2 migration.; `01508504` CQ. Add visitConstructorDeclaration and visitPrimaryConstructorBody t… (at that commit the file was still `pkg/analyzer/lib/src/generated/resolver.dart`) — run `git show` on any of them.
  • Change coupling: record_use_emitter.dart ↔ record_instance.dart pkg/compiler/lib/src/js_emitter/record_use_emitter.dart:1 — `pkg/compiler/lib/src/js_emitter/record_use_emitter.dart` and `pkg/vm/lib/transformations/record_use/record_instance.dart` change together 64% of the time (7 of the 11 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9ba8f895` [record_use] Const instances loading units; `a158789f` [record_use] Constructor invocations via typedefs; `3df571a2` [record_use] Mixin static members — run `git show` on any of them.
  • Change coupling: stub_code_generator.dart ↔ snapshot.dart pkg/native_compiler/lib/back_end/arm64/stub_code_generator.dart:1 — `pkg/native_compiler/lib/back_end/arm64/stub_code_generator.dart` and `pkg/native_compiler/lib/snapshot/snapshot.dart` change together 64% of the time (7 of the 11 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `3c058b76` [modular_aot] Dynamic call stub and dynamic invocation forwarders; `938322ce` [vm/modaot] Implement SubtypeTestCache stubs.; `9980c166` [modular_aot] Recognized methods, episode 16 — run `git show` on any of them.
  • Change coupling: normalize.dart ↔ scenario.dart pkg/analysis_server/tool/log_player/normalize.dart:1 — `pkg/analysis_server/tool/log_player/normalize.dart` and `pkg/analysis_server/tool/performance/scenarios/scenario.dart` change together 64% of the time (7 of the 11 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `287a20d2` Bump tools to 7dc3279da2d7b6bdd49164cada8531d6a2125c15; `ead50eae` Add a scenario/log with multiple contexts; `dea5b5c3` Support initializing projects with multiple package configs, as well … — run `git show` on any of them.
  • Change coupling: REDACTED ↔ sandbox_client.dart REDACTED:1 — `REDACTED` and `pkg/dartpad_worker/lib/src/tools/sandbox_client.dart` change together 62% of the time (10 of the 16 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `55a1f1f0` [dartpad_worker] Expose resolvePackage RPC to sandbox; `39663022` [dartpad_worker] Pass packageRoot to sandbox on run; `2a08505a` [dartpad_worker] Expose read-only workspace filesystem RPCs to sandbox — run `git show` on any of them.
  • Change coupling: best_practices_verifier.dart ↔ sdk_constraint_verifier.dart pkg/analyzer/lib/src/error/best_practices_verifier.dart:1 — `pkg/analyzer/lib/src/error/best_practices_verifier.dart` and `pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `1d2049de` AST. Remove dead checks for other V1-only expressions.; `29f9fb4c` AST. Remove dead checks for V1-only identifiers and property accesses.; `35059d06` AST. Add NamedAssignmentTarget. — run `git show` on any of them.
  • Change coupling: body_builder_helpers.dart ↔ inference_visitor.dart pkg/front_end/lib/src/kernel/body_builder_helpers.dart:1 — `pkg/front_end/lib/src/kernel/body_builder_helpers.dart` and `pkg/front_end/lib/src/type_inference/inference_visitor.dart` change together 57% of the time (12 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `89be497c` [cfe][InternalNode] Clean up for loop/break/continue; `1f370514` [cfe][InternalNodes] Use InternalExpression in internal_ast_helper; `d553358c` [cfe][InternalNodes] Update annotation handling — run `git show` on any of them.
  • Change coupling: best_practices_verifier.dart ↔ const_argument_verifier.dart pkg/analyzer/lib/src/error/best_practices_verifier.dart:1 — `pkg/analyzer/lib/src/error/best_practices_verifier.dart` and `pkg/analyzer/lib/src/error/const_argument_verifier.dart` change together 57% of the time (8 of the 14 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `0e04d0ab` AST. Add FormalParameterList.allFormalParameters, use it instead of V…; `1d2049de` AST. Remove dead checks for other V1-only expressions.; `29f9fb4c` AST. Remove dead checks for V1-only identifiers and property accesses. — run `git show` on any of them.
  • Change coupling: constructor_invocation_resolver.dart ↔ method_invocation_resolver.dart pkg/analyzer/lib/src/dart/resolver/constructor_invocation_resolver.dart:1 — `pkg/analyzer/lib/src/dart/resolver/constructor_invocation_resolver.dart` and `pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart` change together 56% of the time (10 of the 18 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `f09f1032` UNDR. Report undefined super members as reads and writes.; `be79c30f` UNDR. Report failed name lookups through LookupFailureReporter.; `2dd31d2e` AST. Resolve dot-shorthand expressions through AST V2 heads. — run `git show` on any of them.
  • Change coupling: lint_codes.dart ↔ generate.dart pkg/analyzer/lib/src/dart/error/lint_codes.dart:1 — `pkg/analyzer/lib/src/dart/error/lint_codes.dart` and `pkg/analyzer/tool/messages/generate.dart` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `5343e1b2` [messages] Generalize static types of analyzer message constants.; `781cf0e9` [messages] Use named parameters in DiagnosticCode constructors.; `59f5398c` [messages] Create DiagnosticCodeImpl class. — run `git show` on any of them.
  • Change coupling: ast.dart ↔ ast_binary_tag.dart pkg/analyzer/lib/dart/ast/ast.dart:1 — `pkg/analyzer/lib/dart/ast/ast.dart` and `pkg/analyzer/lib/src/summary2/ast_binary_tag.dart` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `5c0fa8b7` AST. Split dot shorthand contexts into missing and invalid, keep the …; `2dd31d2e` AST. Resolve dot-shorthand expressions through AST V2 heads.; `228d92a0` AST. Implement FunctionInstantiation. — run `git show` on any of them.
  • Change coupling: expression_generator_helper.dart ↔ resolver.dart pkg/front_end/lib/src/kernel/expression_generator_helper.dart:1 — `pkg/front_end/lib/src/kernel/expression_generator_helper.dart` and `pkg/front_end/lib/src/kernel/resolver.dart` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `1f370514` [cfe][InternalNodes] Use InternalExpression in internal_ast_helper; `ed91e867` [cfe][InternalNodes] Use InternalInvalidExpression; `ae77bf8f` [cfe][InternalNodes] Separate InternalInitializer from Initializer — run `git show` on any of them.
  • Change coupling: library_manifest.dart ↔ requirement_failure.dart pkg/analyzer/lib/src/fine/library_manifest.dart:1 — `pkg/analyzer/lib/src/fine/library_manifest.dart` and `pkg/analyzer/lib/src/fine/requirement_failure.dart` change together 52% of the time (11 of the 21 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `d5862675` DeCo. Deprecate LibraryElement.isSynthetic, use 'isOriginNotExistingF…; `9cce31c2` Fine. Make ClassItem subtype lists nullable.; `6e9b3a10` Fine. Record LibraryElementImpl.isSynthetic — run `git show` on any of them.
  • Change coupling: body_builder.dart ↔ type_inferrer.dart pkg/front_end/lib/src/kernel/body_builder.dart:1 — `pkg/front_end/lib/src/kernel/body_builder.dart` and `pkg/front_end/lib/src/type_inference/type_inferrer.dart` change together 51% of the time (23 of the 45 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 23 shared commits counted here, the most recent 3 are `8fd764ce` [cfe][Contexts] Add InternalAnnotatable; `4286c16a` [cfe][InternalNode] Use InternalNode as type argument for flow analysis; `abba993e` [cfe][InternalNodes] Add InternalNode — run `git show` on any of them.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×34
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:425 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:425-455 | sdk/lib/_internal/js_runtime/lib/js_array.dart:531-556 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:57 — pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:57-82 | pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:568-594 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/observatory/lib/src/elements/code_view.dart:497 — pkg/observatory/lib/src/elements/code_view.dart:497-524 | pkg/observatory/lib/src/elements/code_view.dart:594-619 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:194 — pkg/analyzer/lib/src/fine/library_manifest.dart:194-219 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:460-485 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:94 — sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:94-119 | sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:127-153 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/observatory/lib/src/elements/script_inset.dart:474 — pkg/observatory/lib/src/elements/script_inset.dart:474-504 | pkg/observatory/lib/src/elements/script_inset.dart:523-548 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:410 — pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:410-439 | pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:504-529 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/observatory/lib/src/elements/json_view.dart:87 — pkg/observatory/lib/src/elements/json_view.dart:87-113 | pkg/observatory/lib/src/elements/json_view.dart:115-140 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/wasm/js/string_patch.dart:23 — sdk/lib/_internal/wasm/js/string_patch.dart:23-51 | sdk/lib/_internal/wasm/standalone/string_patch.dart:21-46 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/analyzer/lib/src/error/element_usage_detector.dart:268 — pkg/analyzer/lib/src/error/element_usage_detector.dart:268-293 | pkg/analyzer/lib/src/error/element_usage_detector.dart:740-765 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/vm/lib/integers.dart:414 — sdk/lib/_internal/vm/lib/integers.dart:414-439 | sdk/lib/_internal/wasm/common/boxed_int.dart:307-333 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:614 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:614-639 | sdk/lib/_internal/wasm/common/compact_hash.dart:579-604 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:1158 — pkg/compiler/lib/src/js/size_estimator.dart:1158-1183 | pkg/js_ast/lib/src/printer.dart:1599-1632 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart:42 — pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart:42-67 | pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart:69-101 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:995 — pkg/observatory/lib/src/elements/heap_snapshot.dart:995-1020 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1022-1047 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:643 — pkg/observatory/lib/src/elements/heap_snapshot.dart:643-668 | pkg/observatory/lib/src/elements/process_snapshot.dart:329-356 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/compiler/lib/src/inferrer/builder.dart:713 — pkg/compiler/lib/src/inferrer/builder.dart:713-743 | pkg/compiler/lib/src/inferrer/builder.dart:754-779 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:314 — pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:314-339 | pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:408-437 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:598 — sdk/lib/_internal/wasm/js_common/js_string.dart:598-629 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:437-462 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/analyzer/lib/src/summary2/element_builder.dart:2091 — pkg/analyzer/lib/src/summary2/element_builder.dart:2091-2123 | pkg/analyzer/lib/src/summary2/element_builder.dart:2138-2163 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:341 — pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:341-366 | pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:439-468 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/analyzer_testing/lib/src/expected_diagnostics.dart:164 — pkg/analyzer_testing/lib/src/expected_diagnostics.dart:164-189 | pkg/analyzer_testing/lib/src/expected_diagnostics.dart:191-217 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/dart2wasm/lib/constants.dart:1593 — pkg/dart2wasm/lib/constants.dart:1593-1618 | pkg/dart2wasm/lib/constants.dart:1620-1651 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:6171 — pkg/front_end/lib/src/kernel/body_builder.dart:6171-6196 | pkg/front_end/lib/src/kernel/body_builder.dart:6198-6223 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) pkg/front_end/lib/src/dill/dill_library_builder.dart:389 — pkg/front_end/lib/src/dill/dill_library_builder.dart:389-415 | pkg/front_end/lib/src/source/source_library_builder.dart:939-964 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 9 more in this group — see findings.md.
D17 · Explicit Debt · HackComment · ×33
  • HackComment tools/dom/scripts/htmldartgenerator.py:556 — # Hack to ignore the constructor used by JavaScript. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tools/dom/scripts/htmldartgenerator.py:838 — # HACK(terry): Element is not abstract for Dartium so isContentEditable — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tools/dom/scripts/htmldartgenerator.py:865 — # HACK(terry): Element is not abstract for Dartium so click — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/language/deferred/static_separate_lib1.dart:16 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/language/deferred/static_separate_lib1.dart:21 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/language/deferred/static_separate_lib1.dart:51 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/compiler/test/deferred_loading/data/static_separate/lib1.dart:32 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/compiler/test/deferred_loading/data/static_separate/lib1.dart:42 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/compiler/test/deferred_loading/data/static_separate/lib1.dart:126 — // Hack to avoid inlining. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/language/control_flow_collections/utils.dart:71 — /// Hacky way of testing the inferred generic type arguments of [object]. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment sdk/lib/_http/websocket_impl.dart:432 — // Hack - as we always do index++ below. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment runtime/tools/dartfuzz/gen_type_table.dart:1044 — // Hack: dartfuzz.dart already handles subscripts, therefore we exclude — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment runtime/tools/dartfuzz/gen_type_table.dart:1101 — // Hack: remove unary from operator so that the operator name can be — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment runtime/tools/dartfuzz/gen_type_table.dart:1479 — // Hack: Filter out some difficult types, abstract types and types that — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/testing/lib/src/chain.dart:176 — /// Hack: If not running with asserts running the (invalid) configuration — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/test_runner/lib/src/static_error.dart:801 — // Hack: If the error is CFE-only and the length is one, treat it as no — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/tool/fuzz/gReader.dart:779 — // Hack: Join them. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/test/binary_md_dill_reader.dart:130 — // Hack start: Read ComponentIndex first. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/test/binary_md_dill_reader.dart:164 — // Hack end. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/test/binary_md_dill_reader.dart:635 — // Hack: Use the ComponentIndex to go to the end and read the length. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/test/outline_extractor_tester.dart:38 — // Hack. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/front_end/lib/src/util/outline_extractor.dart:195 — // Hack: Put type variable declarations into scope so any overlap in — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/dev_compiler/test/sourcemap/ddc_common.dart:108 — // Hack for DDC naming scheme. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/compiler/test/codesize/swarm/Views.dart:875 — // Hack so that _lengths[length - 1] is available. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment pkg/compiler/test/codesize/swarm/swarm_ui_lib/view/PagedViews.dart:205 — // Hacky: make sure a change event always fires. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×33
  • Edited copy of a member (21 corresponding lines) sdk/lib/_internal/vm/lib/string_patch.dart:1090 — sdk/lib/_internal/vm/lib/string_patch.dart:1090-1111 | sdk/lib/_internal/vm/lib/string_patch.dart:1113-1133 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:490 — pkg/compiler/lib/src/js_model/element_map_impl.dart:490-510 | pkg/compiler/lib/src/kernel/element_map_impl.dart:142-164 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:596 — pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:596-620 | pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:622-642 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/vm_service/tool/dart/generate_dart_common.dart:1251 — pkg/vm_service/tool/dart/generate_dart_common.dart:1251-1274 | pkg/vm_service/tool/dart/generate_dart_common.dart:1292-1312 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:1083 — sdk/lib/_internal/wasm/common/typed_data.dart:1083-1107 | sdk/lib/_internal/wasm/common/typed_data.dart:1125-1145 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:131 — sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:131-151 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:192-213 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/cfg/lib/front_end/ast_to_ir.dart:698 — pkg/cfg/lib/front_end/ast_to_ir.dart:698-719 | pkg/cfg/lib/front_end/ast_to_ir.dart:766-786 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:42 — sdk/lib/_internal/vm/lib/growable_array.dart:42-65 | sdk/lib/_internal/wasm/common/list.dart:562-582 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/observatory/lib/src/elements/isolate_view.dart:56 — pkg/observatory/lib/src/elements/isolate_view.dart:56-82 | pkg/observatory/lib/src/elements/vm_view.dart:43-63 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:3244 — pkg/analyzer/lib/src/fasta/ast_builder.dart:3244-3264 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3310-3330 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analysis_server/lib/src/handler/legacy/search_find_member_declarations.dart:16 — pkg/analysis_server/lib/src/handler/legacy/search_find_member_declarations.dart:16-36 | pkg/analysis_server/lib/src/handler/legacy/search_find_member_references.dart:16-36 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/linter/lib/src/rules/omit_local_variable_types.dart:45 — pkg/linter/lib/src/rules/omit_local_variable_types.dart:45-66 | pkg/linter/lib/src/rules/omit_obvious_local_variable_types.dart:47-67 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3361 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:3361-3381 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:3422-3442 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/dart_runtime_service_dds/lib/src/dds_expression_evaluator.dart:24 — pkg/dart_runtime_service_dds/lib/src/dds_expression_evaluator.dart:24-44 | pkg/dart_runtime_service_dds/lib/src/dds_expression_evaluator.dart:46-72 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1645 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1645-1665 | pkg/js_ast/lib/src/builder.dart:1441-1461 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/move_annotation_to_library_directive.dart:25-53 | pkg/analysis_server/lib/src/services/correction/dart/move_doc_comment_to_library_directive.dart:26-46 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2393 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2393-2423 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4802-4822 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/linter/lib/src/rules/library_private_types_in_public_api.dart:122 — pkg/linter/lib/src/rules/library_private_types_in_public_api.dart:122-142 | pkg/linter/lib/src/rules/library_private_types_in_public_api.dart:237-258 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:8295 — pkg/analyzer/lib/src/dart/ast/ast.dart:8295-8315 | pkg/analyzer/lib/src/dart/ast/ast.dart:9093-9114 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:155 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:155-179 | pkg/dds/lib/src/devtools/client.dart:179-199 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/front_end/lib/src/source/source_class_builder.dart:252 — pkg/front_end/lib/src/source/source_class_builder.dart:252-273 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:152-172 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:30170 — pkg/analyzer/lib/src/dart/ast/ast.dart:30170-30190 | pkg/analyzer/lib/src/dart/ast/ast.dart:30973-30993 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:2410 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:2410-2430 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:2432-2454 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:855 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:855-875 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:2215-2235 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:43 — pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:43-63 | pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:141-171 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×33
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:270 — sdk/lib/_internal/wasm/common/simd.dart:270-274 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2712-2718 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:67 — sdk/lib/_internal/vm/lib/growable_array.dart:67-71 | sdk/lib/_internal/wasm/common/list.dart:584-588 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/analyzer/tool/generators/ast_generator.dart:40 — pkg/analyzer/tool/generators/ast_generator.dart:40-44 | pkg/analyzer/tool/generators/string_search_util_generator.dart:67-73 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1083 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1083-1088 | pkg/compiler/lib/src/kernel/element_map_impl.dart:745-749 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/front_end/lib/src/testing/id_extractor.dart:123 — pkg/front_end/lib/src/testing/id_extractor.dart:123-134 | pkg/analyzer/lib/src/util/ast_data_extractor.dart:88-92 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:461 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:461-466 | sdk/lib/_internal/js_runtime/lib/js_number.dart:550-554 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:381 — pkg/dev_compiler/lib/src/js_ast/template.dart:381-385 | pkg/js_ast/lib/src/template.dart:370-376 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:403 — pkg/dev_compiler/lib/src/js_ast/template.dart:403-407 | pkg/js_ast/lib/src/template.dart:396-402 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:370 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:370-375 | sdk/lib/_internal/js_runtime/lib/js_string.dart:349-353 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:377 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:377-382 | sdk/lib/_internal/js_runtime/lib/js_string.dart:355-359 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/wasm/js_common/regexp_helper.dart:154 — sdk/lib/_internal/wasm/js_common/regexp_helper.dart:154-158 | sdk/lib/_internal/wasm/standalone/regexp.dart:58-64 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/compiler/lib/src/js/js_debug.dart:25 — pkg/compiler/lib/src/js/js_debug.dart:25-33 | pkg/kernel/lib/text/debug_printer.dart:18-22 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:362 — sdk/lib/_internal/vm/lib/growable_array.dart:362-366 | sdk/lib/_internal/wasm/js_common/js_array.dart:303-308 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:71 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:71-75 | sdk/lib/_internal/wasm/common/typed_data.dart:1906-1911 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart:46 — pkg/analysis_server/lib/src/services/correction/dart/add_trailing_comma.dart:46-50 | pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart:200-204 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:670 — pkg/dev_compiler/lib/src/js_ast/printer.dart:670-674 | pkg/js_ast/lib/src/printer.dart:728-732 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/kernel/lib/src/ast/misc.dart:228 — pkg/kernel/lib/src/ast/misc.dart:228-232 | pkg/native_stack_traces/lib/src/macho.dart:499-503 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:135 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:135-139 | sdk/lib/_internal/js_runtime/lib/js_array.dart:216-220 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/compiler/lib/src/elements/types.dart:1614 — pkg/compiler/lib/src/elements/types.dart:1614-1619 | pkg/compiler/lib/src/js_backend/type_reference.dart:699-703 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/collection/list.dart:83 — sdk/lib/collection/list.dart:83-87 | sdk/lib/internal/iterable.dart:68-72 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) sdk/lib/io/file_impl.dart:777 — sdk/lib/io/file_impl.dart:777-781 | sdk/lib/io/link.dart:356-360 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/cfg/lib/ir/functions.dart:310 — pkg/cfg/lib/ir/functions.dart:310-315 | pkg/cfg/lib/ir/types.dart:323-327 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/dart_runtime_service/lib/src/utils.dart:77 — pkg/dart_runtime_service/lib/src/utils.dart:77-81 | sdk/lib/vmservice/named_lookup.dart:22-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:22 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:22-26 | pkg/dds/lib/src/devtools/client.dart:23-27 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:987 — pkg/compiler/lib/src/js_model/element_map_impl.dart:987-992 | pkg/compiler/lib/src/kernel/element_map_impl.dart:683-687 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×31
  • Edited copy of a member (20 corresponding lines) pkg/dart2wasm/lib/code_generator.dart:2168 — pkg/dart2wasm/lib/code_generator.dart:2168-2188 | pkg/dart2wasm/lib/state_machine.dart:1405-1424 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/analysis/search.dart:1121 — pkg/analyzer/lib/src/dart/analysis/search.dart:1121-1140 | pkg/analyzer/lib/src/dart/analysis/search.dart:1274-1293 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/analysis/search.dart:288 — pkg/analyzer/lib/src/dart/analysis/search.dart:288-307 | pkg/analyzer/lib/src/dart/analysis/search.dart:383-404 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:208 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:208-228 | sdk/lib/_internal/js_runtime/lib/js_number.dart:247-266 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/kernel/lib/testing/type_parser.dart:279 — pkg/kernel/lib/testing/type_parser.dart:279-298 | pkg/vm/lib/transformations/type_flow/calls.dart:278-298 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/observatory/lib/src/sample_profile/sample_profile.dart:154 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:154-173 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:471-493 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:182 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:182-203 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:426-445 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/compiler/lib/src/js_backend/enqueuer.dart:272 — pkg/compiler/lib/src/js_backend/enqueuer.dart:272-291 | pkg/compiler/lib/src/resolution/enqueuer.dart:283-302 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:194 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:194-219 | pkg/dds/lib/src/devtools/client.dart:201-220 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:556 — pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:556-575 | pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:577-598 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/analysis/index.dart:914 — pkg/analyzer/lib/src/dart/analysis/index.dart:914-940 | pkg/analyzer/lib/src/dart/micro/utils.dart:504-523 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:424 — pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:424-443 | pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:1218-1239 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/kernel/lib/src/bounds_checks.dart:850 — pkg/kernel/lib/src/bounds_checks.dart:850-869 | pkg/kernel/lib/src/bounds_checks.dart:871-890 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:983 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:983-1002 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1004-1024 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:163 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:163-182 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:372-394 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/front_end/lib/src/source/source_compilation_unit.dart:671 — pkg/front_end/lib/src/source/source_compilation_unit.dart:671-690 | pkg/front_end/lib/src/source/source_loader.dart:1098-1118 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/wasm_builder/lib/src/ir/element.dart:29 — pkg/wasm_builder/lib/src/ir/element.dart:29-48 | pkg/wasm_builder/lib/src/ir/element.dart:90-110 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:32 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:32-54 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:56-75 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:11989 — pkg/analyzer/lib/src/dart/ast/ast.dart:11989-12008 | pkg/analyzer/lib/src/dart/ast/ast.dart:44623-44643 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/error/best_practices_verifier.dart:247 — pkg/analyzer/lib/src/error/best_practices_verifier.dart:247-274 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:642-661 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/front_end/lib/src/builder/formal_parameter_builder.dart:123 — pkg/front_end/lib/src/builder/formal_parameter_builder.dart:123-145 | pkg/front_end/lib/src/builder/formal_parameter_builder.dart:241-260 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:501 — pkg/dev_compiler/lib/src/js_ast/printer.dart:501-520 | pkg/js_ast/lib/src/printer.dart:557-576 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:2183 — pkg/analyzer/lib/src/fasta/ast_builder.dart:2183-2202 | pkg/analyzer/lib/src/fasta/ast_builder.dart:2204-2224 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/expect/lib/float_bits.dart:161 — pkg/expect/lib/float_bits.dart:161-180 | pkg/expect/lib/float_bits.dart:299-318 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart:248 — pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart:248-267 | pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart:269-288 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 6 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Empty method body · ×29
  • Empty method body — does nothing with its inputs pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:1084 — `_storeForLoopParts` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/analyzer/lib/src/summary2/linked_element_factory.dart:280 — `_disposeLibrary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:644 — `registerOptimization` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/outline_extraction_testcases/part_01/main.dart:3 — `test12part1usage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/outline_extraction_testcases/part_01/main.dart:4 — `secondtest12part1usage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:3 — `foo3` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:4 — `foo4` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok.dart:5 — `foo5` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:3 — `foo3` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:4 — `foo4` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/error_recovery/issue_50908_ok_prime.dart:5 — `foo5` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/general/call_on_after_try_block.dart:15 — `on` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart:13 — `onX` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart:22 — `on` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/constructor_tearoffs/bound_checks_in_type_literals.dart:9 — `test2` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/dart2wasm/inference_update_2/issue52452.dart:46 — `acceptsInt` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/dartdevc/inference_update_2/issue52452.dart:46 — `acceptsInt` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/enhanced_enums/instantiated_generic_enum_types.dart:34 — `boz` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/extension_types/nullability.dart:81 — `testOptionalPositional` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/extension_types/nullability.dart:97 — `testNamedNotRequired` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/general/deferred_type_annotation.dart:7 — `bad` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:5 — `topLevelOptionalPositional` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:6 — `topLevelOptionalNamed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:7 — `topLevelOptionalPositionalImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:8 — `topLevelOptionalNamedImplicit` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×26
  • Edited copy of a member (24 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart:51 — pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart:51-78 | pkg/analysis_server/lib/src/services/correction/dart/replace_conditional_with_if_else.dart:80-103 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:676 — pkg/dev_compiler/lib/src/js_ast/builder.dart:676-699 | pkg/js_ast/lib/src/builder.dart:554-577 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/kernel/lib/src/constant_replacer.dart:142 — pkg/kernel/lib/src/constant_replacer.dart:142-165 | pkg/kernel/lib/src/constant_replacer.dart:209-238 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/observatory/lib/src/elements/containers/virtual_tree.dart:105 — pkg/observatory/lib/src/elements/containers/virtual_tree.dart:105-128 | pkg/observatory/lib/src/elements/containers/virtual_tree.dart:130-153 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:291 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:291-316 | sdk/lib/_internal/js_runtime/lib/js_string.dart:275-298 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/compiler/lib/src/source_file_provider.dart:532 — pkg/compiler/lib/src/source_file_provider.dart:532-560 | pkg/compiler/lib/src/source_file_provider.dart:585-608 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:403 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:403-426 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:420-447 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1785 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1785-1808 | pkg/compiler/lib/src/kernel/element_map_impl.dart:893-921 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart:63 — sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart:63-86 | sdk/lib/_internal/js_runtime/lib/async_patch.dart:160-184 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:7168 — pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:7168-7191 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:7525-7565 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:1031 — pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:1031-1054 | pkg/kernel/lib/class_hierarchy.dart:1229-1253 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/observatory/lib/src/elements/metric/details.dart:104 — pkg/observatory/lib/src/elements/metric/details.dart:104-127 | pkg/observatory/lib/src/elements/metric/details.dart:129-152 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:335 — pkg/analyzer/lib/src/fasta/ast_builder.dart:335-359 | pkg/analyzer/lib/src/fasta/ast_builder.dart:361-384 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:443 — pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:443-466 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:752-775 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/_fe_analyzer_shared/lib/src/util/options.dart:248 — pkg/_fe_analyzer_shared/lib/src/util/options.dart:248-273 | pkg/_fe_analyzer_shared/lib/src/util/options.dart:286-309 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:27 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:27-50 | pkg/dds/lib/src/devtools/memory_profile.dart:30-56 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1241 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1241-1270 | pkg/analyzer/lib/src/fasta/ast_builder.dart:4371-4394 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1546 — pkg/compiler/lib/src/js/rewrite_async.dart:1546-1569 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1590-1613 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer/lib/src/generated/ffi_verifier.dart:503 — pkg/analyzer/lib/src/generated/ffi_verifier.dart:503-529 | pkg/analyzer/lib/src/generated/ffi_verifier.dart:2427-2450 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1320 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1320-1350 | pkg/dev_compiler/lib/src/js_ast/builder.dart:1352-1375 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/front_end/lib/src/type_inference/object_access_target.dart:1307 — pkg/front_end/lib/src/type_inference/object_access_target.dart:1307-1330 | pkg/front_end/lib/src/type_inference/object_access_target.dart:1332-1357 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:3470 — pkg/analyzer/lib/src/fasta/ast_builder.dart:3470-3493 | pkg/analyzer/lib/src/fasta/ast_builder.dart:4953-4977 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart:88 — pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart:88-111 | pkg/analysis_server/lib/src/lsp/handlers/handler_text_document_changes.dart:125-148 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:11860 — pkg/analyzer/lib/src/dart/ast/ast.dart:11860-11883 | pkg/analyzer/lib/src/dart/ast/ast.dart:12208-12231 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:2409 — pkg/compiler/lib/src/js/rewrite_async.dart:2409-2432 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:2595-2618 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×26
  • Edited copy of a member (3 corresponding lines) sdk/lib/collection/maps.dart:367 — sdk/lib/collection/maps.dart:367-369 | sdk/lib/io/platform_impl.dart:168-170 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:196 — sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:196-198 | sdk/lib/_internal/js_runtime/lib/js_patch.dart:310-312 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:33 — pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:33-35 | pkg/front_end/testcases/general/error_recovery/issue_26810.dart:40-42 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:230 — pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:230-232 | pkg/js_ast/lib/src/nodes.dart:1980-1982 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1356 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1356-1358 | pkg/compiler/lib/src/kernel/element_map_impl.dart:1039-1041 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:6856 — pkg/analyzer/lib/src/fasta/ast_builder.dart:6856-6858 | pkg/analyzer/tool/summary/mini_ast.dart:772-774 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:7340 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7340-7342 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8207-8209 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:7344 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7344-7346 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8211-8213 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/dwds/lib/src/services/proxy_service.dart:259 — pkg/dwds/lib/src/services/proxy_service.dart:259-261 | pkg/dwds/lib/src/services/web_socket/web_socket_proxy_service.dart:778-780 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/front_end/testcases/enhanced_enums/class_redirecting_initializer.dart:8 — pkg/front_end/testcases/enhanced_enums/class_redirecting_initializer.dart:8-10 | pkg/front_end/testcases/enhanced_enums/named_arguments_anywhere/issue48276.dart:8-10 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:818 — pkg/js_ast/lib/src/nodes.dart:818-820 | pkg/kernel/lib/src/ast/statements.dart:52-54 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:842 — pkg/js_ast/lib/src/nodes.dart:842-844 | pkg/kernel/lib/src/ast/statements.dart:194-196 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1309 — pkg/js_ast/lib/src/nodes.dart:1309-1311 | pkg/kernel/lib/src/ast/statements.dart:1519-1521 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1338 — pkg/js_ast/lib/src/nodes.dart:1338-1340 | pkg/kernel/lib/src/ast/statements.dart:316-318 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1966 — pkg/js_ast/lib/src/nodes.dart:1966-1968 | pkg/kernel/lib/src/ast/variables.dart:2477-2479 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/js_ast/lib/src/nodes.dart:2359 — pkg/js_ast/lib/src/nodes.dart:2359-2361 | pkg/kernel/lib/src/ast/expressions.dart:3666-3668 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:341 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:341-343 | sdk/lib/_internal/wasm/common/typed_data.dart:2099-2101 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:2214 — sdk/lib/_internal/wasm/common/typed_data.dart:2214-2216 | sdk/lib/collection/list.dart:322-324 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/constants/values.dart:1090 — pkg/compiler/lib/src/constants/values.dart:1090-1092 | pkg/kernel/lib/src/ast/expressions.dart:3392-3394 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/elements/types.dart:341 — pkg/compiler/lib/src/elements/types.dart:341-343 | pkg/kernel/lib/src/ast/types.dart:1334-1336 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/elements/types.dart:581 — pkg/compiler/lib/src/elements/types.dart:581-583 | pkg/kernel/lib/src/ast/types.dart:1207-1209 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/elements/types.dart:611 — pkg/compiler/lib/src/elements/types.dart:611-613 | pkg/kernel/lib/src/ast/types.dart:1125-1127 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/elements/types.dart:641 — pkg/compiler/lib/src/elements/types.dart:641-643 | pkg/kernel/lib/src/ast/types.dart:1080-1082 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/compiler/lib/src/elements/types.dart:880 — pkg/compiler/lib/src/elements/types.dart:880-882 | pkg/kernel/lib/src/ast/types.dart:1454-1456 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:1440 — pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:1440-1443 | pkg/analyzer/lib/src/fine/lookup_name.dart:74-76 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 1 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×26
  • Swallowed exception (empty catch) sdk/lib/html/html_common/device.dart:58 — 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) sdk/lib/_internal/wasm/js_common/js_string_convert.dart:47 — 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) sdk/lib/_internal/wasm/js_common/js_string_convert.dart:61 — 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) sdk/lib/_internal/wasm/js_common/js_string_convert.dart:70 — 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) sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:178 — 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) sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:187 — 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) sdk/lib/_internal/js_shared/lib/convert_utf_patch.dart:193 — 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) sdk/lib/_internal/js_runtime/lib/js_helper.dart:4073 — 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) sdk/lib/_internal/js_dev_runtime/private/debugger.dart:583 — 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) sdk/lib/_http/http_impl.dart:3843 — 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) pkg/vm/testcases/transformations/type_flow/transformer/loop_if_null.dart:92 — 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) pkg/testing/lib/src/zone_helper.dart:41 — 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) pkg/perf_witness/lib/recorder.dart:161 — 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) pkg/perf_witness/lib/recorder.dart:192 — 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) pkg/perf_witness/lib/recorder.dart:198 — 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) pkg/perf_witness/lib/recorder.dart:276 — 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) pkg/perf_witness/lib/recorder.dart:374 — 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) pkg/perf_witness/lib/server.dart:260 — 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) pkg/perf_witness/lib/src/json_rpc.dart:33 — 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) pkg/perf_witness/lib/src/json_rpc.dart:80 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `close()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
  • Swallowed exception (empty catch) pkg/observatory/lib/src/app/page.dart:530 — 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) pkg/mmap/lib/mmap.dart:91 — 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) pkg/kernel/lib/verifier.dart:109 — 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) pkg/frontend_server/lib/src/resident_frontend_server.dart:604 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) pkg/frontend_server/lib/src/resident_frontend_server.dart:610 — 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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×24
  • Edited copy of a member (25 corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2104 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2104-2128 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2130-2158 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/dart2js_info/lib/src/binary/sink.dart:385 — pkg/dart2js_info/lib/src/binary/sink.dart:385-409 | pkg/kernel/lib/binary/ast_to_binary.dart:3884-3908 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:381 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:381-407 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:424-448 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:557 — pkg/compiler/lib/src/js/rewrite_async.dart:557-581 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:517-541 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:1495 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1495-1519 | pkg/observatory/lib/src/elements/process_snapshot.dart:581-605 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/invert_conditional_expression.dart:23 — pkg/analysis_server/lib/src/services/correction/dart/invert_conditional_expression.dart:23-47 | pkg/analysis_server/lib/src/services/correction/dart/invert_if_statement.dart:23-52 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/front_end/lib/src/kernel/type_builder_computer.dart:156 — pkg/front_end/lib/src/kernel/type_builder_computer.dart:156-180 | pkg/front_end/lib/src/kernel/type_builder_computer.dart:182-207 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/linter/lib/src/rules/prefer_inlined_adds.dart:37 — pkg/linter/lib/src/rules/prefer_inlined_adds.dart:37-66 | pkg/linter/lib/src/rules/prefer_spread_collections.dart:34-58 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analyzer/lib/src/generated/error_verifier.dart:1979 — pkg/analyzer/lib/src/generated/error_verifier.dart:1979-2003 | pkg/analyzer/lib/src/generated/error_verifier.dart:2039-2064 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analyzer/lib/src/summary2/top_level_inference.dart:28 — pkg/analyzer/lib/src/summary2/top_level_inference.dart:28-52 | pkg/analyzer/lib/src/summary2/top_level_inference.dart:123-147 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:482 — sdk/lib/_internal/wasm/js_common/js_string.dart:482-507 | sdk/lib/_internal/wasm/js_common/js_string.dart:511-535 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analyzer/lib/src/dart/analysis/index.dart:1225 — pkg/analyzer/lib/src/dart/analysis/index.dart:1225-1251 | pkg/analyzer/lib/src/dart/analysis/index.dart:1291-1315 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2469 — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2469-2494 | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2496-2520 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:201 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:201-225 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:748-772 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/front_end/lib/src/fragment/field/declaration.dart:613 — pkg/front_end/lib/src/fragment/field/declaration.dart:613-637 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:399-425 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2429 — pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2429-2454 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3220-3244 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:235 — sdk/lib/_internal/vm/lib/growable_array.dart:235-261 | sdk/lib/_internal/wasm/common/list.dart:592-616 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/front_end/lib/src/base/messages.dart:61 — pkg/front_end/lib/src/base/messages.dart:61-87 | pkg/front_end/lib/src/source/source_library_builder.dart:966-990 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3201 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3201-3226 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9843-9867 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/kernel/lib/class_hierarchy.dart:133 — pkg/kernel/lib/class_hierarchy.dart:133-157 | pkg/kernel/lib/class_hierarchy.dart:159-190 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:143 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:143-167 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:408-433 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/analyzer/tool/generators/ast_generator.dart:413 — pkg/analyzer/tool/generators/ast_generator.dart:413-438 | pkg/analyzer/tool/generators/ast_generator.dart:440-464 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/vm/lib/modular/target/dart_runner.dart:16 — pkg/vm/lib/modular/target/dart_runner.dart:16-42 | pkg/vm/lib/modular/target/flutter.dart:16-40 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) tools/dom/scripts/prototype_htmleventgenerator.py:47 — tools/dom/scripts/prototype_htmleventgenerator.py:47-71 | tools/dom/scripts/prototype_htmleventgenerator.py:75-101 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×24
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/src/ast/types.dart:1362 — pkg/kernel/lib/src/ast/types.dart:1362-1371 | pkg/kernel/lib/src/ast/types.dart:1724-1733 | pkg/kernel/lib/src/ast/types.dart:1986-1995 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:578 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:578-588 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:604-613 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1150-1161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1729 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1729-1738 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1740-1749 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1751-1760 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/wasm/common/list.dart:232 — sdk/lib/_internal/wasm/common/list.dart:232-241 | sdk/lib/_internal/wasm/common/list.dart:339-348 | sdk/lib/_internal/wasm/common/list.dart:457-466 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/type_algebra.dart:964 — pkg/kernel/lib/type_algebra.dart:964-978 | pkg/kernel/lib/type_algebra.dart:1221-1230 | pkg/kernel/lib/type_algebra.dart:1315-1329 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/observatory/lib/src/repositories/editor.dart:28 — pkg/observatory/lib/src/repositories/editor.dart:28-37 | pkg/observatory/lib/src/repositories/editor.dart:39-48 | pkg/observatory/lib/src/repositories/editor.dart:50-59 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:556 — pkg/front_end/lib/src/kernel/internal_ast.dart:556-567 | pkg/kernel/lib/src/ast/variables.dart:2391-2400 | pkg/kernel/lib/src/ast/variables.dart:2424-2433 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/compiler/lib/src/js_model/closure.dart:1244 — pkg/compiler/lib/src/js_model/closure.dart:1244-1253 | pkg/compiler/lib/src/js_model/closure.dart:1310-1320 | pkg/compiler/lib/src/js_model/records.dart:391-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/front_end/lib/src/testing/id_testing_utils.dart:781 — pkg/front_end/lib/src/testing/id_testing_utils.dart:781-792 | pkg/front_end/lib/src/testing/id_testing_utils.dart:906-915 | pkg/front_end/lib/src/testing/id_testing_utils.dart:917-926 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:2017 — sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:2017-2026 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:2028-2037 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:2039-2048 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_array.dart:212 — sdk/lib/_internal/wasm/js_common/js_array.dart:212-222 | sdk/lib/_internal/wasm/js_common/js_array.dart:390-399 | sdk/lib/_internal/wasm/js_common/js_array.dart:401-410 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:304 — pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:304-315 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:317-328 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1825-1834 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/text/ast_to_text.dart:1793 — pkg/kernel/lib/text/ast_to_text.dart:1793-1805 | pkg/kernel/lib/text/ast_to_text.dart:2320-2329 | pkg/kernel/lib/text/ast_to_text.dart:2331-2340 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:1566 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:1566-1575 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1597-1606 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1618-1627 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/type_algebra.dart:1607 — pkg/kernel/lib/type_algebra.dart:1607-1620 | pkg/kernel/lib/type_algebra.dart:1622-1635 | pkg/kernel/lib/type_algebra.dart:1674-1683 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/observatory/lib/src/elements/local_var_descriptors_ref.dart:59 — pkg/observatory/lib/src/elements/local_var_descriptors_ref.dart:59-68 | pkg/observatory/lib/src/elements/pc_descriptors_ref.dart:53-62 | pkg/observatory/lib/src/elements/type_arguments_ref.dart:53-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/wasm_builder/lib/src/ir/global.dart:130 — pkg/wasm_builder/lib/src/ir/global.dart:130-139 | pkg/wasm_builder/lib/src/ir/memory.dart:127-136 | pkg/wasm_builder/lib/src/ir/tags.dart:97-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:11160 — pkg/analyzer/lib/src/dart/ast/ast.dart:11160-11169 | pkg/analyzer/lib/src/dart/ast/ast.dart:30128-30138 | pkg/analyzer/lib/src/dart/ast/ast.dart:30931-30941 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/vm/lib/isolate_patch.dart:619 — sdk/lib/_internal/vm/lib/isolate_patch.dart:619-628 | sdk/lib/_internal/vm/lib/isolate_patch.dart:651-660 | sdk/lib/_internal/vm/lib/isolate_patch.dart:662-676 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:3597 — pkg/kernel/lib/src/ast/expressions.dart:3597-3606 | pkg/kernel/lib/src/ast/expressions.dart:3608-3617 | pkg/kernel/lib/src/ast/statements.dart:1070-1080 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/io/directory_impl.dart:220 — sdk/lib/io/directory_impl.dart:220-229 | sdk/lib/io/file_impl.dart:367-380 | sdk/lib/io/link.dart:319-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sdk/lib/_internal/js_runtime/lib/core_patch.dart:508 — sdk/lib/_internal/js_runtime/lib/core_patch.dart:508-522 | sdk/lib/_internal/vm/lib/regexp_patch.dart:9-24 | sdk/lib/_internal/wasm/standalone/regexp_patch.dart:13-22 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/src/dart_type_equivalence.dart:300 — pkg/kernel/lib/src/dart_type_equivalence.dart:300-309 | pkg/kernel/lib/src/future_value_type.dart:127-136 | pkg/kernel/lib/src/merge_visitor.dart:501-510 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/kernel/lib/src/dart_type_equivalence.dart:311 — pkg/kernel/lib/src/dart_type_equivalence.dart:311-320 | pkg/kernel/lib/src/future_value_type.dart:138-147 | pkg/kernel/lib/src/merge_visitor.dart:512-521 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×23
  • Edited copies of one member (3 members, 14+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:341 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:341-355 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:665-688 | sdk/lib/_internal/wasm/js_compatibility/string_patch.dart:93-106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:3964 — pkg/kernel/lib/binary/ast_from_binary.dart:3964-3977 | pkg/kernel/lib/binary/ast_from_binary.dart:3979-3994 | pkg/kernel/lib/binary/ast_from_binary.dart:4132-4145 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analysis_server/lib/protocol/protocol.dart:178 — pkg/analysis_server/lib/protocol/protocol.dart:178-191 | pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:156-175 | pkg/analyzer_plugin/lib/protocol/protocol.dart:186-205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/observatory/lib/src/elements/eval_box.dart:145 — pkg/observatory/lib/src/elements/eval_box.dart:145-158 | pkg/observatory/lib/src/elements/eval_box.dart:160-175 | pkg/observatory/lib/src/elements/vm_connect.dart:123-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) sdk/lib/_internal/vm/lib/array.dart:163 — sdk/lib/_internal/vm/lib/array.dart:163-176 | sdk/lib/_internal/wasm/common/list.dart:270-283 | sdk/lib/_internal/wasm/common/list.dart:486-499 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1384 — pkg/analyzer/lib/src/generated/ffi_verifier.dart:1384-1404 | pkg/analyzer/lib/src/generated/ffi_verifier.dart:1643-1656 | pkg/analyzer/lib/src/generated/ffi_verifier.dart:2298-2311 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/vm/lib/transformations/type_flow/summary_collector.dart:3354 — pkg/vm/lib/transformations/type_flow/summary_collector.dart:3354-3367 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:3369-3384 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:3386-3399 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) runtime/tools/dartfuzz/dartfuzz.dart:165 — runtime/tools/dartfuzz/dartfuzz.dart:165-178 | runtime/tools/dartfuzz/dartfuzz.dart:242-261 | runtime/tools/dartfuzz/dartfuzz.dart:270-285 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) sdk/lib/io/data_transformer.dart:109 — sdk/lib/io/data_transformer.dart:109-122 | sdk/lib/io/data_transformer.dart:202-215 | sdk/lib/io/data_transformer.dart:296-309 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/front_end/lib/src/codes/type_labeler.dart:422 — pkg/front_end/lib/src/codes/type_labeler.dart:422-436 | pkg/front_end/lib/src/codes/type_labeler.dart:438-451 | pkg/front_end/lib/src/codes/type_labeler.dart:551-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:2636 — pkg/analyzer/lib/src/dart/constant/value.dart:2636-2649 | pkg/analyzer/lib/src/dart/constant/value.dart:2744-2759 | pkg/analyzer/lib/src/dart/constant/value.dart:3036-3049 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:381 — sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:381-394 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:434-447 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:475-490 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/summary2/informative_data.dart:820 — pkg/analyzer/lib/src/summary2/informative_data.dart:820-833 | pkg/analyzer/lib/src/summary2/informative_data.dart:867-885 | pkg/analyzer/lib/src/summary2/informative_data.dart:1168-1186 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) sdk/lib/async/zone.dart:903 — sdk/lib/async/zone.dart:903-916 | sdk/lib/async/zone.dart:918-934 | sdk/lib/async/zone.dart:936-950 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:83 — pkg/analyzer/lib/src/dart/constant/value.dart:83-96 | pkg/analyzer/lib/src/dart/constant/value.dart:3122-3135 | pkg/analyzer/lib/src/dart/constant/value.dart:3183-3196 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/testing/lib/src/log.dart:120 — pkg/testing/lib/src/log.dart:120-133 | pkg/testing/lib/src/log.dart:135-152 | pkg/testing/lib/src/log.dart:154-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/kernel/lib/type_algebra.dart:1072 — pkg/kernel/lib/type_algebra.dart:1072-1085 | pkg/kernel/lib/type_algebra.dart:1424-1437 | pkg/kernel/lib/type_algebra.dart:1736-1749 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/analysis/index.dart:954 — pkg/analyzer/lib/src/dart/analysis/index.dart:954-967 | pkg/analyzer/lib/src/dart/analysis/index.dart:1049-1062 | pkg/analyzer/lib/src/dart/analysis/index.dart:1180-1193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/kernel/lib/src/nnbd_top_merge.dart:57 — pkg/kernel/lib/src/nnbd_top_merge.dart:57-72 | pkg/kernel/lib/src/nnbd_top_merge.dart:74-87 | pkg/kernel/lib/src/nnbd_top_merge.dart:89-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1668 — pkg/vm/lib/transformations/type_flow/summary_collector.dart:1668-1681 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:1683-1696 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:1698-1711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/element/element.dart:5579 — pkg/analyzer/lib/src/dart/element/element.dart:5579-5593 | pkg/analyzer/lib/src/dart/element/element.dart:5595-5608 | pkg/analyzer/lib/src/dart/element/element.dart:5610-5624 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/element/element.dart:2389 — pkg/analyzer/lib/src/dart/element/element.dart:2389-2403 | pkg/analyzer/lib/src/dart/element/member.dart:581-594 | pkg/analyzer/lib/src/dart/element/type.dart:1571-1586 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/cfg/lib/front_end/recognized_methods.dart:128 — pkg/cfg/lib/front_end/recognized_methods.dart:128-141 | pkg/cfg/lib/front_end/recognized_methods.dart:146-159 | pkg/cfg/lib/front_end/recognized_methods.dart:167-181 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×21
  • Edited copies of one member (3 members, 15+ corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:99 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:99-113 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:332-347 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:426-440 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:197 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:197-213 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:766-784 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1227-1241 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/compiler/lib/src/util/maplet.dart:205 — pkg/compiler/lib/src/util/maplet.dart:205-219 | pkg/compiler/lib/src/util/setlet.dart:213-234 | pkg/compiler/lib/src/util/setlet.dart:247-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/observatory/lib/src/elements/cpu_profile.dart:48 — pkg/observatory/lib/src/elements/cpu_profile.dart:48-64 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:64-80 | pkg/observatory/lib/src/elements/native_memory_profiler.dart:45-59 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/vm_service/lib/src/vm_service.dart:4539 — pkg/vm_service/lib/src/vm_service.dart:4539-4553 | pkg/vm_service/lib/src/vm_service.dart:4782-4796 | pkg/vm_service/lib/src/vm_service.dart:4904-4920 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:779 — pkg/front_end/lib/src/kernel/internal_ast.dart:779-794 | pkg/front_end/lib/src/kernel/internal_ast.dart:5617-5632 | pkg/kernel/lib/src/ast/expressions.dart:3272-3286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/observatory/lib/src/elements/context_ref.dart:32 — pkg/observatory/lib/src/elements/context_ref.dart:32-46 | pkg/observatory/lib/src/elements/field_ref.dart:28-42 | pkg/observatory/lib/src/elements/instance_ref.dart:34-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:860 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:860-874 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:909-925 | sdk/lib/_internal/wasm/common/compact_hash.dart:832-848 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/analysis_server/tool/code_completion/code_metrics.dart:533 — pkg/analysis_server/tool/code_completion/code_metrics.dart:533-549 | pkg/analysis_server/tool/code_completion/code_metrics.dart:989-1003 | pkg/analysis_server/tool/code_completion/code_metrics.dart:1071-1087 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:4453 — pkg/kernel/lib/binary/ast_from_binary.dart:4453-4470 | pkg/kernel/lib/binary/ast_from_binary.dart:4472-4486 | pkg/kernel/lib/binary/ast_from_binary.dart:4488-4502 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:520 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:520-534 | sdk/lib/_internal/js_runtime/lib/js_array.dart:706-720 | sdk/lib/_internal/wasm/js_common/js_array.dart:456-470 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:258 — pkg/front_end/lib/src/kernel/internal_ast.dart:258-272 | pkg/front_end/lib/src/kernel/internal_ast.dart:7545-7559 | pkg/front_end/lib/src/kernel/internal_ast.dart:8386-8402 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1220 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1220-1239 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3495-3509 | pkg/analyzer/lib/src/fasta/ast_builder.dart:4860-4876 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/front_end/lib/src/codes/type_labeler.dart:498 — pkg/front_end/lib/src/codes/type_labeler.dart:498-514 | pkg/front_end/lib/src/codes/type_labeler.dart:516-530 | pkg/front_end/lib/src/codes/type_labeler.dart:532-549 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/dartdev/lib/src/core.dart:83 — pkg/dartdev/lib/src/core.dart:83-97 | pkg/dartdev/lib/src/core.dart:116-130 | pkg/dartdev/lib/src/core.dart:132-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:233 — pkg/analyzer/lib/src/error/type_arguments_verifier.dart:233-250 | pkg/analyzer/lib/src/error/type_arguments_verifier.dart:252-266 | pkg/analyzer/lib/src/error/type_arguments_verifier.dart:278-292 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/cfg/lib/passes/simplification.dart:593 — pkg/cfg/lib/passes/simplification.dart:593-607 | pkg/cfg/lib/passes/simplification.dart:673-687 | pkg/cfg/lib/passes/simplification.dart:689-703 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/front_end/lib/src/source/source_method_builder.dart:263 — pkg/front_end/lib/src/source/source_method_builder.dart:263-277 | pkg/front_end/lib/src/source/source_property_builder.dart:399-413 | pkg/front_end/lib/src/source/source_property_builder.dart:417-431 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/analyzer/lib/src/fine/requirements.dart:2121 — pkg/analyzer/lib/src/fine/requirements.dart:2121-2135 | pkg/analyzer/lib/src/fine/requirements.dart:2217-2233 | pkg/analyzer/lib/src/fine/requirements.dart:2235-2251 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:239 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:239-253 | pkg/front_end/tool/fuzz/analyzer_helper.dart:481-498 | pkg/front_end/tool/fuzz/analyzer_helper.dart:500-515 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:701 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:701-719 | sdk/lib/_internal/js_runtime/lib/js_array.dart:912-929 | sdk/lib/internal/iterable.dart:361-375 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×20
  • Edited copy of a member (31 corresponding lines) pkg/wasm_builder/lib/src/ir/type.dart:763 — pkg/wasm_builder/lib/src/ir/type.dart:763-808 | pkg/wasm_builder/lib/src/ir/type.dart:810-857 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/dart2wasm/lib/constants.dart:647 — pkg/dart2wasm/lib/constants.dart:647-681 | pkg/dart2wasm/lib/constants.dart:683-713 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/front_end/testcases/inference/infer_assign_to_index_full.dart:26 — pkg/front_end/testcases/inference/infer_assign_to_index_full.dart:26-59 | pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart:26-56 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:559 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:559-589 | sdk/lib/_internal/wasm/common/compact_hash.dart:524-554 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:502 — pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:502-541 | pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:543-573 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/analysis_server/lib/src/services/correction/fix/data_driven/add_type_parameter.dart:104 — pkg/analysis_server/lib/src/services/correction/fix/data_driven/add_type_parameter.dart:104-134 | pkg/analysis_server/lib/src/services/correction/fix/data_driven/add_type_parameter.dart:136-176 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/compiler/lib/src/ssa/codegen.dart:1790 — pkg/compiler/lib/src/ssa/codegen.dart:1790-1820 | pkg/compiler/lib/src/ssa/codegen.dart:1822-1853 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/observatory/lib/src/elements/script_view.dart:49 — pkg/observatory/lib/src/elements/script_view.dart:49-79 | pkg/observatory/lib/src/elements/singletargetcache_view.dart:46-77 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:125 — pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:125-155 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:177-207 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/dart2bytecode/lib/bytecode_generator.dart:3197 — pkg/dart2bytecode/lib/bytecode_generator.dart:3197-3227 | pkg/dart2bytecode/lib/bytecode_generator.dart:3253-3289 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/compiler/lib/src/js_model/env.dart:703 — pkg/compiler/lib/src/js_model/env.dart:703-734 | pkg/compiler/lib/src/kernel/env.dart:547-577 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/wasm_builder/lib/src/ir/element.dart:50 — pkg/wasm_builder/lib/src/ir/element.dart:50-80 | pkg/wasm_builder/lib/src/ir/element.dart:112-148 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/observatory/lib/src/debugger/debugger_location.dart:144 — pkg/observatory/lib/src/debugger/debugger_location.dart:144-174 | pkg/observatory/lib/src/debugger/debugger_location.dart:199-229 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:494 — pkg/dev_compiler/lib/src/kernel/compiler.dart:494-524 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:722-758 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:5280 — pkg/front_end/lib/src/kernel/body_builder.dart:5280-5311 | pkg/front_end/lib/src/source/outline_builder.dart:3801-3831 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/dart2native/lib/macho.dart:736 — pkg/dart2native/lib/macho.dart:736-771 | pkg/dart2native/lib/macho.dart:1299-1329 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/front_end/lib/src/source/outline_builder.dart:1623 — pkg/front_end/lib/src/source/outline_builder.dart:1623-1654 | pkg/front_end/lib/src/source/outline_builder.dart:1713-1743 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/analyzer/lib/src/fine/manifest_item.dart:677 — pkg/analyzer/lib/src/fine/manifest_item.dart:677-707 | pkg/analyzer/lib/src/fine/manifest_item.dart:735-766 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:12388 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:12388-12431 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:12433-12463 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:12245 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:12245-12279 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:12356-12386 — 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 · Duplicated block (21 lines × 2) · ×20
  • Duplicated block (21 lines × 2) pkg/analyzer/lib/src/dart/analysis/results.dart:354 — pkg/analyzer/lib/src/dart/analysis/results.dart:354-374 | pkg/analyzer/lib/src/dart/analysis/results.dart:511-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/analysis/results.dart:354` 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 (21 lines × 2) pkg/analyzer/lib/src/dart/ast/utilities.dart:145 — pkg/analyzer/lib/src/dart/ast/utilities.dart:145-165 | pkg/analyzer/lib/src/dart/ast/utilities.dart:294-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 `pkg/analyzer/lib/src/dart/ast/utilities.dart:145` 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 (21 lines × 2) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2106 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2106-2126 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2134-2154 — both copies are in the same file, so extract the 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 `node` to `covariant AssertInitializerImpl` in one and `covariant AssertStatementImpl` 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 (21 lines × 2) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:446 — pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:446-466 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:755-775 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ClassDeclaration` in one and `ExtensionTypeDeclaration` 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 (21 lines × 2) pkg/compiler/lib/src/inferrer/builder.dart:372 — pkg/compiler/lib/src/inferrer/builder.dart:372-392 | pkg/compiler/lib/src/inferrer/builder.dart:396-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ir.SuperInitializer` in one and `ir.RedirectingInitializer` 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 (21 lines × 2) pkg/compiler/lib/src/js/placeholder_safety.dart:230 — pkg/compiler/lib/src/js/placeholder_safety.dart:230-250 | pkg/compiler/lib/src/native/js.dart:256-276 — 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 `pkg/compiler/lib/src/js/placeholder_safety.dart:230` it does not close everything it opens, so those 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, `pkg/compiler/lib/src/native/js.dart:254` calls `visit` and `pkg/compiler/lib/src/js/placeholder_safety.dart:229` 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 (21 lines × 2) pkg/compiler/lib/src/js/size_estimator.dart:902 — pkg/compiler/lib/src/js/size_estimator.dart:902-922 | pkg/js_ast/lib/src/printer.dart:1289-1309 — before extracting anything, compare `pkg/compiler/lib/src/js/size_estimator.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 154 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) pkg/dart2wasm/lib/transformers.dart:1425 — pkg/dart2wasm/lib/transformers.dart:1425-1445 | pkg/dart2wasm/lib/transformers.dart:1498-1518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/transformers.dart:1425` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4576 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4576-4596 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5178-5198 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (21 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4825 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4825-4845 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5435-5455 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (21 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5495 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5495-5515 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6105-6125 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (21 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8045 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8045-8065 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8914-8934 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (21 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8490 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8490-8510 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9441-9461 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (21 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:10199 — pkg/front_end/lib/src/kernel/body_builder.dart:10199-10219 | pkg/front_end/lib/src/kernel/body_builder.dart:10293-10313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:10199` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/source/outline_builder.dart:2138 — pkg/front_end/lib/src/source/outline_builder.dart:2138-2158 | pkg/front_end/lib/src/source/outline_builder.dart:2161-2181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/outline_builder.dart:2138` 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 (21 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4958 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:4958-4978 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5079-5099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:4958` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ForElement` in one and `PatternForElement` 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 (21 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:687 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:687-707 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:690-710 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 (21 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:25 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:25-45 | sdk/lib/_internal/js_runtime/lib/js_number.dart:35-55 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_runtime/lib/js_number.dart:35` 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 × 2) pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib1.dart:8 — pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib1.dart:8-28 | pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib2.dart:8-28 — before extracting anything, compare `pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib1.dart` and `pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib2.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/general/with_dependencies/mixin_from_dill/mixin_from_dill_lib1.dart:8` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) pkg/compiler/tool/modular_test_suite_helper.dart:518 — pkg/compiler/tool/modular_test_suite_helper.dart:518-538 | pkg/compiler/tool/modular_test_suite_helper.dart:583-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/tool/modular_test_suite_helper.dart:518` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×20
  • Duplicated block (10 lines × 3) pkg/analyzer/lib/src/dart/element/subtype.dart:437 — pkg/analyzer/lib/src/dart/element/subtype.dart:437-446 | pkg/analyzer/lib/src/dart/element/subtype.dart:465-474 | pkg/analyzer/lib/src/dart/element/subtype.dart:490-500 — 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 (10 lines × 3) pkg/observatory/lib/src/elements/class_allocation_profile.dart:127 — pkg/observatory/lib/src/elements/class_allocation_profile.dart:127-136 | pkg/observatory/lib/src/elements/cpu_profile.dart:161-170 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:481-490 — 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 `pkg/observatory/lib/src/elements/class_allocation_profile.dart:127` 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 × 3) pkg/observatory/lib/src/elements/field_view.dart:190 — pkg/observatory/lib/src/elements/field_view.dart:190-199 | pkg/observatory/lib/src/elements/function_view.dart:173-182 | pkg/observatory/lib/src/elements/instance_view.dart:188-197 — before extracting anything, compare `pkg/observatory/lib/src/elements/field_view.dart` and `pkg/observatory/lib/src/elements/function_view.dart` 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 `pkg/observatory/lib/src/elements/field_view.dart:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:411 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:411-420 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:414-423 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:483-492 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:411` 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 (10 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:656 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:656-665 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:659-668 | sdk/lib/_internal/wasm/common/errors_patch.dart:177-186 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart` and `sdk/lib/_internal/js_runtime/lib/core_patch.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 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) sdk/lib/_internal/vm/lib/convert_patch.dart:1402 — sdk/lib/_internal/vm/lib/convert_patch.dart:1402-1411 | sdk/lib/_internal/wasm/common/convert_patch.dart:1588-1597 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1280-1289 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1402` it does not close everything it opens, so those 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 (10 lines × 3) sdk/lib/_internal/vm/lib/typed_data_patch.dart:290 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:290-299 | sdk/lib/_internal/wasm/common/typed_data.dart:1989-1998 | sdk/lib/_internal/wasm/common/typed_data.dart:2344-2353 — before extracting anything, compare `sdk/lib/_internal/vm/lib/typed_data_patch.dart` and `sdk/lib/_internal/wasm/common/typed_data.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 143 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 `sdk/lib/_internal/vm/lib/typed_data_patch.dart:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) sdk/lib/_internal/wasm/common/typed_data.dart:990 — sdk/lib/_internal/wasm/common/typed_data.dart:990-999 | sdk/lib/_internal/wasm/common/typed_data.dart:1052-1061 | sdk/lib/_internal/wasm/common/typed_data.dart:1098-1107 — 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 `sdk/lib/_internal/wasm/common/typed_data.dart:990` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:517 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:517-526 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:602-611 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:850-859 — 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 `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:517` 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 `fragment` to `ClassFragmentImpl` in one and `EnumFragmentImpl` 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 (10 lines × 3) pkg/front_end/testcases/general/covariant_field.dart:19 — pkg/front_end/testcases/general/covariant_field.dart:19-28 | pkg/front_end/testcases/late_lowering/covariant_late_field.dart:19-28 | pkg/front_end/testcases/nnbd/covariant_late_field.dart:19-28 — `pkg/front_end/testcases/general/covariant_field.dart` and `pkg/front_end/testcases/late_lowering/covariant_late_field.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 10 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 `pkg/front_end/testcases/general/covariant_field.dart:19` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 3) pkg/linter/lib/src/rules/avoid_setters_without_getters.dart:25 — pkg/linter/lib/src/rules/avoid_setters_without_getters.dart:25-35 | pkg/linter/lib/src/rules/sort_constructors_first.dart:23-32 | pkg/linter/lib/src/rules/sort_unnamed_constructors_first.dart:27-36 — 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 × 3) sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart:394 — sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart:394-403 | sdk/lib/_internal/js_runtime/lib/developer_patch.dart:363-372 | sdk/lib/_internal/wasm/standalone/developer_patch.dart:59-68 — 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 (10 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:57 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:57-66 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:53-62 | sdk/lib/_internal/wasm/common/io_patch.dart:53-62 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:476 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:476-485 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:472-481 | sdk/lib/_internal/wasm/common/io_patch.dart:472-481 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:490 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:490-499 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:486-495 | sdk/lib/_internal/wasm/common/io_patch.dart:486-495 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:504 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:504-513 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:500-509 | sdk/lib/_internal/wasm/common/io_patch.dart:500-509 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:528 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:528-537 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:524-533 | sdk/lib/_internal/wasm/common/io_patch.dart:524-533 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:655 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:655-664 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:651-660 | sdk/lib/_internal/wasm/common/io_patch.dart:651-660 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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) pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:78 — pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:78-88 | pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart:96-105 | pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart:100-109 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart` and `pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 (10 lines × 3) pkg/test_runner/lib/src/browser_controller.dart:1091 — pkg/test_runner/lib/src/browser_controller.dart:1091-1100 | pkg/test_runner/lib/src/browser_controller.dart:1205-1214 | pkg/test_runner/lib/src/browser_controller.dart:1230-1242 — 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 `pkg/test_runner/lib/src/browser_controller.dart:1091` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×20
  • Duplicated block (9 lines × 3) pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242 — pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242-250 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:497-505 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:581-589 — before extracting anything, compare `pkg/analysis_server/lib/src/protocol/protocol_internal.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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 `pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242` it does not close everything it opens, so those 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 × 3) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:65 — pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:65-73 | pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:91-99 | pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:107-115 — 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 `pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart: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 (9 lines × 3) pkg/front_end/tool/coverage_merger.dart:1166 — pkg/front_end/tool/coverage_merger.dart:1166-1174 | pkg/front_end/tool/coverage_merger.dart:1236-1244 | pkg/front_end/tool/coverage_merger.dart:1265-1273 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `TopLevelFieldsEnd` in one and `BeginAndEndTokenParserAstNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) pkg/native_compiler/lib/back_end/arm64/assembler.dart:718 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:718-726 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:747-755 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:796-804 — 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 `pkg/native_compiler/lib/back_end/arm64/assembler.dart:718` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) pkg/observatory/lib/src/elements/isolate_reconnect.dart:75 — pkg/observatory/lib/src/elements/isolate_reconnect.dart:75-83 | pkg/observatory/lib/src/elements/json_view.dart:57-65 | pkg/observatory/lib/src/elements/vm_connect.dart:62-70 — 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 `pkg/observatory/lib/src/elements/isolate_reconnect.dart:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) pkg/front_end/testcases/dart2js/extension_types/issue51285.dart:6 — pkg/front_end/testcases/dart2js/extension_types/issue51285.dart:6-14 | pkg/front_end/testcases/dartdevc/extension_types/issue51285.dart:6-14 | pkg/front_end/testcases/extension_types/issue51285.dart:6-14 — before extracting anything, compare `pkg/front_end/testcases/dart2js/extension_types/issue51285.dart` and `pkg/front_end/testcases/dartdevc/extension_types/issue51285.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/dart2js/extension_types/issue51285.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/replace_container_with_sized_box.dart:25-33 | pkg/analysis_server/lib/src/services/correction/dart/replace_null_with_void.dart:25-33 | pkg/analysis_server/lib/src/services/correction/dart/replace_var_with_dynamic.dart:23-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) pkg/analysis_server/lib/src/status/pages/ast_page.dart:52 — pkg/analysis_server/lib/src/status/pages/ast_page.dart:52-60 | pkg/analysis_server/lib/src/status/pages/contents_page.dart:64-72 | pkg/analysis_server/lib/src/status/pages/element_model_page.dart:65-73 — 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 (9 lines × 3) pkg/analyzer/lib/file_system/memory_file_system.dart:452 — pkg/analyzer/lib/file_system/memory_file_system.dart:452-460 | pkg/analyzer/lib/file_system/overlay_file_system.dart:263-271 | pkg/analyzer/lib/file_system/physical_file_system.dart:232-240 — 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. 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 × 3) pkg/analyzer/lib/src/error/best_practices_verifier.dart:2237 — pkg/analyzer/lib/src/error/best_practices_verifier.dart:2237-2245 | pkg/analyzer/lib/src/error/element_usage_detector.dart:419-427 | pkg/analyzer/lib/src/error/element_usage_detector.dart:904-912 — 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. 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, `pkg/analyzer/lib/src/error/element_usage_detector.dart:429` calls `_simpleIdentifier`, `checkUsage` and `pkg/analyzer/lib/src/error/element_usage_detector.dart:914` 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) pkg/compiler/lib/src/inferrer/map_tracer.dart:69 — pkg/compiler/lib/src/inferrer/map_tracer.dart:69-77 | pkg/compiler/lib/src/inferrer/record_tracer.dart:30-38 | pkg/compiler/lib/src/inferrer/set_tracer.dart:92-100 — 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 (9 lines × 3) pkg/front_end/lib/src/fragment/enum_element.dart:625 — pkg/front_end/lib/src/fragment/enum_element.dart:625-634 | pkg/front_end/lib/src/fragment/field/class_member.dart:46-54 | pkg/front_end/lib/src/source/source_enum_builder.dart:924-933 — before extracting anything, compare `pkg/front_end/lib/src/fragment/enum_element.dart` and `pkg/front_end/lib/src/source/source_enum_builder.dart` as WHOLE FILES: this scan already matched 7 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. 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 × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:458 — pkg/front_end/lib/src/fragment/getter/encoding.dart:458-466 | pkg/front_end/lib/src/fragment/method/encoding.dart:428-436 | pkg/front_end/lib/src/fragment/setter/encoding.dart:478-486 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 3) pkg/linter/lib/src/rules/avoid_return_types_on_setters.dart:27 — pkg/linter/lib/src/rules/avoid_return_types_on_setters.dart:27-35 | pkg/linter/lib/src/rules/avoid_void_async.dart:26-34 | pkg/linter/lib/src/rules/recursive_getters.dart:24-32 — 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 (9 lines × 3) pkg/linter/lib/src/rules/avoid_unused_constructor_parameters.dart:32 — pkg/linter/lib/src/rules/avoid_unused_constructor_parameters.dart:32-40 | pkg/linter/lib/src/rules/matching_super_parameters.dart:24-32 | pkg/linter/lib/src/rules/prefer_const_constructors_in_immutables.dart:30-38 — 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 (9 lines × 3) pkg/linter/lib/src/rules/omit_obvious_property_types.dart:37 — pkg/linter/lib/src/rules/omit_obvious_property_types.dart:37-45 | pkg/linter/lib/src/rules/specify_nonobvious_property_types.dart:36-44 | pkg/linter/lib/src/rules/unnecessary_late.dart:23-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:515 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:515-523 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:511-519 | sdk/lib/_internal/wasm/common/io_patch.dart:511-519 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (9 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:539 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:539-547 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:535-543 | sdk/lib/_internal/wasm/common/io_patch.dart:535-543 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (9 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:729 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:729-737 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:725-733 | sdk/lib/_internal/wasm/common/io_patch.dart:725-733 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (9 lines × 3) pkg/kernel/lib/src/ast/expressions.dart:172 — pkg/kernel/lib/src/ast/expressions.dart:172-180 | pkg/kernel/lib/src/ast/types.dart:202-210 | pkg/kernel/lib/src/ast/types.dart:319-327 — before extracting anything, compare `pkg/kernel/lib/src/ast/expressions.dart` and `pkg/kernel/lib/src/ast/types.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 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 (35 corresponding lines) · ×19
  • Edited copy of a member (35 corresponding lines) pkg/dartdev/lib/src/processes.dart:20 — pkg/dartdev/lib/src/processes.dart:20-54 | pkg/dartdev/lib/src/processes.dart:56-94 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:181 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:181-237 | pkg/front_end/tool/fuzz/analyzer_helper.dart:421-455 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/dart2bytecode/lib/declarations.dart:163 — pkg/dart2bytecode/lib/declarations.dart:163-197 | pkg/dart2bytecode/lib/declarations.dart:449-490 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/dev_compiler/lib/src/compiler/module_builder.dart:296 — pkg/dev_compiler/lib/src/compiler/module_builder.dart:296-339 | pkg/dev_compiler/lib/src/compiler/module_builder.dart:475-509 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2309 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2309-2349 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1816-1850 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:54750 — pkg/analyzer/lib/src/dart/ast/ast.dart:54750-54792 | pkg/analyzer/lib/src/dart/ast/ast.dart:54794-54828 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:472 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:472-506 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1129-1170 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart:72 — pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart:72-106 | pkg/dds/lib/src/devtools/vs_code.dart:70-109 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3129 — pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3129-3171 | pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:449-483 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart:214 — pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart:214-248 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_hierarchy.dart:51-85 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/front_end/lib/src/fragment/field/encoding.dart:373 — pkg/front_end/lib/src/fragment/field/encoding.dart:373-408 | pkg/front_end/lib/src/fragment/field/encoding.dart:438-472 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/compiler/lib/src/js_backend/enqueuer.dart:158 — pkg/compiler/lib/src/js_backend/enqueuer.dart:158-192 | pkg/compiler/lib/src/resolution/enqueuer.dart:169-206 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:3769 — pkg/kernel/lib/binary/ast_from_binary.dart:3769-3803 | pkg/kernel/lib/binary/ast_from_binary.dart:3996-4031 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:254 — pkg/front_end/lib/src/kernel/expression_generator.dart:254-288 | pkg/front_end/lib/src/kernel/expression_generator.dart:7425-7462 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateless_widget.dart:29 — pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateless_widget.dart:29-64 | pkg/analysis_server/lib/src/services/snippets/dart/main_function.dart:29-63 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/compiler/lib/src/ssa/codegen.dart:160 — pkg/compiler/lib/src/ssa/codegen.dart:160-194 | pkg/compiler/lib/src/ssa/codegen.dart:196-232 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:150 — pkg/dev_compiler/lib/src/js_ast/printer.dart:150-184 | pkg/js_ast/lib/src/printer.dart:198-235 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/kernel/lib/target/targets.dart:734 — pkg/kernel/lib/target/targets.dart:734-768 | pkg/kernel/lib/target/targets.dart:770-804 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:361 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:361-403 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:704-738 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×19
  • Duplicated block (25 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1667 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1667-1691 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1022-1046 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 before the matched lines, `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1017` calls `tokenizeCaret` and `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1664` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (25 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:24241 — pkg/analyzer/lib/src/dart/ast/ast.dart:24241-24265 | pkg/analyzer/lib/src/dart/ast/ast.dart:52569-52593 — both copies are in the same file, so extract the 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) pkg/compiler/lib/src/js_model/element_map_impl.dart:772 — pkg/compiler/lib/src/js_model/element_map_impl.dart:772-796 | pkg/compiler/lib/src/kernel/element_map_impl.dart:442-466 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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 `pkg/compiler/lib/src/js_model/element_map_impl.dart:772` 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 (25 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7398 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7398-7422 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8265-8289 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7398` it does not close everything it opens, so those 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 (25 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7716 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7716-7740 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8583-8607 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7920 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7920-7944 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8786-8810 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (25 lines × 2) pkg/front_end/lib/src/fragment/constructor/encoding.dart:1253 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:1253-1277 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1293-1317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (25 lines × 2) pkg/front_end/lib/src/fragment/field/encoding.dart:1596 — pkg/front_end/lib/src/fragment/field/encoding.dart:1596-1620 | pkg/front_end/lib/src/fragment/field/encoding.dart:2136-2160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/field/encoding.dart:1596` 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 (25 lines × 2) pkg/front_end/lib/src/fragment/getter/encoding.dart:286 — pkg/front_end/lib/src/fragment/getter/encoding.dart:286-310 | pkg/front_end/lib/src/fragment/getter/encoding.dart:586-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/getter/encoding.dart:286` 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 (25 lines × 2) pkg/front_end/lib/src/fragment/getter/encoding.dart:330 — pkg/front_end/lib/src/fragment/getter/encoding.dart:330-354 | pkg/front_end/lib/src/fragment/getter/encoding.dart:630-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/getter/encoding.dart: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 (25 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:2641 — pkg/front_end/lib/src/kernel/body_builder.dart:2641-2665 | pkg/front_end/lib/src/kernel/body_builder.dart:2691-2715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:2641` 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 (25 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_index_super.dart:28 — pkg/front_end/testcases/inference/infer_assign_to_index_super.dart:28-52 | pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart:28-52 — `pkg/front_end/testcases/inference/infer_assign_to_index_super.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart` 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 2 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (25 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_index_this.dart:26 — pkg/front_end/testcases/inference/infer_assign_to_index_this.dart:26-50 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart:26-50 — `pkg/front_end/testcases/inference/infer_assign_to_index_this.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart` 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 2 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (25 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:711 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:711-735 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:714-738 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 (25 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:28 — sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:28-52 | sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:62-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart:28` 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 (25 lines × 2) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:740 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:740-764 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:955-979 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 295 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 `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart: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.
  • Duplicated block (25 lines × 2) sdk/lib/_internal/vm/lib/integers.dart:219 — sdk/lib/_internal/vm/lib/integers.dart:219-243 | sdk/lib/_internal/wasm/common/boxed_int.dart:187-211 — before extracting anything, compare `sdk/lib/_internal/vm/lib/integers.dart` and `sdk/lib/_internal/wasm/common/boxed_int.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/vm/lib/integers.dart: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 (25 lines × 2) pkg/dart2wasm/lib/map_factory_specializer.dart:18 — pkg/dart2wasm/lib/map_factory_specializer.dart:18-42 | pkg/vm/lib/modular/specializer/map_factory_specializer.dart:18-43 — before extracting anything, compare `pkg/dart2wasm/lib/map_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/map_factory_specializer.dart` 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. 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) pkg/dart2wasm/lib/set_factory_specializer.dart:19 — pkg/dart2wasm/lib/set_factory_specializer.dart:19-43 | pkg/vm/lib/modular/specializer/set_factory_specializer.dart:19-44 — before extracting anything, compare `pkg/dart2wasm/lib/set_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/set_factory_specializer.dart` 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. 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 · Duplicated block (23 lines × 2) · ×19
  • Duplicated block (23 lines × 2) pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:74 — pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:74-96 | pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:182-204 — both copies are in the same file, so extract the 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 (23 lines × 2) pkg/analyzer/lib/src/fine/requirements.dart:2742 — pkg/analyzer/lib/src/fine/requirements.dart:2742-2764 | pkg/analyzer/lib/src/fine/requirements.dart:2783-2805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fine/requirements.dart:2742` 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 lines × 2) pkg/compiler/lib/src/js_model/env.dart:712 — pkg/compiler/lib/src/js_model/env.dart:712-734 | pkg/compiler/lib/src/kernel/env.dart:555-577 — 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 `pkg/compiler/lib/src/js_model/env.dart:712` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `elementMap` to `covariant JsKernelToElementMap` in one and `covariant KernelToElementMap` 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 (23 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:11089 — pkg/front_end/lib/src/kernel/body_builder.dart:11089-11111 | pkg/front_end/lib/src/kernel/body_builder.dart:11116-11138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) pkg/front_end/lib/src/kernel/collections.dart:136 — pkg/front_end/lib/src/kernel/collections.dart:136-158 | pkg/front_end/lib/src/kernel/internal_ast.dart:7895-7917 — before extracting anything, compare `pkg/front_end/lib/src/kernel/collections.dart` and `pkg/front_end/lib/src/kernel/internal_ast.dart` 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 `pkg/front_end/lib/src/kernel/collections.dart: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.
  • Duplicated block (23 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/class_member.dart:636 — pkg/front_end/lib/src/kernel/hierarchy/class_member.dart:636-658 | pkg/front_end/lib/src/kernel/hierarchy/class_member.dart:1042-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/class_member.dart:636` 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 (23 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:125 — pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:125-147 | pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:154-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:178` calls `Function` and `pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:149` 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 (23 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_implicit_this_upwards.dart:36 — pkg/front_end/testcases/inference/infer_assign_to_implicit_this_upwards.dart:36-58 | pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this_upwards.dart:32-54 — `pkg/front_end/testcases/inference/infer_assign_to_implicit_this_upwards.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this_upwards.dart` 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 2 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (23 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_property_super_upwards.dart:35 — pkg/front_end/testcases/inference/infer_assign_to_property_super_upwards.dart:35-57 | pkg/front_end/testcases/inference_new/infer_assign_to_property_super_upwards.dart:35-57 — `pkg/front_end/testcases/inference/infer_assign_to_property_super_upwards.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_property_super_upwards.dart` 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 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (23 lines × 2) sdk/lib/_internal/vm/lib/async_patch.dart:612 — sdk/lib/_internal/vm/lib/async_patch.dart:612-634 | sdk/lib/_internal/wasm/common/sync_star_patch.dart:137-159 — 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 `sdk/lib/_internal/vm/lib/async_patch.dart:612` 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 lines × 2) sdk/lib/_internal/vm/lib/double.dart:340 — sdk/lib/_internal/vm/lib/double.dart:340-362 | sdk/lib/_internal/wasm/common/boxed_double.dart:342-364 — 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 `sdk/lib/_internal/vm/lib/double.dart:340` it does not close everything it opens, so those 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 (23 lines × 2) sdk/lib/_internal/wasm/js/string_patch.dart:126 — sdk/lib/_internal/wasm/js/string_patch.dart:126-148 | sdk/lib/_internal/wasm/standalone/string_patch.dart:86-108 — `sdk/lib/_internal/wasm/js/string_patch.dart` and `sdk/lib/_internal/wasm/standalone/string_patch.dart` 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 7 separate duplicated blocks between them, totalling at least 131 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 `sdk/lib/_internal/wasm/js/string_patch.dart: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. 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 (23 lines × 2) pkg/front_end/testcases/dart2js/tear_off_patch/patch_lib.dart:10 — pkg/front_end/testcases/dart2js/tear_off_patch/patch_lib.dart:10-32 | pkg/front_end/testcases/general/tear_off_patch/patch_lib.dart:10-32 — before extracting anything, compare `pkg/front_end/testcases/dart2js/tear_off_patch/patch_lib.dart` and `pkg/front_end/testcases/general/tear_off_patch/patch_lib.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/dart2js/tear_off_patch/patch_lib.dart:10` 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) pkg/front_end/testcases/general/hierarchy/abstract_extends_getter.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_extends_getter.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_extends_getter.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_extends_getter.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_extends_getter.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_extends_getter.dart:6` 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) pkg/front_end/testcases/general/hierarchy/abstract_extends_method.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_extends_method.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_extends_method.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_extends_method.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_extends_method.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_extends_method.dart:6` 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) pkg/front_end/testcases/general/hierarchy/abstract_extends_setter.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_extends_setter.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_extends_setter.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_extends_setter.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_extends_setter.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_extends_setter.dart:6` 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) pkg/front_end/testcases/general/hierarchy/abstract_implements_getter.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_implements_getter.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_implements_getter.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_implements_getter.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_implements_getter.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_implements_getter.dart:6` 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) pkg/front_end/testcases/general/hierarchy/abstract_implements_method.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_implements_method.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_implements_method.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_implements_method.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_implements_method.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_implements_method.dart:6` 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) pkg/front_end/testcases/general/hierarchy/abstract_implements_setter.dart:6 — pkg/front_end/testcases/general/hierarchy/abstract_implements_setter.dart:6-28 | pkg/front_end/testcases/general/hierarchy/concrete_implements_setter.dart:6-28 — before extracting anything, compare `pkg/front_end/testcases/general/hierarchy/abstract_implements_setter.dart` and `pkg/front_end/testcases/general/hierarchy/concrete_implements_setter.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/general/hierarchy/abstract_implements_setter.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×18
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:93 — pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:93-117 | pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:201-216 | pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:266-282 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:159 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:159-178 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:733-748 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1200-1215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analyzer/lib/src/dart/analysis/search.dart:309 — pkg/analyzer/lib/src/dart/analysis/search.dart:309-324 | pkg/analyzer/lib/src/dart/analysis/search.dart:406-422 | pkg/analyzer/lib/src/dart/analysis/search.dart:424-439 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/vm/lib/modular/transformations/ffi/finalizable.dart:113 — pkg/vm/lib/modular/transformations/ffi/finalizable.dart:113-128 | pkg/vm/lib/modular/transformations/ffi/finalizable.dart:130-146 | pkg/vm/lib/modular/transformations/ffi/finalizable.dart:148-164 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart:25-47 | pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_new.dart:41-56 | pkg/analysis_server/lib/src/services/correction/dart/remove_unused_catch_clause.dart:26-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analyzer/lib/src/summary2/metadata_resolver.dart:70 — pkg/analyzer/lib/src/summary2/metadata_resolver.dart:70-85 | pkg/analyzer/lib/src/summary2/metadata_resolver.dart:110-125 | pkg/analyzer/lib/src/summary2/metadata_resolver.dart:150-167 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/kernel/lib/clone.dart:887 — pkg/kernel/lib/clone.dart:887-905 | pkg/kernel/lib/clone.dart:938-953 | pkg/kernel/lib/clone.dart:955-973 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1524 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1524-1539 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1541-1556 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1558-1573 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart:40 — pkg/analysis_server/lib/src/lsp/handlers/handler_document_color.dart:40-55 | pkg/analysis_server/lib/src/lsp/handlers/handler_document_color_presentation.dart:41-56 | pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart:35-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:20317 — pkg/analyzer/lib/src/dart/ast/ast.dart:20317-20332 | pkg/analyzer/lib/src/dart/ast/ast.dart:41381-41400 | pkg/analyzer/lib/src/dart/ast/ast.dart:49164-49181 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart:38 — pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart:38-53 | pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart:175-190 | pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart:202-217 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/vm/lib/transformations/type_flow/transformer.dart:1771 — pkg/vm/lib/transformations/type_flow/transformer.dart:1771-1787 | pkg/vm/lib/transformations/type_flow/transformer.dart:1966-1981 | pkg/vm/lib/transformations/type_flow/transformer.dart:1983-1998 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/compiler/lib/src/ir/impact_data.dart:908 — pkg/compiler/lib/src/ir/impact_data.dart:908-923 | pkg/compiler/lib/src/ir/impact_data.dart:985-1000 | pkg/compiler/lib/src/ir/impact_data.dart:1002-1017 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:511 — pkg/front_end/lib/src/kernel/expression_generator.dart:511-526 | pkg/front_end/lib/src/kernel/expression_generator.dart:4146-4162 | pkg/front_end/lib/src/kernel/expression_generator.dart:5386-5401 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/front_end/testcases/general/patch_extension_scope/origin_lib.dart:6 — pkg/front_end/testcases/general/patch_extension_scope/origin_lib.dart:6-21 | pkg/front_end/testcases/general/patch_extension_scope/patch_lib1.dart:10-25 | pkg/front_end/testcases/general/patch_extension_scope/patch_lib2.dart:10-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/front_end/lib/src/builder/builder_mixins.dart:39 — pkg/front_end/lib/src/builder/builder_mixins.dart:39-59 | pkg/front_end/lib/src/builder/future_or_type_declaration_builder.dart:19-34 | pkg/front_end/lib/src/builder/invalid_builder.dart:51-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1424 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1424-1439 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:1921-1938 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:1979-1996 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) REDACTED:470 — REDACTED:470-487 | REDACTED:1374-1393 | REDACTED:1481-1496 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×18
  • Duplicated block (22 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1325 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1325-1346 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1764-1785 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 before the matched lines, `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1320` calls `tokenizeCaret` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1761` 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 (22 lines × 2) pkg/analysis_server/lib/src/cider/document_symbols.dart:43 — pkg/analysis_server/lib/src/cider/document_symbols.dart:43-64 | pkg/analysis_server/lib/src/lsp/handlers/handler_document_symbols.dart:53-74 — 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 lines × 2) pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:83 — pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:83-104 | pkg/analysis_server/lib/src/services/refactoring/add_import_prefix.dart:89-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:41496 — pkg/analyzer/lib/src/dart/ast/ast.dart:41496-41517 | pkg/analyzer/lib/src/dart/ast/ast.dart:41691-41712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:41496` 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 (22 lines × 2) pkg/analyzer/tool/ast/generate.dart:1037 — pkg/analyzer/tool/ast/generate.dart:1037-1058 | pkg/analyzer/tool/ast/generate.dart:1089-1110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/ast/generate.dart:1037` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:1663 — pkg/compiler/lib/src/ssa/builder.dart:1663-1684 | pkg/compiler/lib/src/ssa/builder.dart:4391-4412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:1663` it does not close everything it opens, so those exact lines 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:7953 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7953-7974 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8819-8840 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7953` it does not close everything it opens, so those 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 (22 lines × 2) pkg/front_end/lib/src/dill/dill_target.dart:66 — pkg/front_end/lib/src/dill/dill_target.dart:66-87 | pkg/front_end/lib/src/kernel/kernel_target.dart:238-259 — 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 (22 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:4986 — pkg/front_end/lib/src/kernel/body_builder.dart:4986-5007 | pkg/front_end/lib/src/source/outline_builder.dart:3256-3277 — before extracting anything, compare `pkg/front_end/lib/src/kernel/body_builder.dart` and `pkg/front_end/lib/src/source/outline_builder.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 90 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 `pkg/front_end/lib/src/kernel/body_builder.dart:4986` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3455 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:3455-3476 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:3494-3515 — both copies are in the same file, so extract the 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 `node` to `MapLiteral` in one and `MapConcatenation` 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 (22 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:384 — pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:384-405 | pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:492-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:384` 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 (22 lines × 2) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:586 — pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:586-607 | pkg/front_end/lib/src/source/source_type_alias_builder.dart:223-244 — 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 `pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:586` 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, `pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:583` calls `toSet` and `pkg/front_end/lib/src/source/source_type_alias_builder.dart:221` 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 (22 lines × 2) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1157 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1157-1178 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1709-1730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/collection_encoding.dart:1157` 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 (22 lines × 2) pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:99 — pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:99-120 | pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:127-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:99` 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 (22 lines × 2) pkg/observatory/lib/src/elements/heap_snapshot.dart:427 — pkg/observatory/lib/src/elements/heap_snapshot.dart:427-448 | pkg/observatory/lib/src/elements/process_snapshot.dart:154-175 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 (22 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:559 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:559-580 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:562-583 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2104 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2104-2125 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:2122-2143 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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) sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart:100 — sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart:100-121 | sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart:101-122 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart` and `sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart:100` 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×17
  • Repeated repair: pkg/dart2wasm/lib/record_class_generator.dart pkg/dart2wasm/lib/record_class_generator.dart:395 — pkg/dart2wasm/lib/record_class_generator.dart changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is _RecordClassGenerator._generateToString at line 395), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[dart2wasm] Fix hashCode of records with 20 fields”; “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 5”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/dart2wasm/lib/record_class_generator.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/kernel/lib/binary/ast_from_binary.dart pkg/kernel/lib/binary/ast_from_binary.dart:1056 — pkg/kernel/lib/binary/ast_from_binary.dart changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is BinaryBuilder.readUriToSource at line 1056), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 5”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/kernel/lib/binary/ast_from_binary.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/vm/lib/modular/transformations/ffi/native.dart pkg/vm/lib/modular/transformations/ffi/native.dart:956 — pkg/vm/lib/modular/transformations/ffi/native.dart changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is FfiNativeTransformer.visitProcedure at line 956), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/vm/lib/modular/transformations/ffi/native.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/dart2wasm/lib/js/callback_specializer.dart pkg/dart2wasm/lib/js/callback_specializer.dart:74 — pkg/dart2wasm/lib/js/callback_specializer.dart changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is CallbackSpecializer._createFunctionTrampoline at line 74), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/dart2wasm/lib/js/callback_specializer.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart:354 — pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is LateLowering._fieldCell at line 354), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/compiler/lib/src/kernel/transformations/modular/late_lowering.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/compiler/lib/src/kernel/transformations/modular/list_factory_specializer.dart pkg/compiler/lib/src/kernel/transformations/modular/list_factory_specializer.dart:272 — pkg/compiler/lib/src/kernel/transformations/modular/list_factory_specializer.dart changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ListGenerateLoopBodyInliner.suitableFunctionExpression at line 272), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/compiler/lib/src/kernel/transformations/modular/list_factory_specializer.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/kernel/lib/src/ast/functions.dart pkg/kernel/lib/src/ast/functions.dart:18 — pkg/kernel/lib/src/ast/functions.dart changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is TypeParameterList.TypeParameterList at line 18), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/kernel/lib/src/ast/functions.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/vm/lib/modular/target/vm.dart pkg/vm/lib/modular/target/vm.dart:483 — pkg/vm/lib/modular/target/vm.dart changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is VmTarget.allowPlatformPrivateLibraryAccess at line 483), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/vm/lib/modular/target/vm.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/front_end/lib/src/type_inference/object_access_target.dart pkg/front_end/lib/src/type_inference/object_access_target.dart:1460 — pkg/front_end/lib/src/type_inference/object_access_target.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ExtensionAccessCandidate.isMoreSpecificThan at line 1460), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/type_inference/object_access_target.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/kernel/lib/type_algebra.dart pkg/kernel/lib/type_algebra.dart:1685 — pkg/kernel/lib/type_algebra.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is FunctionTypeInstantiator.visitFunctionType at line 1685), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/kernel/lib/type_algebra.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/dart2wasm/lib/ffi_native_transformer.dart pkg/dart2wasm/lib/ffi_native_transformer.dart:306 — pkg/dart2wasm/lib/ffi_native_transformer.dart changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is WasmFfiNativeTransformer._dartValueToFfiValue at line 306), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/dart2wasm/lib/ffi_native_transformer.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/front_end/lib/src/type_inference/type_schema_environment.dart pkg/front_end/lib/src/type_inference/type_schema_environment.dart:99 — pkg/front_end/lib/src/type_inference/type_schema_environment.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is TypeSchemaEnvironment.getContextTypeOfSpecialCasedBinaryOperator at line 99), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/type_inference/type_schema_environment.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/kernel/lib/src/ast/constants.dart pkg/kernel/lib/src/ast/constants.dart:1216 — pkg/kernel/lib/src/ast/constants.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is TypedefTearOffConstant.== at line 1216), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Follow up to "Establish invariant of using fixed length lists in Kernel AST"”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 5”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/kernel/lib/src/ast/constants.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/kernel/lib/src/ast/statements.dart pkg/kernel/lib/src/ast/statements.dart:1292 — pkg/kernel/lib/src/ast/statements.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Catch.toTextInternal at line 1292), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 6”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/kernel/lib/src/ast/statements.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/front_end/lib/src/type_inference/delayed_expressions.dart pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1050 — pkg/front_end/lib/src/type_inference/delayed_expressions.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is DelayedInstanceGet.createExpression at line 1050), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/front_end/lib/src/type_inference/delayed_expressions.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/vm/lib/modular/transformations/for_in_lowering.dart pkg/vm/lib/modular/transformations/for_in_lowering.dart:28 — pkg/vm/lib/modular/transformations/for_in_lowering.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ForInLowering.transformForInStatement at line 28), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 1”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/vm/lib/modular/transformations/for_in_lowering.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: pkg/vm/lib/modular/transformations/list_literals_lowering.dart pkg/vm/lib/modular/transformations/list_literals_lowering.dart:42 — pkg/vm/lib/modular/transformations/list_literals_lowering.dart changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ListLiteralsLowering.transformListLiteral at line 42), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 4”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 3”; “[kernel] Establish invariant of using fixed length lists in Kernel AST - Part 2”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:39:01 -08:00' --until='2026-11-13 01:39:01 -08:00' --full-history --no-merges -- pkg/vm/lib/modular/transformations/list_literals_lowering.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×17
  • Duplicated block (14 lines × 3) pkg/analyzer/lib/src/binary/binary_reader.dart:257 — pkg/analyzer/lib/src/binary/binary_reader.dart:257-270 | pkg/dart2bytecode/lib/bytecode_serialization.dart:313-326 | pkg/kernel/lib/binary/ast_from_binary.dart:219-232 — 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 `pkg/analyzer/lib/src/binary/binary_reader.dart:257` 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 × 3) pkg/analyzer/lib/src/dart/analysis/index.dart:747 — pkg/analyzer/lib/src/dart/analysis/index.dart:747-760 | pkg/analyzer/lib/src/dart/analysis/index.dart:1024-1037 | pkg/analyzer/lib/src/dart/analysis/index.dart:1102-1115 — 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 `pkg/analyzer/lib/src/dart/analysis/index.dart:747` 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 (14 lines × 3) pkg/analyzer/lib/src/fine/manifest_item.dart:251 — pkg/analyzer/lib/src/fine/manifest_item.dart:251-264 | pkg/analyzer/lib/src/fine/manifest_item.dart:440-453 | pkg/analyzer/lib/src/fine/manifest_item.dart:1297-1310 — 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 after the matched lines, `pkg/analyzer/lib/src/fine/manifest_item.dart:454` calls `encode` and `pkg/analyzer/lib/src/fine/manifest_item.dart:265` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 3) pkg/compiler/lib/src/js_model/env.dart:802 — pkg/compiler/lib/src/js_model/env.dart:802-815 | pkg/compiler/lib/src/js_model/env.dart:1037-1050 | pkg/compiler/lib/src/js_model/env.dart:1083-1096 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) pkg/dartdev/lib/src/commands/dart_mcp_server.dart:56 — pkg/dartdev/lib/src/commands/dart_mcp_server.dart:56-69 | pkg/dartdev/lib/src/commands/development_service.dart:49-62 | pkg/dartdev/lib/src/commands/tooling_daemon.dart:43-56 — before extracting anything, compare `pkg/dartdev/lib/src/commands/development_service.dart` and `pkg/dartdev/lib/src/commands/tooling_daemon.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `pkg/dartdev/lib/src/commands/dart_mcp_server.dart:56` 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 × 3) pkg/front_end/lib/src/fragment/constructor/declaration.dart:1012 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:1012-1025 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1184-1197 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1429-1442 — 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 `pkg/front_end/lib/src/fragment/constructor/declaration.dart:1012` it does not close everything it opens, so those exact lines 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 × 3) pkg/front_end/lib/src/fragment/method/encoding.dart:1014 — pkg/front_end/lib/src/fragment/method/encoding.dart:1014-1027 | pkg/front_end/lib/src/fragment/util.dart:178-191 | pkg/front_end/lib/src/fragment/util.dart:203-216 — 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 `pkg/front_end/lib/src/fragment/method/encoding.dart:1014` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `builder` to `SourceMethodBuilder` in one and `SourcePropertyBuilder` 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 × 3) pkg/front_end/lib/src/kernel/body_builder.dart:10120 — pkg/front_end/lib/src/kernel/body_builder.dart:10120-10134 | pkg/front_end/lib/src/kernel/body_builder.dart:10385-10398 | pkg/front_end/lib/src/kernel/body_builder.dart:10463-10477 — 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 `pkg/front_end/lib/src/kernel/body_builder.dart:10120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 3) pkg/front_end/lib/src/source/outline_builder.dart:1488 — pkg/front_end/lib/src/source/outline_builder.dart:1488-1501 | pkg/front_end/lib/src/source/outline_builder.dart:1584-1597 | pkg/front_end/lib/src/source/outline_builder.dart:2863-2876 — 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 (14 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13869 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:13869-13882 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:14155-14168 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:14302-14315 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:13869` 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 × 3) pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:39 — pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:39-52 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:117-130 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:195-208 — 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 `pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:39` it does not close everything it opens, so those exact lines 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 × 3) pkg/observatory/lib/src/elements/heap_snapshot.dart:672 — pkg/observatory/lib/src/elements/heap_snapshot.dart:672-685 | pkg/observatory/lib/src/elements/isolate/shared_summary.dart:63-76 | pkg/observatory/lib/src/elements/process_snapshot.dart:360-373 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:672` it does not close everything it opens, so those exact lines 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 × 3) pkg/observatory/lib/src/elements/instance_ref.dart:200 — pkg/observatory/lib/src/elements/instance_ref.dart:200-213 | pkg/observatory/lib/src/elements/instance_ref.dart:258-271 | pkg/observatory/lib/src/elements/instance_ref.dart:383-396 — 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 `pkg/observatory/lib/src/elements/instance_ref.dart:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) pkg/vm/lib/transformations/dynamic_interface_annotator.dart:664 — pkg/vm/lib/transformations/dynamic_interface_annotator.dart:664-677 | pkg/vm/lib/transformations/type_flow/analysis.dart:1515-1528 | pkg/vm/lib/transformations/type_flow/rta.dart:89-102 — 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 (14 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart:352 — sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart:352-365 | sdk/lib/_internal/js_runtime/lib/developer_patch.dart:321-334 | sdk/lib/_internal/wasm/standalone/developer_patch.dart:140-153 — 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. 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 × 3) pkg/front_end/parser_testcases/inline_class/extension_type.dart:7 — pkg/front_end/parser_testcases/inline_class/extension_type.dart:7-20 | pkg/front_end/parser_testcases/inline_class/extension_type_const.dart:7-20 | pkg/front_end/testcases/extension_types/extension_type_declarations.dart:14-27 — 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 (14 lines × 3) pkg/front_end/parser_testcases/primary_constructors/constructor_head.dart:4 — pkg/front_end/parser_testcases/primary_constructors/constructor_head.dart:4-17 | pkg/front_end/parser_testcases/primary_constructors/constructor_head_pre_feature.dart:6-19 | pkg/front_end/testcases/primary_constructors/constructor_head.dart:15-74 — before extracting anything, compare `pkg/front_end/parser_testcases/primary_constructors/constructor_head.dart` and `pkg/front_end/parser_testcases/primary_constructors/constructor_head_pre_feature.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/primary_constructors/constructor_head.dart:15` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×17
  • Duplicated block (12 lines × 3) pkg/analysis_server/lib/src/protocol/protocol_internal.dart:286 — pkg/analysis_server/lib/src/protocol/protocol_internal.dart:286-297 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:538-549 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:621-632 — before extracting anything, compare `pkg/analysis_server/lib/src/protocol/protocol_internal.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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 × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:26216 — pkg/analyzer/lib/src/dart/ast/ast.dart:26216-26227 | pkg/analyzer/lib/src/dart/ast/ast.dart:28058-28069 | pkg/analyzer/lib/src/dart/ast/ast.dart:40495-40506 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:26216` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/constant/value.dart:2038 — pkg/analyzer/lib/src/dart/constant/value.dart:2038-2049 | pkg/analyzer/lib/src/dart/constant/value.dart:2315-2326 | pkg/analyzer/lib/src/dart/constant/value.dart:2415-2426 — 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 `pkg/analyzer/lib/src/dart/constant/value.dart:2038` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) pkg/analyzer/lib/src/summary2/bundle_writer.dart:272 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:272-283 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:379-390 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:669-680 — 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 `pkg/analyzer/lib/src/summary2/bundle_writer.dart:272` it does not close everything it opens, so those 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, `pkg/analyzer/lib/src/summary2/bundle_writer.dart:376` calls `writeBool` and `pkg/analyzer/lib/src/summary2/bundle_writer.dart:269` 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 (12 lines × 3) pkg/analyzer/lib/src/summary2/bundle_writer.dart:300 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:300-311 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:405-416 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:697-708 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_writer.dart:300` 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) pkg/dartdev/lib/src/templates/cli.dart:11 — pkg/dartdev/lib/src/templates/cli.dart:11-22 | pkg/dartdev/lib/src/templates/console.dart:11-22 | pkg/dartdev/lib/src/templates/web.dart:13-24 — 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 `pkg/dartdev/lib/src/templates/cli.dart:11` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/dartdev/lib/src/templates/console.dart:24` calls `addFile` and `pkg/dartdev/lib/src/templates/cli.dart:24` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) pkg/front_end/lib/src/codes/type_labeler.dart:137 — pkg/front_end/lib/src/codes/type_labeler.dart:137-148 | pkg/front_end/lib/src/codes/type_labeler.dart:294-305 | pkg/front_end/lib/src/codes/type_labeler.dart:329-340 — 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 `pkg/front_end/lib/src/codes/type_labeler.dart: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `TypedefType` in one and `InterfaceType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:614 — pkg/front_end/lib/src/fragment/getter/encoding.dart:614-625 | pkg/front_end/lib/src/fragment/method/encoding.dart:604-615 | pkg/front_end/lib/src/fragment/setter/encoding.dart:665-676 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:614` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2204 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2204-2215 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5945-5956 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6044-6055 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionIfNullSet` in one and `CompoundPropertySet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart:64 — pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart:64-75 | pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware_upwards.dart:43-54 | pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware_upwards.dart:64-75 — `pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware_upwards.dart` 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 2 separate duplicated blocks between them, totalling at least 23 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 `pkg/front_end/testcases/inference/infer_assign_to_property_null_aware_upwards.dart:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `Test3?` in one and `Test2?` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) pkg/kernel/lib/type_algebra.dart:1005 — pkg/kernel/lib/type_algebra.dart:1005-1016 | pkg/kernel/lib/type_algebra.dart:1356-1367 | pkg/kernel/lib/type_algebra.dart:1661-1672 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/type_algebra.dart:1005` 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 (12 lines × 3) sdk/lib/_internal/js_dev_runtime/private/string_helper.dart:97 — sdk/lib/_internal/js_dev_runtime/private/string_helper.dart:97-108 | sdk/lib/_internal/js_runtime/lib/string_helper.dart:110-121 | sdk/lib/_internal/wasm/common/string_helper.dart:70-81 — 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 `sdk/lib/_internal/js_dev_runtime/private/string_helper.dart:97` 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 (12 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1326 — sdk/lib/_internal/vm/lib/convert_patch.dart:1326-1337 | sdk/lib/_internal/wasm/common/convert_patch.dart:1512-1523 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1204-1215 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart: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. 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 × 3) pkg/kernel/lib/src/dart_type_equivalence.dart:179 — pkg/kernel/lib/src/dart_type_equivalence.dart:179-190 | pkg/kernel/lib/src/dart_type_equivalence.dart:207-218 | pkg/kernel/lib/src/dart_type_equivalence.dart:341-352 — 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 `pkg/kernel/lib/src/dart_type_equivalence.dart:179` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `InterfaceType` in one and `ExtensionType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:353 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:353-364 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:349-360 | sdk/lib/_internal/wasm/common/io_patch.dart:349-360 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (12 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:716 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:716-727 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:712-723 | sdk/lib/_internal/wasm/common/io_patch.dart:712-723 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (12 lines × 3) tools/write_dartdoc_options_file.py:12 — tools/write_dartdoc_options_file.py:12-23 | tools/write_revision_file.py:13-24 | tools/write_version_file.py:13-24 — before extracting anything, compare `tools/write_revision_file.py` and `tools/write_version_file.py` 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. 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×17
  • Duplicated block (11 lines × 3) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7352 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7352-7362 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8064-8074 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8087-8097 — 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 `pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7352` it does not close everything it opens, so those exact lines 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 × 3) pkg/analysis_server/lib/protocol/protocol.dart:166 — pkg/analysis_server/lib/protocol/protocol.dart:166-176 | pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:144-154 | pkg/analyzer_plugin/lib/protocol/protocol.dart:174-184 — before extracting anything, compare `pkg/analysis_server/lib/protocol/protocol.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:144` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `first` to `List<Object?>` in one and `List?` 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 × 3) pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:1516 — pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:1516-1526 | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:1529-1539 | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:1542-1552 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `element` to `InterfaceElement` in one and `TypeAliasElement` 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 × 3) pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:31 — pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:31-41 | pkg/analysis_server/lib/src/services/snippets/dart/test_definition.dart:35-45 | pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart:31-41 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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 `pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:31` 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 lines × 3) pkg/analyzer/lib/src/dart/analysis/search.dart:311 — pkg/analyzer/lib/src/dart/analysis/search.dart:311-321 | pkg/analyzer/lib/src/dart/analysis/search.dart:408-418 | pkg/analyzer/lib/src/dart/analysis/search.dart:426-436 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `DotShorthandMethodInvocation` in one and `ReceiverMethodInvocation` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/analysis/search.dart:419` calls `accept2` and `pkg/analyzer/lib/src/dart/analysis/search.dart:322` 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 × 3) pkg/analyzer/lib/src/dart/element/well_bounded.dart:88 — pkg/analyzer/lib/src/dart/element/well_bounded.dart:88-98 | pkg/analyzer/lib/src/error/type_arguments_verifier.dart:100-110 | pkg/analyzer/lib/src/error/type_arguments_verifier.dart:174-184 — 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 `pkg/analyzer/lib/src/dart/element/well_bounded.dart:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4551 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4551-4561 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4596-4606 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4638-4648 — 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 `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4551` 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 `node` to `covariant TopLevelFunctionDeclarationImpl` in one and `covariant TopLevelGetterDeclarationImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4607` calls `accept2` and `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4652` 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 × 3) pkg/analyzer/lib/src/summary2/bundle_writer.dart:193 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:193-203 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:535-545 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:758-768 — 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 `pkg/analyzer/lib/src/summary2/bundle_writer.dart:193` it does not close everything it opens, so those 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 `elements` to `List<ConstructorElementImpl>` in one and `List<GetterElementImpl>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/summary2/bundle_writer.dart:204` calls `writeElement` and `pkg/analyzer/lib/src/summary2/bundle_writer.dart:546` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) pkg/analyzer/lib/src/summary2/informative_data.dart:194 — pkg/analyzer/lib/src/summary2/informative_data.dart:194-204 | pkg/analyzer/lib/src/summary2/informative_data.dart:290-300 | pkg/analyzer/lib/src/summary2/informative_data.dart:484-494 — 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 `pkg/analyzer/lib/src/summary2/informative_data.dart:194` 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 `fragment` to `ClassFragmentImpl` in one and `EnumFragmentImpl` 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 × 3) pkg/dartdev/lib/src/commands/compile.dart:311 — pkg/dartdev/lib/src/commands/compile.dart:311-321 | pkg/dartdev/lib/src/commands/compile.dart:441-451 | pkg/dartdev/lib/src/commands/compile.dart:978-988 — 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 `pkg/dartdev/lib/src/commands/compile.dart:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/dartdev/lib/src/commands/compile.dart:323` calls `stdout` and `pkg/dartdev/lib/src/commands/compile.dart:453` 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 × 3) pkg/front_end/lib/src/fragment/method/encoding.dart:701 — pkg/front_end/lib/src/fragment/method/encoding.dart:701-711 | pkg/front_end/lib/src/fragment/setter/encoding.dart:420-430 | pkg/front_end/lib/src/fragment/setter/encoding.dart:771-781 — `pkg/front_end/lib/src/fragment/method/encoding.dart` and `pkg/front_end/lib/src/fragment/setter/encoding.dart` 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 16 separate duplicated blocks between them, totalling at least 318 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 `pkg/front_end/lib/src/fragment/method/encoding.dart:701` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1362 — sdk/lib/_internal/vm/lib/convert_patch.dart:1362-1372 | sdk/lib/_internal/wasm/common/convert_patch.dart:1548-1558 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1240-1250 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1362` 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 `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 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1382 — sdk/lib/_internal/vm/lib/convert_patch.dart:1382-1392 | sdk/lib/_internal/wasm/common/convert_patch.dart:1568-1578 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1260-1270 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1382` 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 `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 lines × 3) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:886 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:886-896 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1004-1014 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1121-1131 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 3) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart:252 — pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart:252-262 | pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:161-171 | pkg/analysis_server/lib/src/services/refactoring/legacy/inline_local.dart:167-177 — 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. 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 × 3) pkg/test_runner/lib/src/runtime_configuration.dart:445 — pkg/test_runner/lib/src/runtime_configuration.dart:445-455 | pkg/test_runner/lib/src/runtime_configuration.dart:487-497 | pkg/test_runner/lib/src/runtime_configuration.dart:590-600 — 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 `pkg/test_runner/lib/src/runtime_configuration.dart:445` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/test_runner/lib/src/runtime_configuration.dart:484` calls `DartPrecompiledRuntimeConfiguration` and `pkg/test_runner/lib/src/runtime_configuration.dart:443` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) tools/utils.py:448 — tools/utils.py:448-458 | tools/utils.py:463-473 | tools/utils.py:478-488 — 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 `tools/utils.py:448` 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×16
  • Members sharing a duplicated core (5 members, 50+ identical tokens) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:158 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:158-237 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/map.dart:39-82 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/record.dart:62-118 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart:78-117 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart:194-223 — 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) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:514 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:514-549 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:599-636 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:638-657 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:659-689 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:847-871 — 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) pkg/analyzer/lib/src/fine/library_manifest.dart:2049 — pkg/analyzer/lib/src/fine/library_manifest.dart:2049-2073 | pkg/analyzer/lib/src/fine/library_manifest.dart:2075-2099 | pkg/analyzer/lib/src/fine/library_manifest.dart:2101-2125 | pkg/analyzer/lib/src/fine/library_manifest.dart:2127-2151 | pkg/analyzer/lib/src/fine/library_manifest.dart:2153-2177 — 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) pkg/analyzer/lib/src/fine/manifest_item.dart:79 — pkg/analyzer/lib/src/fine/manifest_item.dart:79-100 | pkg/analyzer/lib/src/fine/manifest_item.dart:269-288 | pkg/analyzer/lib/src/fine/manifest_item.dart:376-391 | pkg/analyzer/lib/src/fine/manifest_item.dart:460-481 | pkg/analyzer/lib/src/fine/manifest_item.dart:1319-1340 — 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) pkg/analyzer/lib/src/summary2/bundle_reader.dart:248 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:248-291 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:449-485 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:536-569 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:603-641 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1059-1096 — 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) pkg/analyzer/lib/src/summary2/bundle_reader.dart:293 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:293-327 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:487-519 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:571-601 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:643-674 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1098-1130 — 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) pkg/analyzer/lib/src/summary2/bundle_writer.dart:172 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:172-190 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:295-311 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:352-366 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:401-416 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:691-708 — 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) pkg/dartdev/lib/src/commands/compile.dart:125 — pkg/dartdev/lib/src/commands/compile.dart:125-174 | pkg/dartdev/lib/src/commands/compile.dart:197-229 | pkg/dartdev/lib/src/commands/dart_mcp_server.dart:47-94 | pkg/dartdev/lib/src/commands/development_service.dart:30-62 | pkg/dartdev/lib/src/commands/tooling_daemon.dart:29-56 — 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) pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:763 — pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:763-778 | sdk/lib/_http/http_impl.dart:1148-1162 | sdk/lib/_internal/vm_shared/lib/string_buffer_patch.dart:99-114 | sdk/lib/_internal/wasm/standalone/string_buffer_patch.dart:41-57 | sdk/lib/io/io_sink.dart:296-310 — 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) pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:249 — pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:249-258 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:281-290 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:313-322 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:541-550 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:572-581 — 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) pkg/observatory/lib/src/elements/error_view.dart:56 — pkg/observatory/lib/src/elements/error_view.dart:56-75 | pkg/observatory/lib/src/elements/general_error.dart:58-74 | pkg/observatory/lib/src/elements/isolate_reconnect.dart:75-119 | pkg/observatory/lib/src/elements/json_view.dart:57-71 | pkg/observatory/lib/src/elements/vm_connect.dart:62-121 — 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) pkg/observatory/lib/src/elements/icdata_view.dart:90 — pkg/observatory/lib/src/elements/icdata_view.dart:90-195 | pkg/observatory/lib/src/elements/library_view.dart:111-198 | pkg/observatory/lib/src/elements/singletargetcache_view.dart:95-180 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:92-149 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:91-160 — 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) pkg/observatory/lib/src/elements/nav/notify_event.dart:90 — pkg/observatory/lib/src/elements/nav/notify_event.dart:90-105 | pkg/observatory/lib/src/elements/nav/notify_event.dart:107-122 | pkg/observatory/lib/src/elements/nav/notify_event.dart:147-164 | pkg/observatory/lib/src/elements/nav/notify_event.dart:166-183 | pkg/observatory/lib/src/elements/nav/notify_event.dart:185-200 — 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) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:755 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:755-794 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1736-1760 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2255-2286 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2649-2675 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2738-2764 — 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) sdk/lib/vmservice/devfs.dart:203 — sdk/lib/vmservice/devfs.dart:203-221 | sdk/lib/vmservice/devfs.dart:223-278 | sdk/lib/vmservice/devfs.dart:280-335 | sdk/lib/vmservice/devfs.dart:337-395 | sdk/lib/vmservice/devfs.dart:397-420 — 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) pkg/test_runner/lib/src/runtime_configuration.dart:444 — pkg/test_runner/lib/src/runtime_configuration.dart:444-479 | pkg/test_runner/lib/src/runtime_configuration.dart:486-515 | pkg/test_runner/lib/src/runtime_configuration.dart:519-546 | pkg/test_runner/lib/src/runtime_configuration.dart:554-581 | pkg/test_runner/lib/src/runtime_configuration.dart:589-633 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×16
  • Edited copy of a member (38 corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:123 — pkg/analyzer/lib/src/fine/library_manifest.dart:123-170 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:369-406 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/dart2wasm/lib/translator.dart:3777 — pkg/dart2wasm/lib/translator.dart:3777-3814 | pkg/dart2wasm/lib/translator.dart:3816-3860 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:112 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:112-149 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:151-196 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1069 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1069-1106 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1620-1658 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:280 — pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:280-317 | pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:319-357 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) sdk/lib/_internal/vm/lib/integers.dart:219 — sdk/lib/_internal/vm/lib/integers.dart:219-256 | sdk/lib/_internal/wasm/common/boxed_int.dart:187-224 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/fragment/constructor/declaration.dart:970 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:970-1007 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1304-1345 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/analyzer/lib/src/dart/analysis/file_state.dart:193 — pkg/analyzer/lib/src/dart/analysis/file_state.dart:193-237 | pkg/analyzer/lib/src/dart/analysis/file_state.dart:270-307 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/analyzer/lib/src/fine/requirements.dart:2739 — pkg/analyzer/lib/src/fine/requirements.dart:2739-2776 | pkg/analyzer/lib/src/fine/requirements.dart:2778-2817 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:3427 — pkg/front_end/lib/src/kernel/body_builder.dart:3427-3467 | pkg/front_end/lib/src/kernel/body_builder.dart:6079-6116 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/native_compiler/lib/back_end/arm64/constraints.dart:411 — pkg/native_compiler/lib/back_end/arm64/constraints.dart:411-453 | pkg/native_compiler/lib/back_end/arm64/constraints.dart:455-492 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3275 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:3275-3314 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:3383-3420 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3517 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3517-3561 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3578-3615 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/analyzer/tool/ast/generate.dart:380 — pkg/analyzer/tool/ast/generate.dart:380-417 | pkg/analyzer/tool/ast/generate.dart:703-743 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:105 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:105-142 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:88-125 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) pkg/front_end/lib/src/source/builder_factory.dart:1527 — pkg/front_end/lib/src/source/builder_factory.dart:1527-1565 | pkg/front_end/lib/src/source/builder_factory.dart:1688-1725 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×16
  • Edited copy of a member (28 corresponding lines) pkg/vm/lib/transformations/type_flow/types.dart:1700 — pkg/vm/lib/transformations/type_flow/types.dart:1700-1727 | pkg/vm/lib/transformations/type_flow/types.dart:1729-1757 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:716 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:716-743 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:745-772 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) runtime/tools/dartfuzz/dartfuzz.dart:1956 — runtime/tools/dartfuzz/dartfuzz.dart:1956-1983 | runtime/tools/dartfuzz/dartfuzz.dart:1985-2024 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:208 — pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:208-235 | pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:237-274 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/front_end/lib/src/base/incremental_compiler_utils.dart:8 — pkg/front_end/lib/src/base/incremental_compiler_utils.dart:8-35 | pkg/front_end/lib/src/base/incremental_compiler_utils.dart:37-64 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) sdk/lib/_internal/vm/lib/integers.dart:645 — sdk/lib/_internal/vm/lib/integers.dart:645-683 | sdk/lib/_internal/vm/lib/integers.dart:709-736 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1201 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1201-1228 | pkg/js_ast/lib/src/builder.dart:1049-1076 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:19-46 | pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart:19-46 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/do_statement.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/do_statement.dart:19-46 | pkg/analysis_server/lib/src/services/snippets/dart/try_catch_statement.dart:19-52 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:7708 — pkg/front_end/lib/src/kernel/body_builder.dart:7708-7737 | pkg/front_end/lib/src/kernel/body_builder.dart:7739-7766 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/front_end/lib/src/fragment/enum_element.dart:121 — pkg/front_end/lib/src/fragment/enum_element.dart:121-151 | pkg/front_end/lib/src/source/source_enum_builder.dart:713-740 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) sdk/lib/io/directory_impl.dart:143 — sdk/lib/io/directory_impl.dart:143-170 | sdk/lib/io/directory_impl.dart:172-200 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:8904 — pkg/front_end/lib/src/kernel/body_builder.dart:8904-8933 | pkg/front_end/lib/src/kernel/body_builder.dart:8935-8962 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4253 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4253-4280 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4404-4431 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:888 — pkg/dev_compiler/lib/src/js_ast/printer.dart:888-917 | pkg/js_ast/lib/src/printer.dart:1023-1050 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) pkg/analyzer/lib/src/generated/error_verifier.dart:3088 — pkg/analyzer/lib/src/generated/error_verifier.dart:3088-3115 | pkg/analyzer/lib/src/generated/error_verifier.dart:4732-4763 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×16
  • Edited copy of a member (29 corresponding lines) sdk/lib/_internal/vm/lib/string_patch.dart:1153 — sdk/lib/_internal/vm/lib/string_patch.dart:1153-1181 | sdk/lib/_internal/vm/lib/string_patch.dart:1183-1211 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/front_end/lib/src/util/outline_extractor.dart:698 — pkg/front_end/lib/src/util/outline_extractor.dart:698-726 | pkg/front_end/lib/src/util/outline_extractor.dart:728-762 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/flutter_move_down.dart:25-54 | pkg/analysis_server/lib/src/services/correction/dart/flutter_move_up.dart:25-53 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/observatory/lib/src/elements/script_inset.dart:566 — pkg/observatory/lib/src/elements/script_inset.dart:566-594 | pkg/observatory/lib/src/elements/script_inset.dart:596-635 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/dart2wasm/lib/constants.dart:2176 — pkg/dart2wasm/lib/constants.dart:2176-2204 | pkg/dart2wasm/lib/constants.dart:2206-2236 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/kernel/lib/src/ast/patterns.dart:1894 — pkg/kernel/lib/src/ast/patterns.dart:1894-1922 | pkg/kernel/lib/src/ast/statements.dart:979-1007 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/kernel/lib/src/ast/members.dart:282 — pkg/kernel/lib/src/ast/members.dart:282-310 | pkg/kernel/lib/src/ast/members.dart:312-340 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart:23 — pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart:23-51 | pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart:24-52 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:256 — pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:256-285 | pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:287-315 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:1288 — pkg/dev_compiler/lib/src/js_ast/printer.dart:1288-1325 | pkg/js_ast/lib/src/printer.dart:1564-1592 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1400 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1400-1428 | pkg/compiler/lib/src/js_model/element_map_impl.dart:1431-1468 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/compiler/lib/src/ssa/builder.dart:7241 — pkg/compiler/lib/src/ssa/builder.dart:7241-7269 | pkg/compiler/lib/src/ssa/builder.dart:7296-7329 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/front_end/lib/src/source/diet_listener.dart:1182 — pkg/front_end/lib/src/source/diet_listener.dart:1182-1221 | pkg/front_end/lib/src/source/diet_listener.dart:1238-1266 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1505 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1505-1536 | pkg/analyzer/lib/src/fasta/ast_builder.dart:1721-1749 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1341 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1341-1369 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1437-1467 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) sdk/lib/io/overrides.dart:612 — sdk/lib/io/overrides.dart:612-640 | sdk/lib/io/overrides.dart:669-697 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×16
  • Duplicated block (8 lines × 3) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:833 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:833-843 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1203-1210 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1248-1255 — 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 `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:833` it does not close everything it opens, so those 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 × 3) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:155 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:155-162 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:196-203 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:438-445 — 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 `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:155` 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 `element` to `ClassElement` in one and `EnumElement` 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, `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:193` calls `writeln`, `write`, `summarizeList` and `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:154` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) pkg/analyzer/lib/src/fine/library_manifest_ids.dart:47 — pkg/analyzer/lib/src/fine/library_manifest_ids.dart:47-54 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:113-120 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:202-209 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) sdk/lib/_internal/wasm/common/simd.dart:96 — sdk/lib/_internal/wasm/common/simd.dart:96-103 | sdk/lib/_internal/wasm/common/simd.dart:199-209 | sdk/lib/_internal/wasm/common/simd.dart:299-309 — 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 `sdk/lib/_internal/wasm/common/simd.dart:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) pkg/front_end/lib/src/builder/dynamic_type_declaration_builder.dart:16 — pkg/front_end/lib/src/builder/dynamic_type_declaration_builder.dart:16-23 | pkg/front_end/lib/src/builder/invalid_builder.dart:96-105 | pkg/front_end/lib/src/builder/null_type_declaration_builder.dart:48-56 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) pkg/linter/lib/src/rules/avoid_catches_without_on_clauses.dart:30 — pkg/linter/lib/src/rules/avoid_catches_without_on_clauses.dart:30-37 | pkg/linter/lib/src/rules/avoid_catching_errors.dart:27-34 | pkg/linter/lib/src/rules/empty_catches.dart:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) pkg/linter/lib/src/rules/exhaustive_cases.dart:26 — pkg/linter/lib/src/rules/exhaustive_cases.dart:26-33 | pkg/linter/lib/src/rules/no_default_cases.dart:32-39 | pkg/linter/lib/src/rules/no_duplicate_case_values.dart:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) pkg/linter/lib/src/rules/library_names.dart:24 — pkg/linter/lib/src/rules/library_names.dart:24-31 | pkg/linter/lib/src/rules/package_prefixed_library_names.dart:25-32 | pkg/linter/lib/src/rules/unnecessary_library_directive.dart:26-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) pkg/linter/lib/src/rules/only_throw_errors.dart:39 — pkg/linter/lib/src/rules/only_throw_errors.dart:39-46 | pkg/linter/lib/src/rules/throw_in_finally.dart:24-31 | pkg/linter/lib/src/rules/use_rethrow_when_possible.dart:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) pkg/linter/lib/src/rules/prefer_if_elements_to_conditional_expressions.dart:28 — pkg/linter/lib/src/rules/prefer_if_elements_to_conditional_expressions.dart:28-35 | pkg/linter/lib/src/rules/prefer_if_null_operators.dart:24-31 | pkg/linter/lib/src/rules/prefer_null_aware_operators.dart:25-32 — 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 (8 lines × 3) pkg/linter/lib/src/rules/sized_box_for_whitespace.dart:36 — pkg/linter/lib/src/rules/sized_box_for_whitespace.dart:36-43 | pkg/linter/lib/src/rules/use_colored_box.dart:37-44 | pkg/linter/lib/src/rules/use_decorated_box.dart:36-43 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:371 — sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:371-378 | sdk/lib/_internal/js_runtime/lib/convert_patch.dart:375-382 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1415-1422 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart` and `sdk/lib/_internal/js_runtime/lib/convert_patch.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (8 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:464 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:464-471 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:460-467 | sdk/lib/_internal/wasm/common/io_patch.dart:460-467 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 (8 lines × 3) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:227 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:227-234 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart:146-153 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:253-260 — 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 `sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:227` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/vm/lib/convert_patch.dart:218 — sdk/lib/_internal/vm/lib/convert_patch.dart:218-225 | sdk/lib/_internal/wasm/common/convert_patch.dart:271-278 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:184-191 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 (8 lines × 3) REDACTED:1703 — REDACTED:1703-1710 | REDACTED:1904-1911 | REDACTED:2042-2049 — 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 `REDACTED:1703` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×15
  • Edited copy of a member (34 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1305 — pkg/compiler/lib/src/js/rewrite_async.dart:1305-1338 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1361-1398 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:511 — pkg/observatory/lib/src/elements/heap_snapshot.dart:511-553 | pkg/observatory/lib/src/elements/process_snapshot.dart:248-281 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:136 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:136-169 | pkg/dds/lib/src/devtools/memory_profile.dart:154-200 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:8196 — pkg/analyzer/lib/src/dart/ast/ast.dart:8196-8229 | pkg/analyzer/lib/src/dart/ast/ast.dart:8456-8490 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/keyword_state.dart:45 — pkg/_fe_analyzer_shared/lib/src/scanner/keyword_state.dart:45-78 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/keyword_state.dart:12-48 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/dart2wasm/lib/dynamic_dispatchers.dart:99 — pkg/dart2wasm/lib/dynamic_dispatchers.dart:99-132 | pkg/dart2wasm/lib/dynamic_dispatchers.dart:134-176 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:240 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:240-274 | sdk/lib/_internal/js_runtime/lib/js_number.dart:277-310 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/analyzer/lib/src/error/element_usage_detector.dart:433 — pkg/analyzer/lib/src/error/element_usage_detector.dart:433-466 | pkg/analyzer/lib/src/error/element_usage_detector.dart:914-951 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/dart2wasm/lib/code_generator.dart:3069 — pkg/dart2wasm/lib/code_generator.dart:3069-3103 | pkg/dart2wasm/lib/code_generator.dart:3174-3207 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608-1665 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1225-1258 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/compiler/lib/src/ir/impact_data.dart:633 — pkg/compiler/lib/src/ir/impact_data.dart:633-666 | pkg/compiler/lib/src/ir/impact_data.dart:739-774 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2991 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2991-3028 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3126-3159 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:4986 — pkg/front_end/lib/src/kernel/body_builder.dart:4986-5019 | pkg/front_end/lib/src/source/outline_builder.dart:3256-3294 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/analyzer/lib/src/summary2/variance_builder.dart:153 — pkg/analyzer/lib/src/summary2/variance_builder.dart:153-186 | pkg/analyzer/lib/src/summary2/variance_builder.dart:188-225 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4482 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:4482-4515 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:4517-4550 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×15
  • Edited copies of one member (3 members, 12+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:39 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:39-52 | sdk/lib/_internal/js_runtime/lib/js_string.dart:36-48 | sdk/lib/_internal/vm/lib/string_patch.dart:917-928 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:68 — sdk/lib/_internal/vm_shared/lib/integers_patch.dart:68-86 | sdk/lib/_internal/vm_shared/lib/integers_patch.dart:128-139 | sdk/lib/_internal/wasm/common/int_patch.dart:32-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/analysis_server/lib/protocol/protocol.dart:165 — pkg/analysis_server/lib/protocol/protocol.dart:165-176 | pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:137-154 | pkg/analyzer_plugin/lib/protocol/protocol.dart:167-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/compiler/lib/src/elements/types.dart:1090 — pkg/compiler/lib/src/elements/types.dart:1090-1101 | pkg/compiler/lib/src/elements/types.dart:1247-1259 | pkg/compiler/lib/src/elements/types.dart:1270-1281 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:178 — pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:178-189 | pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:191-202 | pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:204-215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/linter/lib/src/rules/avoid_positional_boolean_parameters.dart:30 — pkg/linter/lib/src/rules/avoid_positional_boolean_parameters.dart:30-41 | pkg/linter/lib/src/rules/parameter_assignments.dart:35-46 | pkg/linter/lib/src/rules/type_annotate_public_apis.dart:31-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:1659 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:1659-1670 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1672-1684 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1686-1698 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:781 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:781-792 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:995-1007 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1022-1034 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:5901 — pkg/analyzer/lib/src/dart/ast/ast.dart:5901-5913 | pkg/analyzer/lib/src/dart/ast/ast.dart:12595-12606 | pkg/analyzer/lib/src/dart/ast/ast.dart:23333-23344 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/front_end/lib/src/base/incremental_compiler.dart:211 — pkg/front_end/lib/src/base/incremental_compiler.dart:211-225 | pkg/front_end/lib/src/base/incremental_compiler.dart:228-242 | pkg/front_end/lib/src/base/incremental_compiler.dart:245-256 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:31437 — pkg/analyzer/lib/src/dart/ast/ast.dart:31437-31450 | pkg/analyzer/lib/src/dart/ast/ast.dart:57431-57442 | pkg/analyzer/lib/src/dart/ast/ast.dart:58003-58015 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:147 — pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:147-158 | pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:319-335 | pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:355-369 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:3061 — pkg/analyzer/lib/src/fasta/ast_builder.dart:3061-3072 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3613-3627 | pkg/analyzer/lib/src/fasta/ast_builder.dart:5184-5200 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart:24 — pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart:24-38 | pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart:26-37 | pkg/front_end/testcases/late_lowering/late_nullable_field_without_initializer.dart:24-38 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) pkg/test_runner/lib/src/command_output.dart:687 — pkg/test_runner/lib/src/command_output.dart:687-713 | pkg/test_runner/lib/src/command_output.dart:798-809 | pkg/test_runner/lib/src/command_output.dart:1135-1150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×15
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/compiler/lib/src/js_model/closure.dart:1234 — pkg/compiler/lib/src/js_model/closure.dart:1234-1242 | pkg/compiler/lib/src/js_model/closure.dart:1298-1308 | pkg/compiler/lib/src/js_model/records.dart:381-389 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1370 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1370-1378 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1405-1413 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1429-1437 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:348 — pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:348-362 | pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:364-374 | pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:384-392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) runtime/tools/heapsnapshot/lib/src/expression.dart:128 — runtime/tools/heapsnapshot/lib/src/expression.dart:128-139 | runtime/tools/heapsnapshot/lib/src/expression.dart:147-155 | runtime/tools/heapsnapshot/lib/src/expression.dart:164-175 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/dart2wasm/lib/await_transformer.dart:975 — pkg/dart2wasm/lib/await_transformer.dart:975-983 | pkg/dart2wasm/lib/await_transformer.dart:985-993 | pkg/dart2wasm/lib/await_transformer.dart:1005-1013 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:580 — sdk/lib/_internal/vm/lib/growable_array.dart:580-588 | sdk/lib/_internal/vm/lib/growable_array.dart:590-599 | sdk/lib/_internal/vm/lib/growable_array.dart:601-611 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:357 — pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:357-365 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1452-1462 | pkg/observatory/lib/src/elements/process_snapshot.dart:560-568 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:923 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:923-931 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1041-1049 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1158-1166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/native_compiler/lib/snapshot/snapshot.dart:1827 — pkg/native_compiler/lib/snapshot/snapshot.dart:1827-1836 | pkg/native_compiler/lib/snapshot/snapshot.dart:1872-1881 | pkg/native_compiler/lib/snapshot/snapshot.dart:2148-2156 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1751 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1751-1760 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3751-3767 | pkg/analyzer/lib/src/fasta/ast_builder.dart:5060-5068 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) sdk/lib/collection/list.dart:48 — sdk/lib/collection/list.dart:48-56 | sdk/lib/internal/iterable.dart:46-54 | sdk/lib/internal/list.dart:251-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3041 — pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3041-3049 | pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:198-208 | pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:210-220 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) sdk/lib/_internal/vm/lib/growable_array.dart:32 — sdk/lib/_internal/vm/lib/growable_array.dart:32-40 | sdk/lib/_internal/wasm/common/list.dart:552-560 | sdk/lib/collection/list.dart:258-266 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/linter/lib/src/rules/leading_newlines_in_multiline_strings.dart:28 — pkg/linter/lib/src/rules/leading_newlines_in_multiline_strings.dart:28-37 | pkg/linter/lib/src/rules/prefer_double_quotes.dart:26-34 | pkg/linter/lib/src/rules/prefer_single_quotes.dart:26-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) pkg/linter/lib/src/rules/avoid_field_initializers_in_const_classes.dart:30 — pkg/linter/lib/src/rules/avoid_field_initializers_in_const_classes.dart:30-38 | pkg/linter/lib/src/rules/overridden_fields.dart:26-34 | pkg/linter/lib/src/rules/prefer_const_declarations.dart:25-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×15
  • Duplicated block (17–18 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:109 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:109-126 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:171-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:56 — pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:56-72 | pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart:77-94 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart` and `pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 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 `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:56` 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 `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 (17–18 lines × 2) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:196 — pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:196-212 | pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:216-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) pkg/dart2wasm/lib/functions.dart:635 — pkg/dart2wasm/lib/functions.dart:635-651 | pkg/dart2wasm/lib/functions.dart:692-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/functions.dart:635` it does not close everything it opens, so those 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, `pkg/dart2wasm/lib/functions.dart:691` calls `getConstructorInfo` and `pkg/dart2wasm/lib/functions.dart:634` 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–18 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:27 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:27-43 | pkg/dds/lib/src/devtools/memory_profile.dart:30-47 — before extracting anything, compare `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart` and `pkg/dds/lib/src/devtools/memory_profile.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 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 `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:27` it does not close everything it opens, so those exact lines 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–18 lines × 2) pkg/dartdev/lib/src/commands/run.dart:584 — pkg/dartdev/lib/src/commands/run.dart:584-601 | pkg/dartdev/lib/src/commands/test.dart:74-90 — 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 `pkg/dartdev/lib/src/commands/run.dart:584` it does not close everything it opens, so those exact lines 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–18 lines × 2) pkg/front_end/lib/src/base/name_space.dart:80 — pkg/front_end/lib/src/base/name_space.dart:80-97 | pkg/front_end/lib/src/base/name_space.dart:123-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/base/name_space.dart:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) pkg/front_end/lib/src/fragment/field/declaration.dart:705 — pkg/front_end/lib/src/fragment/field/declaration.dart:705-722 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:235-251 — before extracting anything, compare `pkg/front_end/lib/src/fragment/field/declaration.dart` and `pkg/front_end/lib/src/fragment/primary_constructor_field.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 `pkg/front_end/lib/src/fragment/field/declaration.dart:705` it does not close everything it opens, so those 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) pkg/front_end/lib/src/fragment/field/encoding.dart:1230 — pkg/front_end/lib/src/fragment/field/encoding.dart:1230-1246 | pkg/front_end/lib/src/fragment/field/encoding.dart:1509-1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/field/encoding.dart:1230` it does not close everything it opens, so those exact lines 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–18 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:7461 — pkg/front_end/lib/src/kernel/body_builder.dart:7461-7478 | pkg/front_end/lib/src/kernel/body_builder.dart:7566-7582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:7461` 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–18 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:10381 — pkg/front_end/lib/src/kernel/body_builder.dart:10381-10397 | pkg/front_end/lib/src/kernel/body_builder.dart:10459-10476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:10381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17–18 lines × 2) pkg/front_end/lib/src/source/source_class_builder.dart:1604 — pkg/front_end/lib/src/source/source_class_builder.dart:1604-1620 | pkg/front_end/lib/src/source/source_class_builder.dart:1692-1709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/source_class_builder.dart:1604` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17–18 lines × 2) pkg/kernel/lib/binary/ast_to_binary.dart:2918 — pkg/kernel/lib/binary/ast_to_binary.dart:2918-2934 | pkg/kernel/lib/binary/ast_to_binary.dart:2966-2983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/binary/ast_to_binary.dart:2918` 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–18 lines × 2) pkg/kernel/lib/src/tool/check_equivalence.dart:296 — pkg/kernel/lib/src/tool/check_equivalence.dart:296-313 | pkg/kernel/lib/src/tool/check_equivalence.dart:365-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/src/tool/check_equivalence.dart:296` 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 `node` to `Library` in one and `Class` 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 (17–18 lines × 2) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:657 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:657-673 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2156-2173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2156` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×15
  • Duplicated block (13–14 lines × 2) pkg/analyzer/lib/src/dart/analysis/driver.dart:1885 — pkg/analyzer/lib/src/dart/analysis/driver.dart:1885-1898 | pkg/analyzer/lib/src/dart/analysis/driver.dart:2093-2105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) pkg/analyzer/lib/src/dart/analysis/library_context.dart:604 — pkg/analyzer/lib/src/dart/analysis/library_context.dart:604-616 | pkg/analyzer/lib/src/dart/analysis/library_diagnostics.dart:55-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:956 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:956-969 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1141-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) pkg/analyzer/lib/src/generated/error_verifier.dart:1007 — pkg/analyzer/lib/src/generated/error_verifier.dart:1007-1019 | pkg/analyzer/lib/src/generated/error_verifier.dart:1138-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/generated/error_verifier.dart:1007` it does not close everything it opens, so those 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 `node` to `covariant EnumDeclaration2Impl` in one and `covariant ExtensionTypeDeclaration2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/generated/error_verifier.dart:1020` calls `_checkForEnumWithNameValues` and `pkg/analyzer/lib/src/generated/error_verifier.dart:1152` 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 (13–14 lines × 2) pkg/analyzer/lib/src/summary2/element_builder.dart:1368 — pkg/analyzer/lib/src/summary2/element_builder.dart:1368-1380 | pkg/analyzer/lib/src/summary2/element_builder.dart:1670-1683 — both copies are in the same file, so extract the 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 `node` to `covariant ClassDeclaration2Impl` in one and `covariant ExtensionTypeDeclaration2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/summary2/element_builder.dart:1383` calls `accept2` and `pkg/analyzer/lib/src/summary2/element_builder.dart:1686` 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–14 lines × 2) pkg/compiler/lib/src/inferrer/builder.dart:1195 — pkg/compiler/lib/src/inferrer/builder.dart:1195-1207 | pkg/compiler/lib/src/inferrer/builder.dart:1212-1225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/inferrer/builder.dart:1212` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ir.InstanceInvocation` in one and `ir.InstanceGetterInvocation` 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–14 lines × 2) pkg/compiler/lib/src/js_backend/string_reference.dart:386 — pkg/compiler/lib/src/js_backend/string_reference.dart:386-398 | pkg/compiler/lib/src/js_backend/type_reference.dart:451-464 — 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 `pkg/compiler/lib/src/js_backend/string_reference.dart:386` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) pkg/dart2wasm/lib/async.dart:392 — pkg/dart2wasm/lib/async.dart:392-405 | pkg/dart2wasm/lib/sync_star.dart:295-307 — before extracting anything, compare `pkg/dart2wasm/lib/async.dart` and `pkg/dart2wasm/lib/sync_star.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 `pkg/dart2wasm/lib/async.dart:392` it does not close everything it opens, so those 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `AwaitExpression` in one and `YieldStatement` 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–14 lines × 2) pkg/front_end/lib/src/builder/named_type_builder.dart:1167 — pkg/front_end/lib/src/builder/named_type_builder.dart:1167-1179 | pkg/front_end/lib/src/builder/named_type_builder.dart:1195-1208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) pkg/front_end/lib/src/codes/type_labeler.dart:518 — pkg/front_end/lib/src/codes/type_labeler.dart:518-530 | pkg/front_end/lib/src/codes/type_labeler.dart:536-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/codes/type_labeler.dart:536` 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 `node` to `ConstructorTearOffConstant` in one and `RedirectingFactoryTearOffConstant` 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–14 lines × 2) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:723 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:723-736 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:755-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/native_compiler/lib/back_end/arm64/code_generator.dart:723` it does not close everything it opens, so those 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 `instr` to `InterfaceCall` in one and `DynamicCall` 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–14 lines × 2) pkg/observatory/lib/src/elements/field_ref.dart:59 — pkg/observatory/lib/src/elements/field_ref.dart:59-71 | pkg/observatory/lib/src/elements/field_view.dart:108-121 — 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 `pkg/observatory/lib/src/elements/field_ref.dart: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) pkg/observatory/lib/src/elements/script_inset.dart:416 — pkg/observatory/lib/src/elements/script_inset.dart:416-428 | pkg/observatory/lib/src/elements/script_inset.dart:431-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) pkg/observatory/lib/src/sample_profile/sample_profile.dart:155 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:155-167 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:474-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/sample_profile/sample_profile.dart:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `CodeCallTreeNode` in one and `FunctionCallTreeNode` 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–14 lines × 2) pkg/wasm_builder/lib/src/ir/element.dart:51 — pkg/wasm_builder/lib/src/ir/element.dart:51-64 | pkg/wasm_builder/lib/src/ir/element.dart:113-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/wasm_builder/lib/src/ir/element.dart:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×14
  • Edited copy of a member (36 corresponding lines) pkg/analyzer/lib/src/utilities/string_search.dart:87 — pkg/analyzer/lib/src/utilities/string_search.dart:87-123 | pkg/analyzer/lib/src/utilities/string_search.dart:125-161 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/front_end/lib/src/fragment/constructor/encoding.dart:924 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:924-970 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1022-1065 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:246 — sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:246-281 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:215-251 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/observatory/lib/src/service/object.dart:1982 — pkg/observatory/lib/src/service/object.dart:1982-2019 | pkg/observatory/lib/src/service/object.dart:2021-2056 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:179 — pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:179-234 | pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:487-522 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:896 — pkg/compiler/lib/src/js/rewrite_async.dart:896-931 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:911-946 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:317 — sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:317-353 | sdk/lib/_internal/js_runtime/lib/math_patch.dart:308-343 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:1183 — pkg/front_end/lib/src/kernel/body_builder.dart:1183-1218 | pkg/front_end/lib/src/kernel/body_builder.dart:8622-8657 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:446 — pkg/compiler/lib/src/js/size_estimator.dart:446-481 | pkg/js_ast/lib/src/printer.dart:734-779 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3030 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3030-3065 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3161-3199 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:759 — sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:759-794 | sdk/lib/_internal/js_runtime/lib/async_patch.dart:526-562 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/analyzer/lib/src/dart/element/type_constraint_gatherer.dart:214 — pkg/analyzer/lib/src/dart/element/type_constraint_gatherer.dart:214-249 | pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart:119-156 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1998 — pkg/vm/lib/transformations/type_flow/summary_collector.dart:1998-2035 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:2752-2787 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1174 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1174-1209 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:1499-1535 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×14
  • Edited copy of a member (37 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:389 — pkg/observatory/lib/src/elements/heap_snapshot.dart:389-425 | pkg/observatory/lib/src/elements/process_snapshot.dart:116-152 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/front_end/lib/src/source/diet_listener.dart:389 — pkg/front_end/lib/src/source/diet_listener.dart:389-425 | pkg/front_end/lib/src/source/diet_listener.dart:852-890 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:643 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:643-679 | sdk/lib/_internal/wasm/common/errors_patch.dart:164-202 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) sdk/lib/_internal/vm/lib/mirrors_impl.dart:545 — sdk/lib/_internal/vm/lib/mirrors_impl.dart:545-581 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:584-627 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:986 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:986-1022 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:1283-1324 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/front_end/lib/src/source/fragment_factory_impl.dart:1032 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:1032-1068 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:1131-1171 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/dart2wasm/lib/translator.dart:2600 — pkg/dart2wasm/lib/translator.dart:2600-2636 | pkg/dart2wasm/lib/translator.dart:2694-2735 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/front_end/lib/src/fragment/field/encoding.dart:875 — pkg/front_end/lib/src/fragment/field/encoding.dart:875-914 | pkg/front_end/lib/src/fragment/field/encoding.dart:916-952 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/analyzer/lib/src/dart/resolver/for_resolver.dart:27 — pkg/analyzer/lib/src/dart/resolver/for_resolver.dart:27-63 | pkg/analyzer/lib/src/dart/resolver/for_resolver.dart:65-101 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_case_statement.dart:76 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_case_statement.dart:76-112 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_case_statement.dart:114-155 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/front_end/lib/src/type_inference/body_inference_context.dart:881 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:881-917 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:1049-1086 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:453 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:453-489 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:577-615 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4952 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:4952-4988 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5072-5111 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) pkg/analysis_server/lib/src/server/error_notifier.dart:15 — pkg/analysis_server/lib/src/server/error_notifier.dart:15-51 | pkg/analysis_server/lib/src/session_logger/user_notifying_session_listener.dart:33-69 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×14
  • Edited copy of a member (27 corresponding lines) pkg/vm/lib/transformations/type_flow/types.dart:970 — pkg/vm/lib/transformations/type_flow/types.dart:970-996 | pkg/vm/lib/transformations/type_flow/types.dart:998-1028 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:616 — pkg/compiler/lib/src/js_model/element_map_impl.dart:616-643 | pkg/compiler/lib/src/kernel/element_map_impl.dart:291-317 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1721 — pkg/compiler/lib/src/ssa/codegen_helpers.dart:1721-1747 | pkg/compiler/lib/src/ssa/codegen_helpers.dart:1749-1780 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:164 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:164-191 | sdk/lib/_internal/js_runtime/lib/js_array.dart:244-270 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:128 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:128-157 | sdk/lib/_internal/js_runtime/lib/js_string.dart:116-142 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/analysis_server/lib/src/status/pages/ast_page.dart:24 — pkg/analysis_server/lib/src/status/pages/ast_page.dart:24-50 | pkg/analysis_server/lib/src/status/pages/element_model_page.dart:29-63 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:1194 — pkg/analyzer/lib/src/dart/constant/value.dart:1194-1220 | pkg/analyzer/lib/src/dart/constant/value.dart:2195-2223 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1224 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1224-1253 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1908-1934 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/front_end/lib/src/kernel/resolver.dart:1213 — pkg/front_end/lib/src/kernel/resolver.dart:1213-1239 | pkg/front_end/lib/src/kernel/resolver_helpers.dart:35-61 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:661 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:661-687 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:874-900 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1263 — pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1263-1299 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1362-1388 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:7067 — pkg/analyzer/lib/src/fasta/ast_builder.dart:7067-7093 | pkg/analyzer/lib/src/fasta/ast_builder.dart:7114-7146 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/front_end/lib/src/type_inference/element_inference.dart:677 — pkg/front_end/lib/src/type_inference/element_inference.dart:677-703 | pkg/front_end/lib/src/type_inference/element_inference.dart:720-750 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) pkg/front_end/lib/src/source/fragment_factory_impl.dart:1103 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:1103-1129 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:2253-2280 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×14
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/kernel/lib/src/ast/types.dart:1344 — pkg/kernel/lib/src/ast/types.dart:1344-1360 | pkg/kernel/lib/src/ast/types.dart:1703-1722 | pkg/kernel/lib/src/ast/types.dart:1965-1984 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/compiler/lib/src/js_model/env.dart:801 — pkg/compiler/lib/src/js_model/env.dart:801-817 | pkg/compiler/lib/src/js_model/env.dart:1036-1052 | pkg/compiler/lib/src/js_model/env.dart:1082-1102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/wasm_builder/lib/src/serialize/sections.dart:1166 — pkg/wasm_builder/lib/src/serialize/sections.dart:1166-1182 | pkg/wasm_builder/lib/src/serialize/sections.dart:1215-1234 | pkg/wasm_builder/lib/src/serialize/sections.dart:1274-1290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/compiler/lib/src/ir/scope_visitor.dart:1164 — pkg/compiler/lib/src/ir/scope_visitor.dart:1164-1182 | pkg/compiler/lib/src/ir/scope_visitor.dart:1184-1200 | pkg/compiler/lib/src/ir/scope_visitor.dart:1202-1218 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/compiler/lib/src/js_model/closure.dart:1176 — pkg/compiler/lib/src/js_model/closure.dart:1176-1192 | pkg/compiler/lib/src/js_model/elements.dart:296-312 | pkg/compiler/lib/src/js_model/elements.dart:350-368 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/analyzer/lib/src/summary2/bundle_writer.dart:192 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:192-208 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:629-646 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:792-810 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:25106 — pkg/analyzer/lib/src/dart/ast/ast.dart:25106-25122 | pkg/analyzer/lib/src/dart/ast/ast.dart:25361-25379 | pkg/analyzer/lib/src/dart/ast/ast.dart:25586-25602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:200 — pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:200-217 | pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:225-241 | pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:251-267 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/observatory/lib/src/elements/debugger.dart:2065 — pkg/observatory/lib/src/elements/debugger.dart:2065-2081 | pkg/observatory/lib/src/elements/debugger.dart:2550-2568 | pkg/observatory/lib/src/elements/debugger.dart:2900-2916 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart:65 — pkg/analysis_server/lib/src/lsp/channel/lsp_byte_stream_channel.dart:65-83 | pkg/dap_adapters/lib/src/protocol_stream.dart:47-64 | pkg/dartpad_worker/lib/src/tools/language_server.dart:112-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:780 — pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:780-796 | pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:1090-1108 | pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:1273-1289 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/analysis_server/lib/src/channel/byte_stream_channel.dart:127 — pkg/analysis_server/lib/src/channel/byte_stream_channel.dart:127-146 | pkg/analysis_server/lib/src/channel/byte_stream_channel.dart:148-164 | pkg/analysis_server/lib/src/channel/byte_stream_channel.dart:166-183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/front_end/lib/src/type_inference/type_inferrer.dart:612 — pkg/front_end/lib/src/type_inference/type_inferrer.dart:612-632 | pkg/front_end/lib/src/type_inference/type_inferrer.dart:662-679 | pkg/front_end/lib/src/type_inference/type_inferrer.dart:695-711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:1343 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:1343-1361 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1517-1534 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:1757-1773 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×14
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/dart2bytecode/lib/assembler.dart:206 — pkg/dart2bytecode/lib/assembler.dart:206-218 | pkg/dart2bytecode/lib/assembler.dart:220-238 | pkg/dart2bytecode/lib/assembler.dart:240-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:69 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:69-82 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart:69-82 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_set.dart:84-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:999 — sdk/lib/_internal/vm/lib/convert_patch.dart:999-1011 | sdk/lib/_internal/wasm/common/convert_patch.dart:1080-1092 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:939-951 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/dev_compiler/lib/src/js_ast/nodes.dart:2504 — pkg/dev_compiler/lib/src/js_ast/nodes.dart:2504-2516 | pkg/dev_compiler/lib/src/js_ast/nodes.dart:2518-2540 | pkg/dev_compiler/lib/src/js_ast/nodes.dart:2552-2564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/observatory/lib/src/elements/inbound_references.dart:63 — pkg/observatory/lib/src/elements/inbound_references.dart:63-77 | pkg/observatory/lib/src/elements/retaining_path.dart:62-76 | pkg/observatory/lib/src/elements/strongly_reachable_instances.dart:69-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:122 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:122-134 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:246-259 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1530-1542 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/compiler/lib/src/ssa/types_propagation.dart:236 — pkg/compiler/lib/src/ssa/types_propagation.dart:236-253 | pkg/compiler/lib/src/ssa/types_propagation.dart:453-465 | pkg/compiler/lib/src/ssa/types_propagation.dart:500-517 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/debugger.dart:508 — sdk/lib/_internal/js_dev_runtime/private/debugger.dart:508-526 | sdk/lib/_internal/js_dev_runtime/private/debugger.dart:528-540 | sdk/lib/_internal/js_dev_runtime/private/debugger.dart:542-555 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:75 — pkg/kernel/lib/src/ast/expressions.dart:75-87 | pkg/kernel/lib/src/ast/expressions.dart:89-103 | pkg/kernel/lib/src/ast/expressions.dart:105-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:7033 — pkg/analyzer/lib/src/dart/ast/ast.dart:7033-7045 | pkg/analyzer/lib/src/dart/ast/ast.dart:23497-23512 | pkg/analyzer/lib/src/dart/ast/ast.dart:29636-29648 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/kernel/lib/text/ast_to_text.dart:2057 — pkg/kernel/lib/text/ast_to_text.dart:2057-2069 | pkg/kernel/lib/text/ast_to_text.dart:2071-2083 | pkg/kernel/lib/text/ast_to_text.dart:2085-2097 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:13131 — pkg/analyzer/lib/src/dart/ast/ast.dart:13131-13144 | pkg/analyzer/lib/src/dart/ast/ast.dart:36527-36540 | pkg/analyzer/lib/src/dart/ast/ast.dart:36542-36554 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) sdk/lib/_http/http_parser.dart:344 — sdk/lib/_http/http_parser.dart:344-356 | sdk/lib/io/secure_server_socket.dart:229-241 | sdk/lib/io/secure_socket.dart:762-775 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:1437 — pkg/kernel/lib/binary/ast_from_binary.dart:1437-1449 | pkg/kernel/lib/binary/ast_from_binary.dart:1862-1875 | pkg/kernel/lib/binary/ast_from_binary.dart:2089-2102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×14
  • Duplicated block (24 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:508 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:508-531 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1172-1195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (24 lines × 2) pkg/analyzer/lib/src/fine/library_manifest.dart:1918 — pkg/analyzer/lib/src/fine/library_manifest.dart:1918-1941 | pkg/analyzer/lib/src/fine/library_manifest.dart:1974-1997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fine/library_manifest.dart:1918` 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 (24 lines × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:620 — pkg/compiler/lib/src/js_model/element_map_impl.dart:620-643 | pkg/compiler/lib/src/kernel/element_map_impl.dart:294-317 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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 `pkg/compiler/lib/src/js_model/element_map_impl.dart:620` 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 `data` to `JClassData` in one and `KClassData` 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 (24 lines × 2) pkg/compiler/lib/src/serialization/strategies.dart:145 — pkg/compiler/lib/src/serialization/strategies.dart:145-168 | pkg/compiler/lib/src/serialization/strategies.dart:238-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. 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) pkg/dev_compiler/lib/src/js_ast/template.dart:74 — pkg/dev_compiler/lib/src/js_ast/template.dart:74-97 | pkg/js_ast/lib/src/template.dart:72-95 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/template.dart` and `pkg/js_ast/lib/src/template.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:2665 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2665-2688 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2975-2998 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:2665` it does not close everything it opens, so those exact lines 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:6153 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6153-6176 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6842-6865 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6153` it does not close everything it opens, so those 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 (24 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8190 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8190-8213 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9059-9082 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (24 lines × 2) pkg/front_end/lib/src/fragment/constructor/encoding.dart:937 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:937-960 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1035-1058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/constructor/encoding.dart:937` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `declarationBuilder` to `SourceExtensionTypeDeclarationBuilder` in one and `DeclarationBuilder` 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 (24 lines × 2) pkg/front_end/lib/src/type_inference/object_access_target.dart:1255 — pkg/front_end/lib/src/type_inference/object_access_target.dart:1255-1278 | pkg/front_end/lib/src/type_inference/object_access_target.dart:1282-1305 — both copies are in the same file, so extract the 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 (24 lines × 2) sdk/lib/_http/http_impl.dart:1070 — sdk/lib/_http/http_impl.dart:1070-1093 | sdk/lib/io/io_sink.dart:233-256 — before extracting anything, compare `sdk/lib/_http/http_impl.dart` and `sdk/lib/io/io_sink.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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 `sdk/lib/_http/http_impl.dart:1070` it does not close everything it opens, so those exact lines 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) sdk/lib/internal/sort.dart:268 — sdk/lib/internal/sort.dart:268-291 | sdk/lib/internal/sort.dart:362-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/internal/sort.dart:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:226 — sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:226-249 | sdk/lib/_internal/js_runtime/lib/convert_patch.dart:226-249 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart` and `sdk/lib/_internal/js_runtime/lib/convert_patch.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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) pkg/front_end/testcases/dart2js/issue54115.dart:9 — pkg/front_end/testcases/dart2js/issue54115.dart:9-32 | pkg/front_end/testcases/patterns/issue54115.dart:9-32 — `pkg/front_end/testcases/dart2js/issue54115.dart` and `pkg/front_end/testcases/patterns/issue54115.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 24 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×14
  • Recursive walk over a caller-supplied document has no depth cap sdk/lib/html/html_common/conversions_dart2js.dart:53 — `convertDartToNative_Dictionary` is public, takes a document from its caller (line 65) and hands it to `_convertDartToNative_Value`, which calls itself at line 53 (`_convertDartToNative_Value`) with a piece of `value` — and nowhere in `_convertDartToNative_Value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_convertDartToNative_Value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap sdk/lib/_internal/js_shared/lib/js_util_patch.dart:55 — `jsify` is public, takes a document from its caller (line 37) and hands it to `_convert`, which calls itself at line 55 (`_convert`) with a piece of `o` (and at line 61) — and nowhere in `_convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap sdk/lib/_internal/js_shared/lib/js_util_patch.dart:703 — `dartify` is public and takes `Object ? o` from its caller, and it calls itself at line 703 (`dartify`) with a piece of `o` — and nowhere in `dartify` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `dartify` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap sdk/lib/_internal/js_shared/lib/js_util_patch.dart:721 — `dartify` is public, takes a document from its caller (line 666) and hands it to `convert`, which calls itself at line 721 (`convert`) with a piece of `o` — and nowhere in `convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/vm_service/lib/src/vm_service.dart:47 — `createServiceObject` is public and takes `Object ? json` from its caller, and it calls itself at line 47 (`createServiceObject`) with a piece of `json` — and nowhere in `createServiceObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `createServiceObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/vm/testcases/transformations/type_flow/transformer/records.dart:32 — `wrapRecord` is public and takes `dynamic x` from its caller, and it calls itself at line 32 (`wrapRecord`) with a piece of `x` — and nowhere in `wrapRecord` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `wrapRecord` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/vm/testcases/transformations/type_flow/summary_collector/vars.dart:31 — `loop1` is public and takes `Object a1` from its caller, and it calls itself at line 31 (`loop1`) with a piece of `a1` — and nowhere in `loop1` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `loop1` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/vm/lib/testing/il_matchers.dart:211 — `formatInstruction` is public, takes a document from its caller (line 227) and hands it to `_formatInternal`, which calls itself at line 211 (`_formatInternal`) with a piece of `instr` — and nowhere in `_formatInternal` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_formatInternal` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/vm/lib/native_assets/json_to_kernel_constant.dart:27 — `jsonToKernelConstant` is public and takes `Object jsonObject` from its caller, and it calls itself at line 27 (`jsonToKernelConstant`) with a piece of `jsonObject` (and at line 40, line 41) — and nowhere in `jsonToKernelConstant` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `jsonToKernelConstant` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/native_compiler/lib/snapshot/snapshot.dart:303 — `preprocess` is public and takes `Object ? obj` from its caller, and it calls itself at line 303 (`preprocess`) with a piece of `obj` (and at line 321, line 324) — and nowhere in `preprocess` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `preprocess` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/expect/lib/expect.dart:769 — `deepEquals` is public, takes a document from its caller (line 723) and hands it to `_deepEquals`, which calls itself at line 769 (`_deepEquals`) with a piece of `expected` (and at line 795) — and nowhere in `_deepEquals` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_deepEquals` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/compiler/lib/src/tracer.dart:100 — `formatPrty` is public and takes `Object ? x` from its caller, and it calls itself at line 100 (`formatPrty`) with a piece of `x` — and nowhere in `formatPrty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `formatPrty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/analysis_server/lib/src/status/utilities/tree_writer.dart:98 — `writeProperty` is public, takes a document from its caller (line 47) and hands it to `_writePropertyValue`, which calls itself at line 98 (`_writePropertyValue`) with a piece of `value` — and nowhere in `_writePropertyValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_writePropertyValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap pkg/analysis_server/lib/src/session_logger/log_normalizer.dart:201 — `normalize` is public, takes a document from its caller (line 166) and hands it to `_canonicalizeObject`, which calls itself at line 201 (`_canonicalizeObject`) with a piece of `value` (and at line 207) — and nowhere in `_canonicalizeObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `_canonicalizeObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×14
  • Swallowed exception (caught, then discarded) sdk/lib/_internal/vm/lib/isolate_patch.dart:713 — `catch (e)` 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) sdk/lib/_internal/js_dev_runtime/private/debugger.dart:184 — `catch (e)` 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) sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart:349 — `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) pkg/vm/testcases/transformations/ffi/finalizable_late_2.dart:27 — `catch (e)` 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) pkg/perf_witness/lib/server.dart:120 — `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) pkg/perf_witness/lib/src/common.dart:42 — `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) pkg/observatory/lib/src/service/object.dart:4318 — `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) pkg/linter/lib/src/rules/avoid_web_libraries_in_flutter.dart:56 — `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) pkg/frontend_server/lib/frontend_server.dart:1383 — `catch (e)` 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) pkg/frontend_server/lib/src/resident_frontend_server.dart:347 — `catch (e)` 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) pkg/front_end/presubmit_helper_spawn.dart:102 — `catch (e)` 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) pkg/front_end/presubmit_helper_spawn.dart:126 — `catch (e)` 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) pkg/front_end/presubmit_helper_spawn.dart:150 — `catch (e)` 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) pkg/front_end/presubmit_helper_spawn.dart:172 — `catch (e)` 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.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×13
  • Members sharing a duplicated core (6 members, 50+ identical tokens) pkg/analysis_server/lib/src/protocol/protocol_internal.dart:240 — pkg/analysis_server/lib/src/protocol/protocol_internal.dart:240-253 | pkg/analysis_server/lib/src/protocol/protocol_internal.dart:284-297 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:495-508 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:536-549 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:579-592 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:619-632 — 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) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:51 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:51-155 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:46-106 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart:41-95 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_typing_temporary_missing_end_brace.dart:45-128 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_completion_after_change.dart:37-138 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_typing_temporarily_missing_end_brace_in_string_interpolation.dart:50-111 — 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) pkg/analyzer/lib/src/summary2/element_builder.dart:1355 — pkg/analyzer/lib/src/summary2/element_builder.dart:1355-1385 | pkg/analyzer/lib/src/summary2/element_builder.dart:1630-1654 | pkg/analyzer/lib/src/summary2/element_builder.dart:1661-1686 | pkg/analyzer/lib/src/summary2/element_builder.dart:1780-1807 | pkg/analyzer/lib/src/summary2/element_builder.dart:1830-1853 | pkg/analyzer/lib/src/summary2/element_builder.dart:1887-1911 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:239 — pkg/front_end/lib/src/fragment/getter/encoding.dart:239-273 | pkg/front_end/lib/src/fragment/getter/encoding.dart:505-553 | pkg/front_end/lib/src/fragment/method/encoding.dart:176-211 | pkg/front_end/lib/src/fragment/method/encoding.dart:479-532 | pkg/front_end/lib/src/fragment/setter/encoding.dart:239-274 | pkg/front_end/lib/src/fragment/setter/encoding.dart:525-573 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:275 — pkg/front_end/lib/src/fragment/getter/encoding.dart:275-328 | pkg/front_end/lib/src/fragment/getter/encoding.dart:555-628 | pkg/front_end/lib/src/fragment/method/encoding.dart:213-277 | pkg/front_end/lib/src/fragment/method/encoding.dart:534-631 | pkg/front_end/lib/src/fragment/setter/encoding.dart:276-352 | pkg/front_end/lib/src/fragment/setter/encoding.dart:575-679 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:370 — pkg/front_end/lib/src/fragment/getter/encoding.dart:370-390 | pkg/front_end/lib/src/fragment/getter/encoding.dart:670-691 | pkg/front_end/lib/src/fragment/method/encoding.dart:279-299 | pkg/front_end/lib/src/fragment/method/encoding.dart:633-654 | pkg/front_end/lib/src/fragment/setter/encoding.dart:375-395 | pkg/front_end/lib/src/fragment/setter/encoding.dart:702-723 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:392 — pkg/front_end/lib/src/fragment/getter/encoding.dart:392-410 | pkg/front_end/lib/src/fragment/getter/encoding.dart:693-730 | pkg/front_end/lib/src/fragment/method/encoding.dart:301-319 | pkg/front_end/lib/src/fragment/method/encoding.dart:656-692 | pkg/front_end/lib/src/fragment/setter/encoding.dart:397-415 | pkg/front_end/lib/src/fragment/setter/encoding.dart:725-762 — 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) pkg/front_end/lib/src/fragment/getter/encoding.dart:434 — pkg/front_end/lib/src/fragment/getter/encoding.dart:434-449 | pkg/front_end/lib/src/fragment/getter/encoding.dart:763-778 | pkg/front_end/lib/src/fragment/method/encoding.dart:366-381 | pkg/front_end/lib/src/fragment/method/encoding.dart:746-761 | pkg/front_end/lib/src/fragment/setter/encoding.dart:454-469 | pkg/front_end/lib/src/fragment/setter/encoding.dart:811-826 — 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) pkg/front_end/lib/src/kernel/expression_generator.dart:1760 — pkg/front_end/lib/src/kernel/expression_generator.dart:1760-1777 | pkg/front_end/lib/src/kernel/expression_generator.dart:1970-1987 | pkg/front_end/lib/src/kernel/expression_generator.dart:2173-2190 | pkg/front_end/lib/src/kernel/expression_generator.dart:3720-3737 | pkg/front_end/lib/src/kernel/expression_generator.dart:4177-4195 | pkg/front_end/lib/src/kernel/expression_generator.dart:5415-5432 — 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) pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:42 — pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:42-61 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:75-94 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:108-127 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:42-61 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:75-94 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:108-127 — 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) PRESUBMIT.py:110 — PRESUBMIT.py:110-196 | pkg/analysis_server/PRESUBMIT.py:34-80 | pkg/analyzer/PRESUBMIT.py:35-81 | pkg/analyzer_cli/PRESUBMIT.py:34-80 | pkg/analyzer_plugin/PRESUBMIT.py:34-80 | pkg/linter/PRESUBMIT.py:34-80 — 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) PRESUBMIT.py:200 — PRESUBMIT.py:200-256 | pkg/_fe_analyzer_shared/PRESUBMIT.py:33-67 | pkg/front_end/PRESUBMIT.py:33-67 | pkg/frontend_server/PRESUBMIT.py:33-67 | pkg/kernel/PRESUBMIT.py:33-67 | sdk/lib/PRESUBMIT.py:33-77 — 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) pkg/compiler/tool/modular_test_suite_helper.dart:256 — pkg/compiler/tool/modular_test_suite_helper.dart:256-289 | pkg/compiler/tool/modular_test_suite_helper.dart:320-350 | pkg/compiler/tool/modular_test_suite_helper.dart:377-406 | pkg/compiler/tool/modular_test_suite_helper.dart:443-474 | pkg/compiler/tool/modular_test_suite_helper.dart:506-538 | pkg/compiler/tool/modular_test_suite_helper.dart:571-603 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×13
  • Edited copy of a member (32 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088-2119 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1353-1384 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:19-50 | pkg/analysis_server/lib/src/services/snippets/dart/switch_statement.dart:19-53 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analysis_server/lib/src/computer/computer_outline.dart:344 — pkg/analysis_server/lib/src/computer/computer_outline.dart:344-375 | pkg/analysis_server/lib/src/computer/computer_outline.dart:431-462 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1104 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1104-1139 | pkg/js_ast/lib/src/builder.dart:956-987 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:470 — pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:470-502 | pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:600-631 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:1089 — pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:1089-1120 | pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:1122-1155 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analysis_server/lib/src/analysis_server.dart:1323 — pkg/analysis_server/lib/src/analysis_server.dart:1323-1354 | pkg/analysis_server/lib/src/analysis_server.dart:1356-1389 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:50536 — pkg/analyzer/lib/src/dart/ast/ast.dart:50536-50567 | pkg/analyzer/lib/src/dart/ast/ast.dart:50743-50778 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:338 — pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:338-369 | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:599-633 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/compiler/lib/src/ssa/builder.dart:6501 — pkg/compiler/lib/src/ssa/builder.dart:6501-6532 | pkg/compiler/lib/src/ssa/builder.dart:6534-6573 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:1075 — pkg/dev_compiler/lib/src/js_ast/printer.dart:1075-1106 | pkg/js_ast/lib/src/printer.dart:1215-1246 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:4439 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4439-4470 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5035-5066 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) tools/dom/scripts/systemhtml.py:1689 — tools/dom/scripts/systemhtml.py:1689-1731 | tools/dom/scripts/systemhtml.py:1734-1765 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×13
  • Duplicated block (9 lines × 4) pkg/analyzer/lib/src/dart/constant/value.dart:2150 — pkg/analyzer/lib/src/dart/constant/value.dart:2150-2158 | pkg/analyzer/lib/src/dart/constant/value.dart:2172-2180 | pkg/analyzer/lib/src/dart/constant/value.dart:2248-2256 | pkg/analyzer/lib/src/dart/constant/value.dart:2270-2278 — 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 `pkg/analyzer/lib/src/dart/constant/value.dart:2150` it does not close everything it opens, so those 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 × 4) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352-361 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:452-460 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:473-481 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:493-501 — 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 `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:363` calls `accept2` and `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:484` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 4) pkg/compiler/lib/src/js_model/elements.dart:600 — pkg/compiler/lib/src/js_model/elements.dart:600-608 | pkg/compiler/lib/src/js_model/elements.dart:733-741 | pkg/compiler/lib/src/js_model/elements.dart:811-819 | pkg/compiler/lib/src/js_model/elements.dart:887-895 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/compiler/lib/src/js_model/elements.dart:609` calls `writeToDataSink` and `pkg/compiler/lib/src/js_model/elements.dart:742` 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 × 4) pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:71 — pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:71-79 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:124-132 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:171-179 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:218-226 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 4) sdk/lib/_internal/vm/lib/growable_array.dart:616 — sdk/lib/_internal/vm/lib/growable_array.dart:616-624 | sdk/lib/_internal/vm/lib/growable_array.dart:630-638 | sdk/lib/_internal/vm/lib/growable_array.dart:645-653 | sdk/lib/_internal/vm/lib/growable_array.dart:670-678 — 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 `sdk/lib/_internal/vm/lib/growable_array.dart: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 (9 lines × 4) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:643 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:643-651 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:681-689 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1098-1106 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1126-1134 — 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 `sdk/lib/_internal/vm_shared/lib/compact_hash.dart:643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `K` in one and `E` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) sdk/lib/_internal/wasm/common/compact_hash.dart:608 — sdk/lib/_internal/wasm/common/compact_hash.dart:608-616 | sdk/lib/_internal/wasm/common/compact_hash.dart:638-646 | sdk/lib/_internal/wasm/common/compact_hash.dart:1018-1026 | sdk/lib/_internal/wasm/common/compact_hash.dart:1047-1055 — 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 `sdk/lib/_internal/wasm/common/compact_hash.dart:608` it does not close everything it opens, so those 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 `key` to `K` in one and `E` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) pkg/compiler/lib/src/ssa/codegen_helpers.dart:568 — pkg/compiler/lib/src/ssa/codegen_helpers.dart:568-576 | pkg/compiler/lib/src/ssa/codegen_helpers.dart:600-608 | pkg/compiler/lib/src/ssa/codegen_helpers.dart:1613-1621 | pkg/compiler/lib/src/ssa/late_field_optimizer.dart:48-56 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 4) pkg/front_end/lib/src/builder/fixed_type_builder.dart:130 — pkg/front_end/lib/src/builder/fixed_type_builder.dart:130-139 | pkg/front_end/lib/src/builder/invalid_type_builder.dart:107-115 | pkg/front_end/lib/src/builder/omitted_type_builder.dart:88-96 | pkg/front_end/lib/src/builder/void_type_builder.dart:121-129 — 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 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 4) pkg/analyzer/lib/src/dart/element/type_schema.dart:42 — pkg/analyzer/lib/src/dart/element/type_schema.dart:42-50 | pkg/analyzer/lib/src/summary2/function_type_builder.dart:60-68 | pkg/analyzer/lib/src/summary2/named_type_builder.dart:93-101 | pkg/analyzer/lib/src/summary2/record_type_builder.dart:53-61 — 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.
  • Duplicated block (9 lines × 4) pkg/dart2wasm/lib/async.dart:152 — pkg/dart2wasm/lib/async.dart:152-160 | pkg/dart2wasm/lib/async.dart:171-179 | pkg/dart2wasm/lib/async.dart:190-198 | pkg/dart2wasm/lib/sync_star.dart:139-147 — before extracting anything, compare `pkg/dart2wasm/lib/async.dart` and `pkg/dart2wasm/lib/sync_star.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) pkg/linter/lib/src/rules/empty_container_bodies.dart:30 — pkg/linter/lib/src/rules/empty_container_bodies.dart:30-38 | pkg/linter/lib/src/rules/initialize_in_field_declaration.dart:30-38 | pkg/linter/lib/src/rules/unnecessary_breaks.dart:24-33 | pkg/linter/lib/src/rules/use_declaring_parameters.dart:30-38 — 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 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 4) pkg/linter/lib/src/rules/omit_local_variable_types.dart:32 — pkg/linter/lib/src/rules/omit_local_variable_types.dart:32-40 | pkg/linter/lib/src/rules/prefer_collection_literals.dart:27-35 | pkg/linter/lib/src/rules/unnecessary_await_in_return.dart:30-38 | pkg/linter/lib/src/rules/unrelated_type_equality_checks.dart:32-40 — 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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×12
  • Duplicated block (26 lines × 2) pkg/analyzer/lib/src/dart/ast/utilities.dart:118 — pkg/analyzer/lib/src/dart/ast/utilities.dart:118-143 | pkg/analyzer/lib/src/dart/ast/utilities.dart:267-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/utilities.dart: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 first that the copies are not typed on the same thing: the declarations holding them bind `node` to `MethodDeclaration` in one and `covariant MethodDeclaration2Impl` 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 (26 lines × 2) pkg/compiler/lib/src/js_backend/enqueuer.dart:207 — pkg/compiler/lib/src/js_backend/enqueuer.dart:207-232 | pkg/compiler/lib/src/resolution/enqueuer.dart:230-255 — `pkg/compiler/lib/src/js_backend/enqueuer.dart` and `pkg/compiler/lib/src/resolution/enqueuer.dart` 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 60 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 `pkg/compiler/lib/src/js_backend/enqueuer.dart:207` 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 (26 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2274 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2274-2299 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2574-2599 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:2274` 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 (26 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4213 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4213-4238 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4809-4834 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (26 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7667 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7667-7692 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8534-8559 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7667` it does not close everything it opens, so those 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 (26 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8312 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8312-8337 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9181-9206 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (26 lines × 2) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4633 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:4633-4658 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:4663-4688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_evaluator.dart:4633` 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 (26 lines × 2) pkg/front_end/lib/src/type_inference/element_inference.dart:172 — pkg/front_end/lib/src/type_inference/element_inference.dart:172-197 | pkg/front_end/lib/src/type_inference/element_inference.dart:461-486 — both copies are in the same file, so extract the 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 (26 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:58 — sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:58-83 | sdk/lib/_internal/js_runtime/lib/js_patch.dart:154-179 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart` and `sdk/lib/_internal/js_runtime/lib/js_patch.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 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 `sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart:58` it does not close everything it opens, so those 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 (26 lines × 2) sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart:106 — sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart:106-131 | sdk/lib/_internal/wasm/standalone/boxed_double_patch.dart:59-84 — `sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart` and `sdk/lib/_internal/wasm/standalone/boxed_double_patch.dart` 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 76 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. 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 (26 lines × 2) pkg/front_end/testcases/nnbd/required.dart:10 — pkg/front_end/testcases/nnbd/required.dart:10-35 | pkg/front_end/testcases/nnbd/required_2_legacy.dart:11-36 — before extracting anything, compare `pkg/front_end/testcases/nnbd/required.dart` and `pkg/front_end/testcases/nnbd/required_2_legacy.dart` as WHOLE FILES: 89% 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 `pkg/front_end/testcases/nnbd/required.dart:10` 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) pkg/vm/lib/modular/target/flutter_runner.dart:16 — pkg/vm/lib/modular/target/flutter_runner.dart:16-43 | pkg/vm/lib/modular/target/vm.dart:87-112 — 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.
D5 · Coupling · Off the main sequence · ×12
  • Off the main sequence: js_runtime — js_runtime: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: meta — meta: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 23 project(s), so it's rigid to change.
  • Off the main sequence: mmap — mmap: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: smith — smith: abstractness 0.00, instability 0.00, distance 1.00 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: vm_snapshot_analysis — vm_snapshot_analysis: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: wasm_builder — wasm_builder: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: vm_service — vm_service: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
  • Off the main sequence: build_integration — build_integration: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: dart2js_tools — dart2js_tools: abstractness 0.19, instability 0.00, distance 0.81 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: js_ast — js_ast: abstractness 0.20, instability 0.00, distance 0.80 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: kernel — kernel: abstractness 0.19, instability 0.08, distance 0.73 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
  • Off the main sequence: front_end — front_end: abstractness 0.12, instability 0.15, distance 0.73 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
GD1 · Unfinished & placeholder code · Unfinished stub · ×12
  • Unfinished stub — throws UnimplementedError pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:880 — `lookupMemberTypeInternal` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:2442 — `assertInErrorRecovery` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/dwds/lib/src/readers/frontend_server_asset_reader.dart:126 — `metadataContents` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart:137 — `bootstrapJs` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2764 — `accept` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2770 — `accept1` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2822 — `accept` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2828 — `accept1` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2834 — `equals` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2857 — `withDeclaredNullability` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2895 — `equals` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/kernel/lib/src/ast/types.dart:2918 — `withDeclaredNullability` is a shipped member whose whole body still throws UnimplementedError — generated scaffolding that was never completed. Implement it or remove the dead surface.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×11
  • Edited copy of a member (30 corresponding lines) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1143 — pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1143-1172 | pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1294-1323 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1015 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1015-1044 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1732-1761 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3444 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:3444-3490 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:3492-3521 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/analyzer/lib/src/generated/error_verifier.dart:4125 — pkg/analyzer/lib/src/generated/error_verifier.dart:4125-4154 | pkg/analyzer/lib/src/generated/error_verifier.dart:4156-4188 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) runtime/tools/dartfuzz/dartfuzz.dart:1390 — runtime/tools/dartfuzz/dartfuzz.dart:1390-1424 | runtime/tools/dartfuzz/dartfuzz.dart:1495-1524 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:503 — pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:503-532 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:668-704 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/compiler/lib/src/serialization/task.dart:124 — pkg/compiler/lib/src/serialization/task.dart:124-153 | pkg/compiler/lib/src/serialization/task.dart:174-206 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:7889 — pkg/analyzer/lib/src/dart/ast/ast.dart:7889-7919 | pkg/analyzer/lib/src/dart/ast/ast.dart:8735-8764 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/front_end/lib/src/builder/member_builder.dart:227 — pkg/front_end/lib/src/builder/member_builder.dart:227-265 | pkg/front_end/lib/src/fragment/field/class_member.dart:62-91 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/analyzer/tool/ast/generate.dart:462 — pkg/analyzer/tool/ast/generate.dart:462-491 | pkg/analyzer/tool/ast/generate.dart:1007-1058 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) pkg/compiler/lib/src/dump_info.dart:1724 — pkg/compiler/lib/src/dump_info.dart:1724-1753 | pkg/compiler/lib/src/dump_info.dart:1755-1794 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×11
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/kernel/lib/src/merge_visitor.dart:232 — pkg/kernel/lib/src/merge_visitor.dart:232-254 | pkg/kernel/lib/src/merge_visitor.dart:272-298 | pkg/kernel/lib/src/merge_visitor.dart:472-492 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:115 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:115-135 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:349-370 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:442-462 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/kernel/inferred_collections.dart:88 — pkg/front_end/lib/src/kernel/inferred_collections.dart:88-110 | pkg/front_end/lib/src/kernel/inferred_collections.dart:136-157 | pkg/kernel/lib/src/ast/statements.dart:607-627 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:47 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:47-73 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:137-161 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:396-416 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/analyzer/lib/src/error/annotation_verifier.dart:142 — pkg/analyzer/lib/src/error/annotation_verifier.dart:142-163 | pkg/analyzer/lib/src/error/annotation_verifier.dart:165-190 | pkg/analyzer/lib/src/error/annotation_verifier.dart:192-212 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:8082 — pkg/analyzer/lib/src/dart/ast/ast.dart:8082-8110 | pkg/analyzer/lib/src/dart/ast/ast.dart:8911-8935 | pkg/analyzer/lib/src/dart/ast/ast.dart:18455-18475 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/source/builder_factory.dart:2219 — pkg/front_end/lib/src/source/builder_factory.dart:2219-2243 | pkg/front_end/lib/src/source/builder_factory.dart:2246-2266 | pkg/front_end/lib/src/source/builder_factory.dart:2269-2289 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:10627 — pkg/front_end/lib/src/kernel/body_builder.dart:10627-10647 | pkg/front_end/lib/src/kernel/body_builder.dart:10649-10671 | pkg/front_end/lib/src/kernel/body_builder.dart:10702-10722 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:1157 — pkg/front_end/lib/src/kernel/body_builder.dart:1157-1181 | pkg/front_end/lib/src/kernel/body_builder.dart:8571-8592 | pkg/front_end/lib/src/kernel/body_builder.dart:8594-8614 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1257 — pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1257-1282 | pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1428-1455 | pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1503-1523 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:836 — pkg/front_end/lib/src/kernel/expression_generator.dart:836-856 | pkg/front_end/lib/src/kernel/expression_generator.dart:1287-1307 | pkg/front_end/lib/src/kernel/expression_generator.dart:1737-1758 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×11
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/front_end/tool/bench_maker.dart:412 — pkg/front_end/tool/bench_maker.dart:412-434 | pkg/front_end/tool/bench_maker.dart:543-565 | pkg/front_end/tool/bench_maker.dart:567-590 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analyzer/lib/src/dart/element/element.dart:5644 — pkg/analyzer/lib/src/dart/element/element.dart:5644-5668 | pkg/analyzer/lib/src/dart/element/element.dart:5670-5692 | pkg/analyzer/lib/src/dart/element/element.dart:5694-5718 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22487 — pkg/analyzer/lib/src/dart/ast/ast.dart:22487-22509 | pkg/analyzer/lib/src/dart/ast/ast.dart:52793-52815 | pkg/analyzer/lib/src/dart/ast/ast.dart:56452-56474 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart:18 — pkg/analysis_server/lib/src/handler/legacy/edit_get_postfix_completion.dart:18-42 | pkg/analysis_server/lib/src/handler/legacy/edit_get_statement_completion.dart:18-42 | pkg/analysis_server/lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart:17-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/front_end/lib/src/codes/type_labeler.dart:128 — pkg/front_end/lib/src/codes/type_labeler.dart:128-150 | pkg/front_end/lib/src/codes/type_labeler.dart:282-307 | pkg/front_end/lib/src/codes/type_labeler.dart:317-342 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) sdk/lib/async/zone.dart:823 — sdk/lib/async/zone.dart:823-845 | sdk/lib/async/zone.dart:847-870 | sdk/lib/async/zone.dart:872-901 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analysis_server/lib/src/services/refactoring/extract_local_variable.dart:27 — pkg/analysis_server/lib/src/services/refactoring/extract_local_variable.dart:27-52 | pkg/analysis_server/lib/src/services/refactoring/extract_method.dart:66-88 | pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart:67-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:458 — pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:458-481 | pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:529-551 | pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:640-662 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:14800 — pkg/analyzer/lib/src/dart/ast/ast.dart:14800-14825 | pkg/analyzer/lib/src/dart/ast/ast.dart:44279-44301 | pkg/analyzer/lib/src/dart/ast/ast.dart:51426-51449 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:51 — pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:51-77 | pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:79-103 | pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:132-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/analysis_server/lib/src/computer/computer_highlights.dart:1182 — pkg/analysis_server/lib/src/computer/computer_highlights.dart:1182-1205 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1701-1730 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1816-1838 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×11
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1022 — pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1022-1039 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1041-1061 | pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1718-1742 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:33 — pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:33-66 | pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:30-51 | pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart:29-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/string_helper.dart:91 — sdk/lib/_internal/js_dev_runtime/private/string_helper.dart:91-108 | sdk/lib/_internal/js_runtime/lib/string_helper.dart:104-121 | sdk/lib/_internal/vm/lib/string_patch.dart:1463-1480 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/observatory/lib/src/elements/cpu_profile_table.dart:223 — pkg/observatory/lib/src/elements/cpu_profile_table.dart:223-243 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:315-332 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:363-380 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/directive_context.dart:34 — pkg/_fe_analyzer_shared/lib/src/parser/directive_context.dart:34-52 | pkg/_fe_analyzer_shared/lib/src/parser/directive_context.dart:54-72 | pkg/_fe_analyzer_shared/lib/src/parser/directive_context.dart:89-106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:858 — pkg/front_end/lib/src/kernel/expression_generator.dart:858-875 | pkg/front_end/lib/src/kernel/expression_generator.dart:1114-1132 | pkg/front_end/lib/src/kernel/expression_generator.dart:1309-1326 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:639 — pkg/compiler/lib/src/js/size_estimator.dart:639-656 | pkg/dev_compiler/lib/src/js_ast/printer.dart:867-886 | pkg/js_ast/lib/src/printer.dart:1002-1021 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/front_end/lib/src/fragment/getter/declaration.dart:277 — pkg/front_end/lib/src/fragment/getter/declaration.dart:277-294 | pkg/front_end/lib/src/fragment/method/declaration.dart:246-267 | pkg/front_end/lib/src/fragment/setter/declaration.dart:276-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/front_end/lib/src/util/parser_ast_helper.dart:375 — pkg/front_end/lib/src/util/parser_ast_helper.dart:375-392 | pkg/front_end/lib/src/util/parser_ast_helper.dart:890-907 | pkg/front_end/lib/src/util/parser_ast_helper.dart:926-943 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:1718 — pkg/front_end/lib/src/kernel/expression_generator.dart:1718-1735 | pkg/front_end/lib/src/kernel/expression_generator.dart:1920-1941 | pkg/front_end/lib/src/kernel/expression_generator.dart:2121-2139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/front_end/lib/src/util/parser_ast_helper.dart:1095 — pkg/front_end/lib/src/util/parser_ast_helper.dart:1095-1112 | pkg/front_end/lib/src/util/parser_ast_helper.dart:1141-1158 | pkg/front_end/lib/src/util/parser_ast_helper.dart:3380-3397 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×11
  • Duplicated block (13 lines × 3) pkg/analysis_server/lib/protocol/protocol.dart:179 — pkg/analysis_server/lib/protocol/protocol.dart:179-191 | pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:163-175 | pkg/analyzer_plugin/lib/protocol/protocol.dart:193-205 — before extracting anything, compare `pkg/analysis_server/lib/protocol/protocol.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:163` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `first` to `Map<Object?, Object?>` in one and `Map?` 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, `pkg/analysis_server/lib/protocol/protocol.dart:178` calls `_equalMaps` and `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:162` 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 × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:10625 — pkg/analyzer/lib/src/dart/ast/ast.dart:10625-10637 | pkg/analyzer/lib/src/dart/ast/ast.dart:15159-15171 | pkg/analyzer/lib/src/dart/ast/ast.dart:30430-30442 — 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 (13 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:30624 — pkg/analyzer/lib/src/dart/ast/ast.dart:30624-30636 | pkg/analyzer/lib/src/dart/ast/ast.dart:38198-38210 | pkg/analyzer/lib/src/dart/ast/ast.dart:38800-38812 — 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 (13 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:37878 — pkg/analyzer/lib/src/dart/ast/ast.dart:37878-37890 | pkg/analyzer/lib/src/dart/ast/ast.dart:60111-60123 | pkg/analyzer/lib/src/dart/ast/ast.dart:62936-62948 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:37878` 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 (13 lines × 3) pkg/analyzer/lib/src/summary2/bundle_reader.dart:459 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:459-471 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:615-627 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1070-1082 — 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, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:612` calls `readBool` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:456` 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 × 3) pkg/front_end/lib/src/kernel/expression_generator.dart:2854 — pkg/front_end/lib/src/kernel/expression_generator.dart:2854-2866 | pkg/front_end/lib/src/kernel/expression_generator.dart:3325-3337 | pkg/front_end/lib/src/kernel/expression_generator.dart:3683-3695 — 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 `pkg/front_end/lib/src/kernel/expression_generator.dart:2854` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1053 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1053-1065 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1604-1616 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1915-1927 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `InferredForElement` in one and `InferredPatternForElement` 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 × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8560 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8560-8572 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8765-8777 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9026-9038 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `CompoundIndexSet` in one and `CompoundSuperIndexSet` 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 × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2107 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2107-2119 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:2125-2137 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:3030-3042 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:366 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:366-378 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:362-374 | sdk/lib/_internal/wasm/common/io_patch.dart:362-374 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 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 × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:380 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:380-392 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:376-388 | sdk/lib/_internal/wasm/common/io_patch.dart:376-388 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×11
  • Duplicated block (6 lines × 3) pkg/kernel/lib/src/merge_visitor.dart:242 — pkg/kernel/lib/src/merge_visitor.dart:242-247 | pkg/kernel/lib/src/merge_visitor.dart:282-287 | pkg/kernel/lib/src/merge_visitor.dart:482-487 — 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 `pkg/kernel/lib/src/merge_visitor.dart:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) pkg/observatory/lib/src/elements/context_view.dart:93 — pkg/observatory/lib/src/elements/context_view.dart:93-98 | pkg/observatory/lib/src/elements/cpu_profile.dart:82-87 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:98-103 — 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 `pkg/observatory/lib/src/elements/context_view.dart: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.
  • Duplicated block (6 lines × 3) pkg/analyzer/lib/src/fine/library_manifest.dart:187 — pkg/analyzer/lib/src/fine/library_manifest.dart:187-192 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:453-458 | pkg/analyzer/lib/src/fine/requirements.dart:2681-2686 — 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. 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 × 3) pkg/front_end/lib/src/fragment/getter.dart:167 — pkg/front_end/lib/src/fragment/getter.dart:167-172 | pkg/front_end/lib/src/fragment/method.dart:165-170 | pkg/front_end/lib/src/fragment/setter.dart:177-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) pkg/front_end/lib/src/kernel/internal_ast.dart:8167 — pkg/front_end/lib/src/kernel/internal_ast.dart:8167-8173 | pkg/front_end/lib/src/kernel/internal_ast.dart:8642-8648 | pkg/kernel/lib/src/ast/initializers.dart:97-102 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (6 lines × 3) pkg/front_end/lib/src/kernel/internal_ast.dart:9011 — pkg/front_end/lib/src/kernel/internal_ast.dart:9011-9017 | pkg/kernel/lib/src/ast/constants.dart:419-424 | pkg/kernel/lib/src/ast/expressions.dart:4431-4436 — before extracting anything, compare `pkg/kernel/lib/src/ast/constants.dart` and `pkg/kernel/lib/src/ast/expressions.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/kernel/lib/src/ast/constants.dart:427` calls `toString`, `StringConstant`, `toStringInternal` and `pkg/front_end/lib/src/kernel/internal_ast.dart:9018` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) pkg/front_end/testcases/general/mixin_super_call_lib.dart:13 — pkg/front_end/testcases/general/mixin_super_call_lib.dart:13-18 | pkg/front_end/testcases/general/super_call_lib.dart:13-18 | pkg/front_end/testcases/mixin_in_outline/super_call_lib.dart:13-18 — before extracting anything, compare `pkg/front_end/testcases/general/mixin_super_call_lib.dart` and `pkg/front_end/testcases/general/super_call_lib.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 (6 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2015 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2015-2020 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:2033-2038 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2644-2649 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 × 3) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:84 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:84-89 | sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart:40-45 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:124-129 — 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 `sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1562 — sdk/lib/_internal/vm/lib/convert_patch.dart:1562-1567 | sdk/lib/_internal/vm/lib/convert_patch.dart:1694-1699 | sdk/lib/_internal/wasm/common/convert_patch.dart:2093-2098 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 (6 lines × 3) pkg/compiler/lib/src/inferrer/typemasks/forwarding_type_mask.dart:172 — pkg/compiler/lib/src/inferrer/typemasks/forwarding_type_mask.dart:172-177 | pkg/compiler/lib/src/inferrer/typemasks/set_type_mask.dart:87-92 | pkg/compiler/lib/src/inferrer/typemasks/value_type_mask.dart:61-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×10
  • Edited copy of a member (47 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:25-84 | pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_children.dart:51-97 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:482 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:482-528 | sdk/lib/_internal/js_runtime/lib/js_number.dart:569-619 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/analyzer/lib/src/dart/analysis/driver.dart:1808 — pkg/analyzer/lib/src/dart/analysis/driver.dart:1808-1857 | pkg/analyzer/lib/src/dart/analysis/driver.dart:1883-1929 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/analyzer/lib/src/generated/exhaustiveness.dart:195 — pkg/analyzer/lib/src/generated/exhaustiveness.dart:195-241 | pkg/front_end/lib/src/kernel/exhaustiveness.dart:531-587 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531-1598 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1686-1732 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2439 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2439-2493 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2495-2541 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:1676 — pkg/kernel/lib/binary/ast_from_binary.dart:1676-1722 | pkg/kernel/lib/binary/ast_from_binary.dart:1752-1810 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/dartdev/lib/src/commands/compile.dart:238 — pkg/dartdev/lib/src/commands/compile.dart:238-297 | pkg/dartdev/lib/src/commands/compile.dart:370-416 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1312 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1312-1359 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2638-2684 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) pkg/compiler/lib/src/ssa/ssa.dart:263 — pkg/compiler/lib/src/ssa/ssa.dart:263-309 | pkg/compiler/lib/src/ssa/ssa.dart:342-391 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×10
  • Edited copy of a member (39 corresponding lines) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:88 — sdk/lib/_internal/vm_shared/lib/integers_patch.dart:88-126 | sdk/lib/_internal/wasm/common/int_patch.dart:52-91 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/dart2bytecode/lib/declarations.dart:199 — pkg/dart2bytecode/lib/declarations.dart:199-237 | pkg/dart2bytecode/lib/declarations.dart:1198-1243 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/native_compiler/lib/passes/lowering.dart:281 — pkg/native_compiler/lib/passes/lowering.dart:281-319 | pkg/native_compiler/lib/passes/lowering.dart:321-370 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/linter/lib/src/rules/public_member_api_docs.dart:74 — pkg/linter/lib/src/rules/public_member_api_docs.dart:74-112 | pkg/linter/lib/src/rules/public_member_api_docs.dart:131-175 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1163 — pkg/compiler/lib/src/js/rewrite_async.dart:1163-1201 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1191-1229 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/analysis_server/lib/src/server/crash_reporting.dart:16 — pkg/analysis_server/lib/src/server/crash_reporting.dart:16-54 | pkg/analysis_server/lib/src/session_logger/crash_reporting_session_listener.dart:30-68 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/front_end/lib/src/kernel/resolver.dart:573 — pkg/front_end/lib/src/kernel/resolver.dart:573-619 | pkg/front_end/lib/src/kernel/resolver.dart:621-659 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/front_end/lib/src/kernel/resolver_helpers.dart:390 — pkg/front_end/lib/src/kernel/resolver_helpers.dart:390-428 | pkg/front_end/lib/src/kernel/resolver_helpers.dart:496-538 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/front_end/lib/src/builder/type_parameter_builder.dart:286 — pkg/front_end/lib/src/builder/type_parameter_builder.dart:286-324 | pkg/front_end/lib/src/builder/type_parameter_builder.dart:545-584 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/front_end/lib/src/source/source_extension_builder.dart:225 — pkg/front_end/lib/src/source/source_extension_builder.dart:225-264 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:857-895 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×10
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/observatory/lib/src/elements/class_tree.dart:74 — pkg/observatory/lib/src/elements/class_tree.dart:74-95 | pkg/observatory/lib/src/elements/ports.dart:80-101 | pkg/observatory/lib/src/elements/sentinel_view.dart:67-86 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:186 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:186-205 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:372-394 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:464-483 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/analyzer/lib/src/summary2/informative_data.dart:153 — pkg/analyzer/lib/src/summary2/informative_data.dart:153-176 | pkg/analyzer/lib/src/summary2/informative_data.dart:408-427 | pkg/analyzer/lib/src/summary2/informative_data.dart:450-471 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1064 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1064-1083 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1085-1106 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1361-1380 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:526 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:526-545 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:578-597 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:623-642 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:7863 — pkg/front_end/lib/src/kernel/body_builder.dart:7863-7882 | pkg/front_end/lib/src/kernel/body_builder.dart:7905-7924 | pkg/front_end/lib/src/kernel/body_builder.dart:8077-8102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/front_end/lib/src/dill/dill_builder_mixins.dart:26 — pkg/front_end/lib/src/dill/dill_builder_mixins.dart:26-45 | pkg/front_end/lib/src/dill/dill_class_builder.dart:333-352 | pkg/front_end/lib/src/dill/dill_type_alias_builder.dart:81-100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/native_compiler/lib/back_end/arm64/assembler.dart:2492 — pkg/native_compiler/lib/back_end/arm64/assembler.dart:2492-2513 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:2725-2744 | pkg/native_compiler/lib/back_end/arm64/assembler.dart:2782-2803 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/observatory/lib/src/elements/cpu_profile_table.dart:261 — pkg/observatory/lib/src/elements/cpu_profile_table.dart:261-287 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:342-361 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:390-409 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/front_end/lib/src/type_inference/delayed_expressions.dart:286 — pkg/front_end/lib/src/type_inference/delayed_expressions.dart:286-305 | pkg/front_end/lib/src/type_inference/delayed_expressions.dart:476-495 | pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1567-1587 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×10
  • Duplicated block (34 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:91 — pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:91-124 | pkg/analysis_server/lib/src/lsp/handlers/code_actions/pubspec.dart:87-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:91` 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 (34 lines × 2) pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:77 — pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:77-110 | pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart:203-236 — before extracting anything, compare `pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart` and `pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:77` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/sdk/sdk.dart:97 — pkg/analyzer/lib/src/dart/sdk/sdk.dart:97-130 | pkg/analyzer/lib/src/dart/sdk/sdk.dart:253-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/sdk/sdk.dart:97` 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 × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:729 — pkg/compiler/lib/src/js_model/element_map_impl.dart:729-762 | pkg/compiler/lib/src/kernel/element_map_impl.dart:400-433 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 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 `pkg/compiler/lib/src/js_model/element_map_impl.dart:729` 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 (34 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5607 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5607-5640 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6237-6270 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5607` it does not close everything it opens, so those 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 (34 lines × 2) pkg/front_end/testcases/general/lookup.dart:69 — pkg/front_end/testcases/general/lookup.dart:69-102 | pkg/front_end/testcases/general/lookup.dart:114-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 (34 lines × 2) pkg/front_end/testcases/general/lookup.dart:359 — pkg/front_end/testcases/general/lookup.dart:359-392 | pkg/front_end/testcases/general/lookup.dart:406-439 — both copies are in the same file, so extract the 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 (34 lines × 2) sdk/lib/_internal/wasm/common/convert_patch.dart:2762 — sdk/lib/_internal/wasm/common/convert_patch.dart:2762-2795 | sdk/lib/convert/utf.dart:592-625 — 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 (34 lines × 2) pkg/front_end/testcases/constructor_tearoffs/lowering/constructor_member_conflict.dart:7 — pkg/front_end/testcases/constructor_tearoffs/lowering/constructor_member_conflict.dart:7-40 | pkg/front_end/testcases/general/constructor_member_conflict.dart:7-40 — before extracting anything, compare `pkg/front_end/testcases/constructor_tearoffs/lowering/constructor_member_conflict.dart` and `pkg/front_end/testcases/general/constructor_member_conflict.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 (34 lines × 2) pkg/observatory/lib/src/app/settings.dart:11 — pkg/observatory/lib/src/app/settings.dart:11-44 | pkg/observatory/lib/src/repositories/settings.dart:11-44 — 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 `pkg/observatory/lib/src/app/settings.dart:11` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×10
  • Duplicated block (29 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:372 — pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:372-400 | pkg/analysis_server/lib/src/services/correction/dart/create_operator.dart:50-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:372` 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 (29 lines × 2) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2353 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2353-2381 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4102-4130 — both copies are in the same file, so extract the 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 `node` to `BreakStatement` in one and `PrimaryConstructorName` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4131` calls `verifyReceiverIndexExpression` and `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2382` 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 (29 lines × 2) pkg/analyzer/lib/src/generated/error_verifier.dart:2315 — pkg/analyzer/lib/src/generated/error_verifier.dart:2315-2343 | pkg/analyzer/lib/src/generated/error_verifier.dart:2366-2394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/generated/error_verifier.dart:2315` 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 `node` to `covariant TopLevelGetterDeclarationImpl` in one and `covariant TopLevelSetterDeclarationImpl` 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 (29 lines × 2) pkg/analyzer/tool/generators/ast_generator.dart:902 — pkg/analyzer/tool/generators/ast_generator.dart:902-930 | pkg/analyzer/tool/generators/ast_generator.dart:966-994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/generators/ast_generator.dart: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.
  • Duplicated block (29 lines × 2) pkg/compiler/lib/src/kernel/kernel_impact.dart:188 — pkg/compiler/lib/src/kernel/kernel_impact.dart:188-216 | pkg/compiler/lib/src/kernel/kernel_impact.dart:256-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5557 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5557-5585 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6172-6200 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5557` it does not close everything it opens, so those 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 (29 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7428 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7428-7456 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8295-8323 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (29 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3356 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3356-3384 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5129-5157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:3356` 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 `node` to `InternalForInStatement` in one and `ForInElement` 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 (29 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart:26 — pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart:26-54 | pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart:24-52 — `pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 29 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (29 lines × 2) pkg/front_end/testcases/inference/infer_assign_to_property_super.dart:30 — pkg/front_end/testcases/inference/infer_assign_to_property_super.dart:30-58 | pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart:26-54 — `pkg/front_end/testcases/inference/infer_assign_to_property_super.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 29 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/testcases/inference/infer_assign_to_property_super.dart:28` calls `Test`, `super` and `pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart:25` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×10
  • Duplicated block (28 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:140 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:140-167 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:951-978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:140` 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 (28 lines × 2) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:79 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:79-106 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_with_plugin_that_times_out.dart:80-107 — 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:79` 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 (28 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5028 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5028-5055 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5638-5665 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5028` it does not close everything it opens, so those 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) pkg/front_end/lib/src/source/outline_builder.dart:1108 — pkg/front_end/lib/src/source/outline_builder.dart:1108-1135 | pkg/front_end/lib/src/source/outline_builder.dart:1276-1303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/outline_builder.dart:1108` it does not close everything it opens, so those exact lines 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) pkg/observatory/lib/src/elements/class_instances.dart:290 — pkg/observatory/lib/src/elements/class_instances.dart:290-317 | pkg/observatory/lib/src/elements/object_common.dart:182-209 — before extracting anything, compare `pkg/observatory/lib/src/elements/class_instances.dart` and `pkg/observatory/lib/src/elements/object_common.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 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 `pkg/observatory/lib/src/elements/class_instances.dart:290` it does not close everything it opens, so those exact lines 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) pkg/observatory/lib/src/elements/class_instances.dart:326 — pkg/observatory/lib/src/elements/class_instances.dart:326-353 | pkg/observatory/lib/src/elements/object_common.dart:217-244 — before extracting anything, compare `pkg/observatory/lib/src/elements/class_instances.dart` and `pkg/observatory/lib/src/elements/object_common.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 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 `pkg/observatory/lib/src/elements/class_instances.dart:326` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:274 — sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:274-301 | sdk/lib/_internal/js_runtime/lib/convert_patch.dart:274-301 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart` and `sdk/lib/_internal/js_runtime/lib/convert_patch.dart` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 120 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 (28 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:486 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:486-513 | sdk/lib/_internal/js_runtime/lib/js_number.dart:577-604 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. 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) sdk/lib/_internal/wasm/common/convert_patch.dart:2277 — sdk/lib/_internal/wasm/common/convert_patch.dart:2277-2304 | sdk/lib/_internal/wasm/common/convert_patch.dart:2359-2386 — both copies are in the same file, so extract the 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 (28 lines × 2) pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart:6 — pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart:6-33 | pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart:6-33 — `pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart` and `pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 28 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 `pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×10
  • Duplicated block (27 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351-2377 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1575-1601 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:41 — pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:41-67 | pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart:48-74 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:41` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/fragment/field/encoding.dart:373 — pkg/front_end/lib/src/fragment/field/encoding.dart:373-399 | pkg/front_end/lib/src/fragment/field/encoding.dart:438-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/field/encoding.dart:373` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/fragment/method/encoding.dart:228 — pkg/front_end/lib/src/fragment/method/encoding.dart:228-254 | pkg/front_end/lib/src/fragment/method/encoding.dart:569-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/method/encoding.dart:228` 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 (27 lines × 2) pkg/front_end/lib/src/fragment/method/encoding.dart:713 — pkg/front_end/lib/src/fragment/method/encoding.dart:713-739 | pkg/front_end/lib/src/fragment/setter/encoding.dart:783-809 — `pkg/front_end/lib/src/fragment/method/encoding.dart` and `pkg/front_end/lib/src/fragment/setter/encoding.dart` 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 16 separate duplicated blocks between them, totalling at least 318 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (27 lines × 2) pkg/front_end/lib/src/kernel/expression_generator.dart:5005 — pkg/front_end/lib/src/kernel/expression_generator.dart:5005-5031 | pkg/front_end/lib/src/kernel/expression_generator.dart:5066-5092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/expression_generator.dart:5005` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/kernel/internal_ast.dart:208 — pkg/front_end/lib/src/kernel/internal_ast.dart:208-234 | pkg/front_end/lib/src/kernel/internal_ast.dart:7495-7521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/internal_ast.dart:208` 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 (27 lines × 2) pkg/observatory/lib/src/elements/class_instances.dart:151 — pkg/observatory/lib/src/elements/class_instances.dart:151-177 | pkg/observatory/lib/src/elements/object_common.dart:130-156 — before extracting anything, compare `pkg/observatory/lib/src/elements/class_instances.dart` and `pkg/observatory/lib/src/elements/object_common.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 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 `pkg/observatory/lib/src/elements/class_instances.dart:151` 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 (27 lines × 2) sdk/lib/_internal/vm/lib/convert_patch.dart:1897 — sdk/lib/_internal/vm/lib/convert_patch.dart:1897-1923 | sdk/lib/_internal/wasm/common/convert_patch.dart:2437-2463 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 (27 lines × 2) pkg/observatory/lib/src/elements/code_view.dart:66 — pkg/observatory/lib/src/elements/code_view.dart:66-92 | pkg/observatory/lib/src/elements/object_view.dart:42-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×10
  • Duplicated block (15 lines × 3) pkg/analysis_server/lib/src/status/pages/ast_page.dart:24 — pkg/analysis_server/lib/src/status/pages/ast_page.dart:24-38 | pkg/analysis_server/lib/src/status/pages/contents_page.dart:27-41 | pkg/analysis_server/lib/src/status/pages/element_model_page.dart:29-43 — 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 `pkg/analysis_server/lib/src/status/pages/ast_page.dart: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. 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 × 3) pkg/analyzer/lib/src/binary/string_table.dart:68 — pkg/analyzer/lib/src/binary/string_table.dart:68-82 | pkg/compiler/lib/src/serialization/binary_source.dart:99-113 | pkg/dart2js_info/lib/src/binary/source.dart:256-270 — 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. 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 (15 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:19002 — pkg/analyzer/lib/src/dart/ast/ast.dart:19002-19016 | pkg/analyzer/lib/src/dart/ast/ast.dart:19022-19036 | pkg/analyzer/lib/src/dart/ast/ast.dart:32161-32175 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:19002` 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 (15 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:26766 — pkg/analyzer/lib/src/dart/ast/ast.dart:26766-26780 | pkg/analyzer/lib/src/dart/ast/ast.dart:26788-26802 | pkg/analyzer/lib/src/dart/ast/ast.dart:40507-40521 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:26788` 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 (15 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:314 — pkg/front_end/lib/src/fragment/getter/encoding.dart:314-328 | pkg/front_end/lib/src/fragment/method/encoding.dart:263-277 | pkg/front_end/lib/src/fragment/setter/encoding.dart:338-352 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:314` 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 × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6387 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6387-6401 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6494-6508 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6760-6774 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `IndexSet` in one and `SuperIndexSet` 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 × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:12662 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:12662-12676 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:13077-13091 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:13232-13246 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:12662` 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 (15 lines × 3) pkg/front_end/lib/src/type_inference/object_access_target.dart:1261 — pkg/front_end/lib/src/type_inference/object_access_target.dart:1261-1275 | pkg/front_end/lib/src/type_inference/object_access_target.dart:1288-1302 | pkg/front_end/lib/src/type_inference/object_access_target.dart:1340-1354 — 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 `pkg/front_end/lib/src/type_inference/object_access_target.dart:1261` 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 × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1413 — sdk/lib/_internal/vm/lib/convert_patch.dart:1413-1427 | sdk/lib/_internal/wasm/common/convert_patch.dart:1599-1613 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1291-1305 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1413` 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 × 3) sdk/lib/_internal/wasm/js/string_patch.dart:55 — sdk/lib/_internal/wasm/js/string_patch.dart:55-69 | sdk/lib/_internal/wasm/js/string_patch.dart:106-120 | sdk/lib/_internal/wasm/standalone/string_patch.dart:68-82 — `sdk/lib/_internal/wasm/js/string_patch.dart` and `sdk/lib/_internal/wasm/standalone/string_patch.dart` 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 7 separate duplicated blocks between them, totalling at least 131 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 `sdk/lib/_internal/wasm/js/string_patch.dart:55` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `charCodes` to `U8List` in one and `U16List` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×10
  • Duplicated block (10–11 lines × 2) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:481 — pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:481-490 | pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:514-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:481` 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 `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 `node` to `AssertInitializer` in one and `AssertStatement` 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 (10–11 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart:104 — pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart:104-113 | pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart:216-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart:216` 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 (10–11 lines × 2) pkg/analyzer/lib/src/dart/element/scope.dart:101 — pkg/analyzer/lib/src/dart/element/scope.dart:101-110 | pkg/analyzer/lib/src/dart/element/scope.dart:556-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–11 lines × 2) pkg/dart2bytecode/lib/declarations.dart:452 — pkg/dart2bytecode/lib/declarations.dart:452-461 | pkg/dart2bytecode/lib/declarations.dart:651-661 — both copies are in the same file, so extract the 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, `pkg/dart2bytecode/lib/declarations.dart:451` calls `readPackedObject` and `pkg/dart2bytecode/lib/declarations.dart:650` 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 (10–11 lines × 2) pkg/front_end/lib/src/kernel/expression_generator.dart:2661 — pkg/front_end/lib/src/kernel/expression_generator.dart:2661-2671 | pkg/front_end/lib/src/kernel/expression_generator.dart:3137-3146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/expression_generator.dart:2661` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10–11 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6486 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6486-6495 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8778-8788 — both copies are in the same file, so extract the 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 `node` to `SuperIndexSet` in one and `CompoundSuperIndexSet` 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 (10–11 lines × 2) pkg/kernel/lib/type_algebra.dart:1051 — pkg/kernel/lib/type_algebra.dart:1051-1060 | pkg/kernel/lib/type_algebra.dart:1402-1412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/type_algebra.dart:1402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) sdk/lib/_http/http_impl.dart:2271 — sdk/lib/_http/http_impl.dart:2271-2281 | sdk/lib/_http/http_impl.dart:2299-2308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_http/http_impl.dart:2271` it does not close everything it opens, so those exact lines 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–11 lines × 2) sdk/lib/_internal/js_runtime/lib/js_string.dart:36 — sdk/lib/_internal/js_runtime/lib/js_string.dart:36-46 | sdk/lib/_internal/vm/lib/string_patch.dart:917-926 — 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 `sdk/lib/_internal/js_runtime/lib/js_string.dart:36` it does not close everything it opens, so those 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 (10–11 lines × 2) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:645 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:645-654 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2141-2151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2141` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×10
  • Duplicated block (7 lines × 4) pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart:34 — pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart:34-40 | pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart:49-55 | pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart:34-40 | pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart:49-55 — `pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart` and `pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart` 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 25 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 `pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `Test2` in one and `Test3` 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) pkg/observatory/lib/src/elements/error_view.dart:58 — pkg/observatory/lib/src/elements/error_view.dart:58-65 | pkg/observatory/lib/src/elements/general_error.dart:60-66 | pkg/observatory/lib/src/elements/isolate_reconnect.dart:77-84 | pkg/observatory/lib/src/elements/vm_connect.dart:64-70 — 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 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/error_view.dart:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 4) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1683 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1683-1689 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1693-1699 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1971-1977 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1981-1987 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 295 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 `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1971` it does not close everything it opens, so those 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 (7 lines × 4) pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart:2 — pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart:2-13 | pkg/front_end/parser_testcases/error_recovery/constructor_recovery_return_type.dart:2-13 | pkg/front_end/testcases/general/error_recovery/constructor_recovery_ok.dart:6-17 | pkg/front_end/testcases/general/error_recovery/constructor_recovery_return_type.dart:7-13 — before extracting anything, compare `pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart` and `pkg/front_end/testcases/general/error_recovery/constructor_recovery_ok.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 4) pkg/front_end/lib/src/fragment/enum_element.dart:266 — pkg/front_end/lib/src/fragment/enum_element.dart:266-273 | pkg/front_end/lib/src/fragment/field/declaration.dart:780-786 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:383-389 | pkg/front_end/lib/src/source/source_enum_builder.dart:868-875 — before extracting anything, compare `pkg/front_end/lib/src/fragment/enum_element.dart` and `pkg/front_end/lib/src/fragment/field/declaration.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:297 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:297-303 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:311-317 | sdk/lib/_internal/wasm/js_common/stopwatch_patch.dart:34-40 | sdk/lib/_internal/wasm/standalone/stopwatch_patch.dart:24-30 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart` and `sdk/lib/_internal/js_runtime/lib/core_patch.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 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 × 4) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:305 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:305-311 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:319-325 | sdk/lib/_internal/wasm/js_common/stopwatch_patch.dart:42-48 | sdk/lib/_internal/wasm/standalone/stopwatch_patch.dart:32-38 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart` and `sdk/lib/_internal/js_runtime/lib/core_patch.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 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 × 4) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:456 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:456-465 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1017-1023 | sdk/lib/_internal/wasm/common/compact_hash.dart:415-424 | sdk/lib/_internal/wasm/common/compact_hash.dart:937-943 — before extracting anything, compare `sdk/lib/_internal/vm_shared/lib/compact_hash.dart` and `sdk/lib/_internal/wasm/common/compact_hash.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 194 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 × 4) pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart:184 — pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart:184-190 | pkg/analyzer/lib/src/test_utilities/function_ast_visitor.dart:74-80 | pkg/analyzer/lib/src/test_utilities/function_ast_visitor.dart:88-94 | pkg/analyzer/lib/src/test_utilities/function_ast_visitor.dart:133-139 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `CatchClauseParameter` in one and `DeclaredVariablePattern` 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) pkg/kernel/lib/src/ast/constants.dart:45 — pkg/kernel/lib/src/ast/constants.dart:45-51 | pkg/kernel/lib/src/ast/expressions.dart:67-73 | pkg/kernel/lib/src/ast/types.dart:59-65 | pkg/kernel/lib/src/ast/types.dart:149-155 — before extracting anything, compare `pkg/kernel/lib/src/ast/constants.dart` and `pkg/kernel/lib/src/ast/expressions.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `t1` to `DartType` in one and `NamedType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×10
  • Duplicated block (7 lines × 3) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:441 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:441-447 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:565-571 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:639-645 — 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 (7 lines × 3) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:608 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:608-614 | sdk/lib/_internal/js_runtime/lib/js_number.dart:699-705 | sdk/lib/_internal/vm/lib/integers.dart:518-524 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/private/js_number.dart:608` 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 (7 lines × 3) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:100 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:100-106 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:116-122 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:268-274 — 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 `sdk/lib/_internal/vm_shared/lib/collection_patch.dart:100` it does not close everything it opens, so those exact lines 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) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:427 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:427-433 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:443-449 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:487-493 — 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 `sdk/lib/_internal/vm_shared/lib/collection_patch.dart: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `Object?` in one and `K` 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 × 3) pkg/kernel/lib/src/ast/types.dart:1365 — pkg/kernel/lib/src/ast/types.dart:1365-1371 | pkg/kernel/lib/src/ast/types.dart:1727-1733 | pkg/kernel/lib/src/ast/types.dart:1989-1995 — 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 `pkg/kernel/lib/src/ast/types.dart:1365` 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 (7 lines × 3) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1732 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1732-1738 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1743-1749 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1754-1760 — 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 `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:1732` it does not close everything it opens, so those 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 (7 lines × 3) pkg/observatory/lib/src/elements/isolate/counter_chart.dart:38 — pkg/observatory/lib/src/elements/isolate/counter_chart.dart:38-44 | pkg/observatory/lib/src/elements/isolate_reconnect.dart:67-73 | pkg/observatory/lib/src/elements/script_inset.dart:110-116 — 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 (7 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:435 — sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart:435-441 | sdk/lib/_internal/js_runtime/lib/io_patch.dart:431-437 | sdk/lib/_internal/wasm/common/io_patch.dart:431-437 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart` and `sdk/lib/_internal/js_runtime/lib/io_patch.dart` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 152 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1461 — sdk/lib/_internal/vm/lib/convert_patch.dart:1461-1467 | sdk/lib/_internal/wasm/common/convert_patch.dart:1647-1653 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1339-1345 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) pkg/analyzer/lib/file_system/memory_file_system.dart:610 — pkg/analyzer/lib/file_system/memory_file_system.dart:610-616 | pkg/analyzer/lib/file_system/overlay_file_system.dart:372-378 | pkg/analyzer/lib/file_system/physical_file_system.dart:408-414 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analyzer/lib/file_system/physical_file_system.dart:406` calls `basename` and `pkg/analyzer/lib/file_system/overlay_file_system.dart:370` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×9
  • Edited copies of one member (4 members, 12+ corresponding lines) sdk/lib/collection/list.dart:122 — sdk/lib/collection/list.dart:122-133 | sdk/lib/collection/list.dart:135-146 | sdk/lib/internal/iterable.dart:107-118 | sdk/lib/internal/iterable.dart:120-131 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/compiler/lib/src/constants/values.dart:554 — pkg/compiler/lib/src/constants/values.dart:554-566 | pkg/compiler/lib/src/constants/values.dart:616-628 | pkg/compiler/lib/src/constants/values.dart:679-692 | pkg/compiler/lib/src/constants/values.dart:929-940 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:3161 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:3161-3173 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3175-3186 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3188-3200 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3202-3213 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:491 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:491-502 | sdk/lib/_internal/js_runtime/lib/js_array.dart:677-688 | sdk/lib/_internal/wasm/js_common/js_array.dart:427-438 | sdk/lib/collection/list.dart:330-341 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:103 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:103-114 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:370-381 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:425-436 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:696-707 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:556 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:556-576 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:608-621 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:811-822 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1156-1169 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/kernel/lib/src/ast/variables.dart:204 — pkg/kernel/lib/src/ast/variables.dart:204-216 | pkg/kernel/lib/src/ast/variables.dart:465-476 | pkg/kernel/lib/src/ast/variables.dart:720-733 | pkg/kernel/lib/src/ast/variables.dart:984-998 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/kernel/lib/verifier.dart:1776 — pkg/kernel/lib/verifier.dart:1776-1787 | pkg/kernel/lib/verifier.dart:1789-1800 | pkg/kernel/lib/verifier.dart:1802-1813 | pkg/kernel/lib/verifier.dart:1815-1826 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) pkg/vm/lib/transformations/record_use/record_instance.dart:62 — pkg/vm/lib/transformations/record_use/record_instance.dart:62-75 | pkg/vm/lib/transformations/record_use/record_instance.dart:77-88 | pkg/vm/lib/transformations/record_use/record_instance.dart:90-101 | pkg/vm/lib/transformations/record_use/record_instance.dart:198-209 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×9
  • Duplicated block (35 lines × 2) pkg/dev_compiler/lib/src/js_ast/printer.dart:1943 — pkg/dev_compiler/lib/src/js_ast/printer.dart:1943-1977 | pkg/js_ast/lib/src/printer.dart:2125-2159 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/printer.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 157 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 (35 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:1170 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1170-1204 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1463-1497 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:1170` it does not close everything it opens, so those exact lines 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) pkg/dev_compiler/lib/src/kernel/compiler.dart:2124 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2124-2158 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2424-2458 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (35 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3353 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3353-3387 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3868-3902 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (35 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1502 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1502-1536 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1962-1996 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1502` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionGet` in one and `ExtensionGetterInvocation` 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 (35 lines × 2) pkg/front_end/testcases/general/lookup.dart:161 — pkg/front_end/testcases/general/lookup.dart:161-195 | pkg/front_end/testcases/general/lookup.dart:207-241 — both copies are in the same file, so extract the 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 (35 lines × 2) pkg/front_end/testcases/general/lookup.dart:453 — pkg/front_end/testcases/general/lookup.dart:453-487 | pkg/front_end/testcases/general/lookup.dart:499-533 — both copies are in the same file, so extract the 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 (35 lines × 2) pkg/kernel/lib/src/standard_bounds.dart:538 — pkg/kernel/lib/src/standard_bounds.dart:538-572 | pkg/kernel/lib/src/standard_bounds.dart:942-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/src/standard_bounds.dart:538` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (35 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:341 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:341-375 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:344-378 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 · Duplicated block (12–13 lines × 2) · ×9
  • Duplicated block (12–13 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2614 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2614-2626 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:2126-2137 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (12–13 lines × 2) pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:40 — pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:40-51 | pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart:40-52 — 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 `pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:40` it does not close everything it opens, so those exact lines 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) pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:144 — pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:144-155 | pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:182-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:144` 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–13 lines × 2) pkg/compiler/lib/src/js_backend/string_reference.dart:361 — pkg/compiler/lib/src/js_backend/string_reference.dart:361-373 | pkg/compiler/lib/src/js_backend/type_reference.dart:430-441 — 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 `pkg/compiler/lib/src/js_backend/string_reference.dart:361` 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 (12–13 lines × 2) pkg/front_end/lib/src/kernel/internal_ast.dart:6698 — pkg/front_end/lib/src/kernel/internal_ast.dart:6698-6709 | pkg/kernel/lib/src/ast/types.dart:1617-1629 — 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 `pkg/front_end/lib/src/kernel/internal_ast.dart:6698` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/source/diet_listener.dart:750 — pkg/front_end/lib/src/source/diet_listener.dart:750-762 | pkg/front_end/lib/src/source/diet_listener.dart:905-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/diet_listener.dart:750` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) pkg/front_end/lib/src/type_inference/type_schema_environment.dart:105 — pkg/front_end/lib/src/type_inference/type_schema_environment.dart:105-117 | pkg/front_end/lib/src/type_inference/type_schema_environment.dart:136-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/type_schema_environment.dart:105` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) pkg/kernel/lib/src/ast/expressions.dart:90 — pkg/kernel/lib/src/ast/expressions.dart:90-101 | pkg/kernel/lib/src/ast/expressions.dart:107-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/src/ast/expressions.dart:90` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12–13 lines × 2) pkg/observatory/lib/src/sample_profile/sample_profile.dart:138 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:138-149 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:454-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/sample_profile/sample_profile.dart:138` it does not close everything it opens, so those 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 `node` to `CodeCallTreeNode` in one and `FunctionCallTreeNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×9
  • Duplicated block (10 lines × 4) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:158 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:158-167 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:170-179 | pkg/front_end/tool/fuzz/analyzer_helper.dart:398-407 | pkg/front_end/tool/fuzz/analyzer_helper.dart:410-419 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart` and `pkg/front_end/tool/fuzz/analyzer_helper.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:158` 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 (10 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:14127 — pkg/analyzer/lib/src/dart/ast/ast.dart:14127-14136 | pkg/analyzer/lib/src/dart/ast/ast.dart:21094-21103 | pkg/analyzer/lib/src/dart/ast/ast.dart:21258-21267 | pkg/analyzer/lib/src/dart/ast/ast.dart:42478-42487 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/ast/ast.dart:21104` calls `_containsOffset` and `pkg/analyzer/lib/src/dart/ast/ast.dart:14137` 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 lines × 4) pkg/analyzer/lib/src/fine/manifest_item.dart:59 — pkg/analyzer/lib/src/fine/manifest_item.dart:59-68 | pkg/analyzer/lib/src/fine/manifest_item.dart:251-260 | pkg/analyzer/lib/src/fine/manifest_item.dart:440-449 | pkg/analyzer/lib/src/fine/manifest_item.dart:1297-1306 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/fine/manifest_item.dart:261` calls `empty` and `pkg/analyzer/lib/src/fine/manifest_item.dart:69` 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 (10 lines × 4) pkg/analyzer/lib/src/summary2/element_builder.dart:1637 — pkg/analyzer/lib/src/summary2/element_builder.dart:1637-1646 | pkg/analyzer/lib/src/summary2/element_builder.dart:1789-1798 | pkg/analyzer/lib/src/summary2/element_builder.dart:1840-1849 | pkg/analyzer/lib/src/summary2/element_builder.dart:1895-1904 — 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 `pkg/analyzer/lib/src/summary2/element_builder.dart:1637` it does not close everything it opens, so those 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 `node` to `covariant ExtensionDeclaration2Impl` in one and `covariant FunctionTypeAlias2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/summary2/element_builder.dart:1648` calls `accept2` and `pkg/analyzer/lib/src/summary2/element_builder.dart:1850` 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 lines × 4) pkg/analyzer/lib/src/summary2/informative_data.dart:297 — pkg/analyzer/lib/src/summary2/informative_data.dart:297-306 | pkg/analyzer/lib/src/summary2/informative_data.dart:332-341 | pkg/analyzer/lib/src/summary2/informative_data.dart:361-370 | pkg/analyzer/lib/src/summary2/informative_data.dart:491-500 — 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 `pkg/analyzer/lib/src/summary2/informative_data.dart:297` 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, `pkg/analyzer/lib/src/summary2/informative_data.dart:294` calls `_applyToConstructors` and `pkg/analyzer/lib/src/summary2/informative_data.dart:329` 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 lines × 4) pkg/kernel/lib/testing/type_parser.dart:104 — pkg/kernel/lib/testing/type_parser.dart:104-113 | pkg/kernel/lib/testing/type_parser.dart:144-153 | pkg/kernel/lib/testing/type_parser.dart:173-182 | pkg/kernel/lib/testing/type_parser.dart:208-217 — 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 `pkg/kernel/lib/testing/type_parser.dart:104` it does not close everything it opens, so those 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, `pkg/kernel/lib/testing/type_parser.dart:156` calls `write` and `pkg/kernel/lib/testing/type_parser.dart:185` 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 lines × 4) pkg/native_compiler/lib/snapshot/snapshot.dart:2728 — pkg/native_compiler/lib/snapshot/snapshot.dart:2728-2737 | pkg/native_compiler/lib/snapshot/snapshot.dart:2780-2789 | pkg/native_compiler/lib/snapshot/snapshot.dart:2838-2847 | pkg/native_compiler/lib/snapshot/snapshot.dart:2912-2921 — 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 (10 lines × 4) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:579 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:579-588 | sdk/lib/_internal/js_runtime/lib/js_number.dart:669-678 | sdk/lib/_internal/vm/lib/integers.dart:489-498 | sdk/lib/_internal/wasm/common/boxed_int.dart:383-392 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/private/js_number.dart:579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) pkg/front_end/lib/src/fragment/enum_element.dart:153 — pkg/front_end/lib/src/fragment/enum_element.dart:153-162 | pkg/front_end/lib/src/fragment/field/declaration.dart:662-671 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:169-178 | pkg/front_end/lib/src/source/source_enum_builder.dart:820-829 — before extracting anything, compare `pkg/front_end/lib/src/fragment/enum_element.dart` and `pkg/front_end/lib/src/fragment/field/declaration.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×9
  • Duplicated block (5 lines × 3) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:798 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:798-802 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1139-1143 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1586-1590 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `GetterDeclaration` in one and `MethodDeclaration2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1593` calls `_visitNode` and `pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:805` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1370 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1370-1374 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1405-1409 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1429-1433 — 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 `sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) pkg/analyzer/lib/src/summary2/element_builder.dart:1774 — pkg/analyzer/lib/src/summary2/element_builder.dart:1774-1778 | pkg/analyzer/lib/src/summary2/metadata_resolver.dart:182-186 | pkg/analyzer/lib/src/summary2/reference_resolver.dart:170-174 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `covariant FieldsDeclarationImpl` in one and `FieldsDeclaration` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 3) pkg/observatory/lib/src/elements/cpu_profile.dart:178 — pkg/observatory/lib/src/elements/cpu_profile.dart:178-182 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:498-502 | pkg/observatory/lib/src/elements/native_memory_profiler.dart:163-167 — 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 (5 lines × 3) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:157 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:157-161 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:164-168 | sdk/lib/_internal/wasm/js_common/regexp_helper.dart:148-152 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart` and `sdk/lib/_internal/js_runtime/lib/regexp_helper.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 × 3) pkg/analyzer/lib/src/fine/library_manifest.dart:117 — pkg/analyzer/lib/src/fine/library_manifest.dart:117-121 | pkg/analyzer/lib/src/fine/library_manifest_ids.dart:323-327 | pkg/analyzer/lib/src/fine/requirements.dart:935-939 — 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. 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 × 3) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:459 — pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:459-463 | pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:477-481 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1410-1414 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:468 — pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:468-472 | pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:486-490 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1418-1422 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:102 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:102-106 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:166-170 | sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:202-206 — 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 `sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×8
  • Edited copy of a member (40 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:381 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:381-420 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:384-423 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/analyzer/lib/src/dart/sdk/sdk.dart:90 — pkg/analyzer/lib/src/dart/sdk/sdk.dart:90-130 | pkg/analyzer/lib/src/dart/sdk/sdk.dart:247-286 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) sdk/lib/_http/http_impl.dart:1070 — sdk/lib/_http/http_impl.dart:1070-1109 | sdk/lib/io/io_sink.dart:233-272 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:478 — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:478-526 | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:528-567 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/compiler/lib/src/ssa/builder.dart:5927 — pkg/compiler/lib/src/ssa/builder.dart:5927-5966 | pkg/compiler/lib/src/ssa/builder.dart:6156-6202 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/analyzer/lib/src/summary2/element_builder.dart:373 — pkg/analyzer/lib/src/summary2/element_builder.dart:373-412 | pkg/analyzer/lib/src/summary2/element_builder.dart:623-662 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:10770 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:10770-10809 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:13348-13388 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2537 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2537-2578 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2580-2619 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×8
  • Edited copy of a member (41 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1053 — pkg/compiler/lib/src/js/rewrite_async.dart:1053-1093 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1079-1119 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:2894 — pkg/kernel/lib/binary/ast_to_binary.dart:2894-2934 | pkg/kernel/lib/binary/ast_to_binary.dart:2936-2983 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1281 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1281-1321 | sdk/lib/_internal/wasm/common/compact_hash.dart:1144-1197 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) sdk/lib/_internal/wasm/js_common/js_string.dart:261 — sdk/lib/_internal/wasm/js_common/js_string.dart:261-301 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:200-240 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:172 — pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:172-231 | pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:233-273 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) pkg/front_end/lib/src/base/name_space.dart:55 — pkg/front_end/lib/src/base/name_space.dart:55-97 | pkg/front_end/lib/src/base/name_space.dart:99-139 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) pkg/dart2wasm/lib/types.dart:709 — pkg/dart2wasm/lib/types.dart:709-749 | pkg/dart2wasm/lib/types.dart:765-805 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) pkg/kernel/lib/type_algebra.dart:1030 — pkg/kernel/lib/type_algebra.dart:1030-1070 | pkg/kernel/lib/type_algebra.dart:1381-1422 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×8
  • Edited copies of one member (3 members, 11+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:602 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:602-614 | sdk/lib/_internal/js_runtime/lib/js_number.dart:692-705 | sdk/lib/_internal/vm/lib/integers.dart:514-524 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/kernel/lib/visitor.dart:1910 — pkg/kernel/lib/visitor.dart:1910-1920 | pkg/vm/lib/transformations/type_flow/transformer.dart:3021-3034 | pkg/vm/lib/transformations/type_flow/transformer.dart:3050-3063 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:374 — pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:374-384 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:879-889 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:952-962 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/native_compiler/lib/snapshot/snapshot.dart:1260 — pkg/native_compiler/lib/snapshot/snapshot.dart:1260-1273 | pkg/native_compiler/lib/snapshot/snapshot.dart:1288-1300 | pkg/native_compiler/lib/snapshot/snapshot.dart:1635-1645 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:117 — pkg/compiler/lib/src/ssa/value_range_analyzer.dart:117-131 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:133-147 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:161-171 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:9154 — pkg/front_end/lib/src/kernel/body_builder.dart:9154-9164 | pkg/front_end/lib/src/kernel/body_builder.dart:9166-9176 | pkg/front_end/lib/src/kernel/body_builder.dart:9178-9188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3682 — pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3682-3692 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3694-3704 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:3706-3718 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2454 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2454-2464 | sdk/lib/_internal/wasm/common/typed_data.dart:69-79 | tools/dom/src/_ListIterators.dart:19-29 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×8
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/compiler/lib/src/inferrer/node_tracer.dart:297 — pkg/compiler/lib/src/inferrer/node_tracer.dart:297-315 | pkg/compiler/lib/src/inferrer/node_tracer.dart:317-336 | pkg/compiler/lib/src/inferrer/node_tracer.dart:338-357 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/front_end/lib/src/util/outline_extractor.dart:677 — pkg/front_end/lib/src/util/outline_extractor.dart:677-696 | pkg/front_end/lib/src/util/outline_extractor.dart:935-953 | pkg/front_end/lib/src/util/outline_extractor.dart:955-973 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:8054 — pkg/analyzer/lib/src/dart/ast/ast.dart:8054-8080 | pkg/analyzer/lib/src/dart/ast/ast.dart:8888-8909 | pkg/analyzer/lib/src/dart/ast/ast.dart:18435-18453 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/analyzer/lib/src/dart/analysis/index.dart:743 — pkg/analyzer/lib/src/dart/analysis/index.dart:743-762 | pkg/analyzer/lib/src/dart/analysis/index.dart:1021-1039 | pkg/analyzer/lib/src/dart/analysis/index.dart:1096-1117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:118 — pkg/compiler/lib/src/js/size_estimator.dart:118-136 | pkg/dev_compiler/lib/src/js_ast/printer.dart:230-249 | pkg/js_ast/lib/src/printer.dart:303-322 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:3074 — pkg/analyzer/lib/src/fasta/ast_builder.dart:3074-3092 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3873-3894 | pkg/analyzer/lib/src/fasta/ast_builder.dart:4083-4104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/front_end/lib/src/fragment/primary_constructor_field.dart:148 — pkg/front_end/lib/src/fragment/primary_constructor_field.dart:148-167 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:180-198 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:235-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/test_runner/lib/src/runtime_configuration.dart:218 — pkg/test_runner/lib/src/runtime_configuration.dart:218-249 | pkg/test_runner/lib/src/runtime_configuration.dart:266-284 | pkg/test_runner/lib/src/runtime_configuration.dart:293-319 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×8
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:2321 — pkg/kernel/lib/binary/ast_to_binary.dart:2321-2335 | pkg/kernel/lib/binary/ast_to_binary.dart:2414-2430 | pkg/kernel/lib/binary/ast_to_binary.dart:2432-2448 | pkg/kernel/lib/binary/ast_to_binary.dart:2515-2531 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:406 — pkg/compiler/lib/src/ssa/value_range_analyzer.dart:406-420 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:422-436 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:469-483 | pkg/compiler/lib/src/ssa/value_range_analyzer.dart:485-499 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:828 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:828-845 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:873-888 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:890-907 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:909-923 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/compiler/lib/src/inferrer/builder.dart:1193 — pkg/compiler/lib/src/inferrer/builder.dart:1193-1207 | pkg/compiler/lib/src/inferrer/builder.dart:1209-1225 | pkg/compiler/lib/src/inferrer/builder.dart:1227-1241 | pkg/compiler/lib/src/inferrer/builder.dart:1243-1257 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:12806 — pkg/analyzer/lib/src/dart/ast/ast.dart:12806-12822 | pkg/analyzer/lib/src/dart/ast/ast.dart:17721-17736 | pkg/analyzer/lib/src/dart/ast/ast.dart:20999-21014 | pkg/analyzer/lib/src/dart/ast/ast.dart:32465-32479 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:506 — pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:506-520 | pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:522-536 | pkg/linter/lib/src/rules/parameter_assignments.dart:121-135 | pkg/linter/lib/src/rules/parameter_assignments.dart:137-151 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:29294 — pkg/analyzer/lib/src/dart/ast/ast.dart:29294-29308 | pkg/analyzer/lib/src/dart/ast/ast.dart:40048-40062 | pkg/analyzer/lib/src/dart/ast/ast.dart:40363-40381 | pkg/analyzer/lib/src/dart/ast/ast.dart:54188-54202 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 15+ corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:730 — pkg/kernel/lib/binary/ast_to_binary.dart:730-745 | pkg/kernel/lib/binary/ast_to_binary.dart:747-761 | pkg/kernel/lib/binary/ast_to_binary.dart:763-778 | pkg/kernel/lib/binary/ast_to_binary.dart:780-794 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×8
  • Edited copy of a member (2 corresponding lines) sdk/lib/collection/maps.dart:371 — sdk/lib/collection/maps.dart:371-372 | sdk/lib/io/platform_impl.dart:172-173 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) pkg/js_ast/lib/src/nodes.dart:788 — pkg/js_ast/lib/src/nodes.dart:788-790 | pkg/kernel/lib/src/ast/statements.dart:108-109 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1128 — pkg/js_ast/lib/src/nodes.dart:1128-1130 | pkg/kernel/lib/src/ast/expressions.dart:4762-4763 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1189 — pkg/js_ast/lib/src/nodes.dart:1189-1191 | pkg/kernel/lib/src/ast/statements.dart:1239-1240 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) pkg/js_ast/lib/src/nodes.dart:1461 — pkg/js_ast/lib/src/nodes.dart:1461-1463 | pkg/kernel/lib/src/ast/names.dart:54-55 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:889 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:889-890 | sdk/lib/_internal/wasm/common/compact_hash.dart:812-813 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) sdk/lib/collection/list.dart:181 — sdk/lib/collection/list.dart:181-182 | sdk/lib/internal/iterable.dart:186-187 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) tools/generate_package_config.py:23 — tools/generate_package_config.py:23-24 | tools/utils.py:510-511 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×8
  • Duplicated block (17 lines × 3) pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:71 — pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:71-87 | pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:56-72 | pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart:51-67 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart` and `pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:71` 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 (17 lines × 3) pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:60 — pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:60-76 | pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart:78-94 | pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart:82-98 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart` and `pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:60` 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) pkg/analyzer/lib/src/dart/ast/ast.dart:22386 — pkg/analyzer/lib/src/dart/ast/ast.dart:22386-22402 | pkg/analyzer/lib/src/dart/ast/ast.dart:52692-52708 | pkg/analyzer/lib/src/dart/ast/ast.dart:56351-56367 — 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 (17 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:394 — pkg/front_end/lib/src/fragment/getter/encoding.dart:394-410 | pkg/front_end/lib/src/fragment/method/encoding.dart:303-319 | pkg/front_end/lib/src/fragment/setter/encoding.dart:399-415 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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. 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 (17 lines × 3) pkg/front_end/lib/src/fragment/method/encoding.dart:225 — pkg/front_end/lib/src/fragment/method/encoding.dart:225-241 | pkg/front_end/lib/src/fragment/method/encoding.dart:566-582 | pkg/front_end/lib/src/fragment/setter/encoding.dart:288-304 — `pkg/front_end/lib/src/fragment/method/encoding.dart` and `pkg/front_end/lib/src/fragment/setter/encoding.dart` 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 16 separate duplicated blocks between them, totalling at least 318 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 `pkg/front_end/lib/src/fragment/method/encoding.dart:225` 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 × 3) pkg/front_end/lib/src/kernel/expression_generator.dart:528 — pkg/front_end/lib/src/kernel/expression_generator.dart:528-544 | pkg/front_end/lib/src/kernel/expression_generator.dart:1486-1502 | pkg/front_end/lib/src/kernel/expression_generator.dart:2438-2454 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 3) pkg/front_end/lib/src/kernel/forwarding_node.dart:358 — pkg/front_end/lib/src/kernel/forwarding_node.dart:358-374 | pkg/front_end/lib/src/kernel/forwarding_node.dart:391-407 | pkg/front_end/lib/src/kernel/forwarding_node.dart:449-465 — 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 (17 lines × 3) pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:46 — pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:46-62 | pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:106-122 | pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:166-182 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×8
  • Duplicated block (15–16 lines × 2) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:577 — pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:577-591 | pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:594-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–16 lines × 2) pkg/analyzer/lib/src/summary2/bundle_reader.dart:276 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:276-291 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:471-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:276` 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–16 lines × 2) pkg/compiler/lib/src/ir/scope_visitor.dart:1167 — pkg/compiler/lib/src/ir/scope_visitor.dart:1167-1182 | pkg/compiler/lib/src/ir/scope_visitor.dart:1186-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ir/scope_visitor.dart:1167` 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 `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 `node` to `ir.InstanceGetterInvocation` in one and `ir.DynamicInvocation` 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–16 lines × 2) pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:103 — pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:103-117 | pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:142-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:103` 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–16 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:216 — pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:216-231 | pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:450-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:216` it does not close everything it opens, so those exact lines 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–16 lines × 2) pkg/front_end/lib/src/source/outline_builder.dart:2644 — pkg/front_end/lib/src/source/outline_builder.dart:2644-2658 | pkg/front_end/lib/src/source/outline_builder.dart:4692-4707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/outline_builder.dart:2644` it does not close everything it opens, so those exact lines 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–16 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3974 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3974-3988 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:4907-4922 — both copies are in the same file, so extract the 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–16 lines × 2) pkg/observatory/lib/src/elements/class_view.dart:489 — pkg/observatory/lib/src/elements/class_view.dart:489-504 | pkg/observatory/lib/src/elements/library_view.dart:305-319 — 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 `pkg/observatory/lib/src/elements/class_view.dart:489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×8
  • Duplicated block (13 lines × 4) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:28 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:28-40 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmented.dart:28-40 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart:31-43 | pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:41-53 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart` and `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmented.dart` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:28` 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 (13 lines × 4) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:165 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:165-177 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:257-269 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:294-306 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:386-398 — 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 (13 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:6292 — pkg/analyzer/lib/src/dart/ast/ast.dart:6292-6304 | pkg/analyzer/lib/src/dart/ast/ast.dart:15762-15774 | pkg/analyzer/lib/src/dart/ast/ast.dart:16499-16511 | pkg/analyzer/lib/src/dart/ast/ast.dart:61535-61547 — 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 (13 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:6360 — pkg/analyzer/lib/src/dart/ast/ast.dart:6360-6372 | pkg/analyzer/lib/src/dart/ast/ast.dart:15837-15849 | pkg/analyzer/lib/src/dart/ast/ast.dart:16570-16582 | pkg/analyzer/lib/src/dart/ast/ast.dart:61610-61622 — 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. 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 × 4) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:227 — pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:227-239 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:249-261 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:304-316 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:322-334 — 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 (13 lines × 4) pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766 — pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766-778 | sdk/lib/_http/http_impl.dart:1150-1162 | sdk/lib/_internal/vm_shared/lib/string_buffer_patch.dart:102-114 | sdk/lib/io/io_sink.dart:298-310 — before extracting anything, compare `sdk/lib/_http/http_impl.dart` and `sdk/lib/io/io_sink.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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 `pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766` 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 (13 lines × 4) pkg/front_end/testcases/general/pure_index_expressions.dart:32 — pkg/front_end/testcases/general/pure_index_expressions.dart:32-44 | pkg/front_end/testcases/general/pure_index_expressions.dart:63-75 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:41-53 | pkg/front_end/testcases/nnbd/pure_index_expressions.dart:74-86 — `pkg/front_end/testcases/general/pure_index_expressions.dart` and `pkg/front_end/testcases/nnbd/pure_index_expressions.dart` 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 7 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 `pkg/front_end/testcases/general/pure_index_expressions.dart:32` 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 × 4) sdk/lib/vmservice/devfs.dart:226 — sdk/lib/vmservice/devfs.dart:226-238 | sdk/lib/vmservice/devfs.dart:283-295 | sdk/lib/vmservice/devfs.dart:340-352 | sdk/lib/vmservice/devfs.dart:400-412 — 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 `sdk/lib/vmservice/devfs.dart:226` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×8
  • Duplicated block (11–12 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:203 — pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:203-214 | pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:254-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_states.dart:203` it does not close everything it opens, so those 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–12 lines × 2) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:223 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:223-234 | pkg/front_end/tool/fuzz/analyzer_helper.dart:443-453 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart` and `pkg/front_end/tool/fuzz/analyzer_helper.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:235` calls `now` and `pkg/front_end/tool/fuzz/analyzer_helper.dart:454` 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–12 lines × 2) pkg/analyzer/lib/src/dart/micro/resolve_file.dart:322 — pkg/analyzer/lib/src/dart/micro/resolve_file.dart:322-332 | pkg/analyzer/lib/src/dart/micro/resolve_file.dart:515-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/micro/resolve_file.dart:322` 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 (11–12 lines × 2) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1159 — pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1159-1169 | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1275-1286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1159` 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 (11–12 lines × 2) pkg/front_end/lib/src/fragment/field/encoding.dart:1338 — pkg/front_end/lib/src/fragment/field/encoding.dart:1338-1349 | pkg/front_end/lib/src/fragment/field/encoding.dart:1629-1639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/field/encoding.dart:1338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) sdk/lib/_http/http_impl.dart:2440 — sdk/lib/_http/http_impl.dart:2440-2451 | sdk/lib/_http/http_impl.dart:2454-2464 — both copies are in the same file, so extract the 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 × 2) sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:114 — sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:114-124 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:136-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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) pkg/test_runner/lib/src/runtime_configuration.dart:469 — pkg/test_runner/lib/src/runtime_configuration.dart:469-479 | pkg/test_runner/lib/src/runtime_configuration.dart:504-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/test_runner/lib/src/runtime_configuration.dart:469` 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.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×7
  • Edited copy of a member (42 corresponding lines) pkg/analyzer/lib/src/binary/string_table.dart:84 — pkg/analyzer/lib/src/binary/string_table.dart:84-125 | pkg/kernel/lib/binary/ast_from_binary.dart:307-348 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:193 — pkg/front_end/lib/src/kernel/internal_ast.dart:193-234 | pkg/front_end/lib/src/kernel/internal_ast.dart:7480-7521 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/analyzer/lib/src/dart/analysis/results.dart:337 — pkg/analyzer/lib/src/dart/analysis/results.dart:337-378 | pkg/analyzer/lib/src/dart/analysis/results.dart:492-535 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3538 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3538-3579 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3581-3638 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:989 — pkg/compiler/lib/src/js/size_estimator.dart:989-1030 | pkg/js_ast/lib/src/printer.dart:1414-1463 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:428 — pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:428-474 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1306-1347 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:1007 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1007-1058 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1330-1371 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×7
  • Edited copy of a member (33 corresponding lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:736 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:736-769 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1208-1240 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:711 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:711-743 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:1008-1049 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1143 — pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1143-1175 | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1257-1292 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:3698 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3698-3732 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4299-4331 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/front_end/tool/interval_list.dart:41 — pkg/front_end/tool/interval_list.dart:41-76 | pkg/kernel/lib/class_hierarchy.dart:1991-2023 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/front_end/lib/src/builder/type_parameter_builder.dart:326 — pkg/front_end/lib/src/builder/type_parameter_builder.dart:326-358 | pkg/front_end/lib/src/builder/type_parameter_builder.dart:610-645 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) pkg/dart2wasm/lib/functions.dart:502 — pkg/dart2wasm/lib/functions.dart:502-534 | pkg/dart2wasm/lib/functions.dart:536-573 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 22+ corresponding lines) sdk/lib/_internal/vm/lib/mirrors_impl.dart:242 — sdk/lib/_internal/vm/lib/mirrors_impl.dart:242-263 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:338-360 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:710-742 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) sdk/lib/_internal/wasm/common/simd.dart:82 — sdk/lib/_internal/wasm/common/simd.dart:82-103 | sdk/lib/_internal/wasm/common/simd.dart:186-209 | sdk/lib/_internal/wasm/common/simd.dart:286-309 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) sdk/lib/_internal/wasm/js/string_patch.dart:53 — sdk/lib/_internal/wasm/js/string_patch.dart:53-79 | sdk/lib/_internal/wasm/js/string_patch.dart:81-102 | sdk/lib/_internal/wasm/js/string_patch.dart:126-152 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) pkg/kernel/lib/src/dart_type_equivalence.dart:164 — pkg/kernel/lib/src/dart_type_equivalence.dart:164-190 | pkg/kernel/lib/src/dart_type_equivalence.dart:192-218 | pkg/kernel/lib/src/dart_type_equivalence.dart:331-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:1528 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1528-1550 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1552-1574 | pkg/observatory/lib/src/elements/process_snapshot.dart:614-635 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:267 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:267-288 | sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:316-339 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:641-663 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) sdk/lib/_internal/wasm/common/type.dart:1019 — sdk/lib/_internal/wasm/common/type.dart:1019-1040 | sdk/lib/_internal/wasm/common/type.dart:1042-1065 | sdk/lib/_internal/wasm/common/type.dart:1067-1094 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×7
  • Edited copies of one member (4 members, 11+ corresponding lines) sdk/lib/_internal/vm_shared/lib/collection_patch.dart:60 — sdk/lib/_internal/vm_shared/lib/collection_patch.dart:60-70 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:85-97 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:400-410 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:412-424 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) pkg/compiler/lib/src/ssa/optimize.dart:4557 — pkg/compiler/lib/src/ssa/optimize.dart:4557-4569 | pkg/compiler/lib/src/ssa/optimize.dart:4571-4585 | pkg/compiler/lib/src/ssa/optimize.dart:4678-4688 | pkg/compiler/lib/src/ssa/optimize.dart:4714-4727 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) pkg/compiler/lib/src/common/codegen.dart:556 — pkg/compiler/lib/src/common/codegen.dart:556-566 | pkg/compiler/lib/src/elements/entities.dart:467-477 | pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart:110-120 | pkg/compiler/lib/src/js_model/locals.dart:625-637 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) pkg/observatory/lib/object_graph.dart:441 — pkg/observatory/lib/object_graph.dart:441-452 | pkg/observatory/lib/object_graph.dart:454-465 | pkg/observatory/lib/object_graph.dart:467-478 | pkg/observatory/lib/object_graph.dart:480-490 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:2525 — sdk/lib/_internal/js_shared/lib/rti.dart:2525-2535 | sdk/lib/_internal/js_shared/lib/rti.dart:2656-2668 | sdk/lib/_internal/js_shared/lib/rti.dart:2699-2711 | sdk/lib/_internal/js_shared/lib/rti.dart:2782-2794 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) pkg/front_end/lib/src/kernel/inferred_collections.dart:185 — pkg/front_end/lib/src/kernel/inferred_collections.dart:185-198 | pkg/front_end/lib/src/kernel/inferred_collections.dart:218-229 | pkg/kernel/lib/src/ast/patterns.dart:2357-2369 | pkg/kernel/lib/src/ast/statements.dart:1099-1109 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_static.dart:22 — pkg/analysis_server/lib/src/services/correction/dart/add_static.dart:22-32 | pkg/analysis_server/lib/src/services/correction/dart/remove_dead_if_null.dart:26-36 | pkg/analysis_server/lib/src/services/correction/dart/remove_primary_constructor_body.dart:24-34 | pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_library_directive.dart:22-33 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 8+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:215 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:215-222 | sdk/lib/_internal/js_dev_runtime/private/js_array.dart:457-465 | sdk/lib/_internal/js_dev_runtime/private/js_array.dart:467-475 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/front_end/testcases/general/inject_private_patch/origin_lib.dart:6 — pkg/front_end/testcases/general/inject_private_patch/origin_lib.dart:6-13 | pkg/front_end/testcases/general/inject_private_patch/patch_lib1.dart:10-17 | pkg/front_end/testcases/general/inject_private_patch/patch_lib2.dart:10-17 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:124 — pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:124-131 | pkg/compiler/lib/src/js_backend/string_reference.dart:139-146 | pkg/compiler/lib/src/js_backend/type_reference.dart:155-162 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:294 — pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:294-308 | pkg/compiler/lib/src/js_backend/string_reference.dart:202-209 | pkg/compiler/lib/src/js_backend/type_reference.dart:204-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/analyzer/lib/src/binary/binary_writer.dart:314 — pkg/analyzer/lib/src/binary/binary_writer.dart:314-321 | pkg/compiler/lib/src/serialization/binary_sink.dart:114-123 | pkg/kernel/lib/binary/ast_to_binary.dart:126-134 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/front_end/testcases/general/inject_private_patch/origin_lib.dart:15 — pkg/front_end/testcases/general/inject_private_patch/origin_lib.dart:15-22 | pkg/front_end/testcases/general/inject_private_patch/patch_lib1.dart:19-26 | pkg/front_end/testcases/general/inject_private_patch/patch_lib2.dart:19-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) pkg/front_end/lib/src/builder/extension_type_declaration_builder.dart:63 — pkg/front_end/lib/src/builder/extension_type_declaration_builder.dart:63-70 | pkg/front_end/lib/src/builder/type_alias_builder.dart:628-637 | pkg/front_end/lib/src/builder/type_parameter_builder.dart:135-144 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×7
  • Duplicated block (33 lines × 2) pkg/analysis_server/lib/src/server/crash_reporting.dart:22 — pkg/analysis_server/lib/src/server/crash_reporting.dart:22-54 | pkg/analysis_server/lib/src/session_logger/crash_reporting_session_listener.dart:36-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (33 lines × 2) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:478 — pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:478-510 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart:187-219 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart` and `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 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 `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:478` 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 (33 lines × 2) pkg/compiler/lib/src/dump_info.dart:1879 — pkg/compiler/lib/src/dump_info.dart:1879-1911 | pkg/compiler/lib/src/dump_info.dart:1967-1999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/dump_info.dart:1879` 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 (33 lines × 2) pkg/dart2wasm/lib/async.dart:229 — pkg/dart2wasm/lib/async.dart:229-261 | pkg/dart2wasm/lib/sync_star.dart:198-230 — before extracting anything, compare `pkg/dart2wasm/lib/async.dart` and `pkg/dart2wasm/lib/sync_star.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 (33 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2301 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2301-2333 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2601-2633 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (33 lines × 2) pkg/kernel/lib/text/ast_to_text.dart:1542 — pkg/kernel/lib/text/ast_to_text.dart:1542-1574 | pkg/kernel/lib/text/ast_to_text.dart:1627-1659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/text/ast_to_text.dart:1542` 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 (33 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1823 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1823-1855 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1841-1873 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×7
  • Duplicated block (21 lines × 3) pkg/analysis_server/lib/protocol/protocol.dart:193 — pkg/analysis_server/lib/protocol/protocol.dart:193-213 | pkg/analysis_server_client/lib/src/protocol/protocol_base.dart:177-197 | pkg/analyzer_plugin/lib/protocol/protocol.dart:207-227 — before extracting anything, compare `pkg/analysis_server/lib/protocol/protocol.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_base.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 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 × 3) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:26 — pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:26-46 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmented.dart:26-46 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_super.dart:29-49 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart` and `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmented.dart` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:26` it does not close everything it opens, so those 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 (21 lines × 3) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:108 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:108-128 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:178-198 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:200-220 — 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, `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:199` calls `send`, `cancelRequest` and `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (21 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:37258 — pkg/analyzer/lib/src/dart/ast/ast.dart:37258-37278 | pkg/analyzer/lib/src/dart/ast/ast.dart:40150-40170 | pkg/analyzer/lib/src/dart/ast/ast.dart:58639-58659 — 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 (21 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:37280 — pkg/analyzer/lib/src/dart/ast/ast.dart:37280-37300 | pkg/analyzer/lib/src/dart/ast/ast.dart:40172-40192 | pkg/analyzer/lib/src/dart/ast/ast.dart:58661-58681 — 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 (21 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1424 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1424-1444 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1443-1463 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1917-1937 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1303 — sdk/lib/_internal/vm/lib/convert_patch.dart:1303-1323 | sdk/lib/_internal/wasm/common/convert_patch.dart:1489-1509 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1181-1201 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1303` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×7
  • Duplicated block (16–17 lines × 2) pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:84 — pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:84-100 | pkg/_fe_analyzer_shared/lib/src/sdk/allowed_experiments.dart:104-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 (16–17 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:63 — pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:63-78 | pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:93-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:63` it does not close everything it opens, so those 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, `pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:110` calls `writeln`, `write` and `pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:79` 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) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:184 — pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:184-199 | pkg/front_end/tool/fuzz/analyzer_helper.dart:166-182 — 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 `pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:184` it does not close everything it opens, so those 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 (16–17 lines × 2) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:190 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:190-205 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:310-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:190` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16–17 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:6502 — pkg/compiler/lib/src/ssa/builder.dart:6502-6518 | pkg/compiler/lib/src/ssa/builder.dart:6535-6550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:6502` 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 (16–17 lines × 2) pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:322 — pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:322-338 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:345-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–17 lines × 2) pkg/front_end/lib/src/fragment/field/declaration.dart:432 — pkg/front_end/lib/src/fragment/field/declaration.dart:432-448 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:148-163 — before extracting anything, compare `pkg/front_end/lib/src/fragment/field/declaration.dart` and `pkg/front_end/lib/src/fragment/primary_constructor_field.dart` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 `pkg/front_end/lib/src/fragment/field/declaration.dart:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×7
  • Duplicated block (14–15 lines × 2) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:168 — pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:168-181 | pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:227-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:168` 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 (14–15 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13948 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:13948-13961 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:14013-14027 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14–15 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2351 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2351-2364 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2365-2379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2351` 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 × 2) pkg/front_end/tool/flame/instrumenter_suite.dart:79 — pkg/front_end/tool/flame/instrumenter_suite.dart:79-93 | pkg/front_end/tool/flame/instrumenter_suite.dart:95-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/tool/flame/instrumenter_suite.dart: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.
  • Duplicated block (14–15 lines × 2) pkg/observatory/lib/src/elements/allocation_profile.dart:325 — pkg/observatory/lib/src/elements/allocation_profile.dart:325-338 | pkg/observatory/lib/src/elements/allocation_profile.dart:367-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/allocation_profile.dart:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) pkg/observatory/lib/src/elements/heap_snapshot.dart:643 — pkg/observatory/lib/src/elements/heap_snapshot.dart:643-656 | pkg/observatory/lib/src/elements/process_snapshot.dart:329-343 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–15 lines × 2) pkg/observatory/lib/src/service/object.dart:1990 — pkg/observatory/lib/src/service/object.dart:1990-2003 | pkg/observatory/lib/src/service/object.dart:2029-2043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/service/object.dart:1990` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×7
  • Duplicated block (6 lines × 4) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:621 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:621-626 | sdk/lib/_internal/js_runtime/lib/js_number.dart:713-718 | sdk/lib/_internal/vm/lib/integers.dart:529-534 | sdk/lib/_internal/wasm/common/boxed_int.dart:424-429 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/private/js_number.dart:621` 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 (6 lines × 4) sdk/lib/_internal/vm/lib/typed_data_patch.dart:1248 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:1248-1253 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:1296-1301 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2633-2638 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:2678-2683 — 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 `sdk/lib/_internal/vm/lib/typed_data_patch.dart:1248` it does not close everything it opens, so those exact lines 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 × 4) pkg/analyzer/lib/src/dart/element/element.dart:4212 — pkg/analyzer/lib/src/dart/element/element.dart:4212-4217 | pkg/analyzer/lib/src/dart/element/element.dart:9605-9610 | pkg/analyzer/lib/src/dart/element/element.dart:11754-11759 | pkg/analyzer/lib/src/dart/element/member.dart:596-601 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analyzer/lib/src/dart/element/member.dart:592` calls `appendTo`, `toString` and `pkg/analyzer/lib/src/dart/element/element.dart:4209` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) pkg/front_end/lib/src/kernel/internal_ast.dart:6820 — pkg/front_end/lib/src/kernel/internal_ast.dart:6820-6826 | pkg/front_end/lib/src/kernel/internal_ast.dart:6850-6856 | pkg/kernel/lib/src/ast/patterns.dart:156-161 | pkg/kernel/lib/src/ast/patterns.dart:213-218 — before extracting anything, compare `pkg/front_end/lib/src/kernel/internal_ast.dart` and `pkg/kernel/lib/src/ast/patterns.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 80 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 (6 lines × 4) pkg/kernel/lib/src/ast/expressions.dart:1936 — pkg/kernel/lib/src/ast/expressions.dart:1936-1941 | pkg/kernel/lib/src/ast/expressions.dart:5048-5053 | pkg/kernel/lib/src/ast/statements.dart:972-977 | pkg/kernel/lib/src/ast/statements.dart:1285-1290 — before extracting anything, compare `pkg/kernel/lib/src/ast/expressions.dart` and `pkg/kernel/lib/src/ast/statements.dart` as WHOLE FILES: this scan already matched 5 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. 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 × 4) pkg/kernel/lib/src/ast/expressions.dart:384 — pkg/kernel/lib/src/ast/expressions.dart:384-389 | pkg/kernel/lib/src/ast/expressions.dart:1864-1869 | pkg/kernel/lib/src/ast/statements.dart:18-23 | pkg/kernel/lib/src/ast/types.dart:2080-2085 — before extracting anything, compare `pkg/kernel/lib/src/ast/expressions.dart` and `pkg/kernel/lib/src/ast/statements.dart` as WHOLE FILES: this scan already matched 5 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/kernel/lib/src/ast/expressions.dart:382` calls `of` and `pkg/kernel/lib/src/ast/statements.dart:16` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:108 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:108-113 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:695-700 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1137-1142 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:67-72 — before extracting anything, compare `sdk/lib/_internal/js_runtime/lib/collection_patch.dart` and `sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart` as WHOLE FILES: this scan already matched 8 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. 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.
D35 · Change Coupling · Change-coupling hub · ×6
  • Change-coupling hub: code_generator.dart → constraints.dart, recognized_methods.dart, lowering.dart pkg/native_compiler/lib/back_end/arm64/code_generator.dart — `pkg/native_compiler/lib/back_end/arm64/code_generator.dart` changes together with 3 other files — `pkg/native_compiler/lib/back_end/arm64/constraints.dart`, `pkg/native_compiler/lib/front_end/recognized_methods.dart`, `pkg/native_compiler/lib/passes/lowering.dart` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: driver.dart → requirement_failure.dart, ast_binary_tag.dart, ast_binary_writer.dart pkg/analyzer/lib/src/dart/analysis/driver.dart — `pkg/analyzer/lib/src/dart/analysis/driver.dart` changes together with 3 other files — `pkg/analyzer/lib/src/fine/requirement_failure.dart`, `pkg/analyzer/lib/src/summary2/ast_binary_tag.dart`, `pkg/analyzer/lib/src/summary2/ast_binary_writer.dart` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: simplification.dart → flow_graph_builder.dart, code_generator.dart, constraints.dart, recognized_methods.dart pkg/cfg/lib/passes/simplification.dart — `pkg/cfg/lib/passes/simplification.dart` changes together with 4 other files — `pkg/cfg/lib/ir/flow_graph_builder.dart`, `pkg/native_compiler/lib/back_end/arm64/code_generator.dart`, `pkg/native_compiler/lib/back_end/arm64/constraints.dart`, `pkg/native_compiler/lib/front_end/recognized_methods.dart` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
  • Change-coupling hub: flow_graph_checker.dart → flow_graph_builder.dart, constant_propagation.dart, simplification.dart, code_generator.dart, constraints.dart, recognized_methods.dart pkg/cfg/lib/ir/flow_graph_checker.dart — `pkg/cfg/lib/ir/flow_graph_checker.dart` changes together with 6 other files — `pkg/cfg/lib/ir/flow_graph_builder.dart`, `pkg/cfg/lib/passes/constant_propagation.dart`, `pkg/cfg/lib/passes/simplification.dart`, `pkg/native_compiler/lib/back_end/arm64/code_generator.dart`, `pkg/native_compiler/lib/back_end/arm64/constraints.dart`, `pkg/native_compiler/lib/front_end/recognized_methods.dart` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
  • Change-coupling hub: internal_ast_helper.dart → value_kinds.dart, shared_type_analyzer.dart, type_checker.dart pkg/front_end/lib/src/kernel/internal_ast_helper.dart — `pkg/front_end/lib/src/kernel/internal_ast_helper.dart` changes together with 3 other files — `pkg/front_end/lib/src/source/value_kinds.dart`, `pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart`, `pkg/kernel/lib/type_checker.dart` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: constant_propagation.dart → flow_graph_builder.dart, simplification.dart, code_generator.dart, constraints.dart, recognized_methods.dart pkg/cfg/lib/passes/constant_propagation.dart — `pkg/cfg/lib/passes/constant_propagation.dart` changes together with 5 other files — `pkg/cfg/lib/ir/flow_graph_builder.dart`, `pkg/cfg/lib/passes/simplification.dart`, `pkg/native_compiler/lib/back_end/arm64/code_generator.dart`, `pkg/native_compiler/lib/back_end/arm64/constraints.dart`, `pkg/native_compiler/lib/front_end/recognized_methods.dart` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×6
  • Edited copy of a member (45 corresponding lines) pkg/observatory/lib/src/elements/heap_snapshot.dart:670 — pkg/observatory/lib/src/elements/heap_snapshot.dart:670-966 | pkg/observatory/lib/src/elements/process_snapshot.dart:358-450 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:965 — pkg/compiler/lib/src/js/rewrite_async.dart:965-1009 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:980-1024 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:20 — pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart:20-64 | pkg/analysis_server/lib/src/handler/legacy/edit_sort_members.dart:20-67 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) sdk/lib/_internal/vm/lib/double.dart:340 — sdk/lib/_internal/vm/lib/double.dart:340-384 | sdk/lib/_internal/wasm/common/boxed_double.dart:342-389 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) pkg/front_end/lib/src/source/source_extension_builder.dart:146 — pkg/front_end/lib/src/source/source_extension_builder.dart:146-190 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:184-235 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) pkg/dev_compiler/lib/src/js_ast/nodes.dart:1359 — pkg/dev_compiler/lib/src/js_ast/nodes.dart:1359-1403 | pkg/js_ast/lib/src/nodes.dart:1812-1856 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×6
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/kernel/lib/src/bounds_checks.dart:711 — pkg/kernel/lib/src/bounds_checks.dart:711-731 | pkg/kernel/lib/src/replacement_visitor.dart:191-203 | pkg/kernel/lib/src/replacement_visitor.dart:350-365 | pkg/kernel/lib/src/replacement_visitor.dart:384-401 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/compiler/lib/src/constants/values.dart:1033 — pkg/compiler/lib/src/constants/values.dart:1033-1047 | pkg/compiler/lib/src/constants/values.dart:1049-1065 | pkg/compiler/lib/src/constants/values.dart:1159-1171 | pkg/compiler/lib/src/constants/values.dart:1173-1186 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/linter/lib/src/rules/unnecessary_overrides.dart:187 — pkg/linter/lib/src/rules/unnecessary_overrides.dart:187-201 | pkg/linter/lib/src/rules/unnecessary_overrides.dart:215-229 | pkg/linter/lib/src/rules/unnecessary_overrides.dart:249-263 | pkg/linter/lib/src/rules/unnecessary_overrides.dart:298-310 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:20334 — pkg/analyzer/lib/src/dart/ast/ast.dart:20334-20350 | pkg/analyzer/lib/src/dart/ast/ast.dart:28214-28226 | pkg/analyzer/lib/src/dart/ast/ast.dart:28920-28932 | pkg/analyzer/lib/src/dart/ast/ast.dart:49183-49199 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/kernel/lib/src/constant_replacer.dart:114 — pkg/kernel/lib/src/constant_replacer.dart:114-126 | pkg/kernel/lib/src/constant_replacer.dart:128-140 | pkg/kernel/lib/src/constant_replacer.dart:167-179 | pkg/kernel/lib/type_algebra.dart:1637-1650 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 13+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:18618 — pkg/analyzer/lib/src/dart/ast/ast.dart:18618-18630 | pkg/analyzer/lib/src/dart/ast/ast.dart:20474-20487 | pkg/analyzer/lib/src/dart/ast/ast.dart:21655-21667 | pkg/analyzer/lib/src/dart/ast/ast.dart:41561-41575 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) · ×6
  • Edited copies of one member (6 members, 11+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:3023 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:3023-3033 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3046-3056 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3069-3079 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3092-3102 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3115-3125 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3138-3148 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) pkg/front_end/tool/parser_ast_indexer.dart:90 — pkg/front_end/tool/parser_ast_indexer.dart:90-100 | pkg/front_end/tool/parser_ast_indexer.dart:102-112 | pkg/front_end/tool/parser_ast_indexer.dart:114-125 | pkg/front_end/tool/parser_ast_indexer.dart:127-138 | pkg/front_end/tool/parser_ast_indexer.dart:140-150 | pkg/front_end/tool/parser_ast_indexer.dart:152-162 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:91 — pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:91-103 | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:105-117 | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:119-129 | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:131-141 | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:143-153 | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart:165-176 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2241 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2241-2255 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2843-2853 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4353-4363 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4392-4402 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4492-4502 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4755-4765 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) pkg/observatory/lib/src/elements/isolate/location.dart:26 — pkg/observatory/lib/src/elements/isolate/location.dart:26-38 | pkg/observatory/lib/src/elements/isolate/run_state.dart:23-33 | pkg/observatory/lib/src/elements/isolate/shared_summary.dart:27-37 | pkg/observatory/lib/src/elements/isolate_ref.dart:27-37 | pkg/observatory/lib/src/elements/logging_list.dart:32-42 | pkg/observatory/lib/src/elements/nav/isolate_menu.dart:34-44 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) pkg/linter/lib/src/rules/avoid_init_to_null.dart:26 — pkg/linter/lib/src/rules/avoid_init_to_null.dart:26-36 | pkg/linter/lib/src/rules/avoid_shadowing_type_parameters.dart:28-40 | pkg/linter/lib/src/rules/prefer_final_fields.dart:26-38 | pkg/linter/lib/src/rules/simple_directive_paths.dart:29-40 | pkg/linter/lib/src/rules/strict_top_level_inference.dart:35-46 | pkg/linter/lib/src/rules/unnecessary_nullable_for_final_variable_declarations.dart:32-42 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×6
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/analyzer/lib/src/fine/manifest_item.dart:584 — pkg/analyzer/lib/src/fine/manifest_item.dart:584-600 | pkg/analyzer/lib/src/fine/manifest_item.dart:1207-1221 | pkg/analyzer/lib/src/fine/manifest_item.dart:1396-1412 | pkg/analyzer/lib/src/fine/manifest_item.dart:1441-1454 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/analysis_server/lib/src/computer/computer_outline.dart:265 — pkg/analysis_server/lib/src/computer/computer_outline.dart:265-278 | pkg/analysis_server/lib/src/computer/computer_outline.dart:280-293 | pkg/analysis_server/lib/src/computer/computer_outline.dart:325-342 | pkg/analysis_server/lib/src/computer/computer_outline.dart:464-479 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:23562 — pkg/analyzer/lib/src/dart/ast/ast.dart:23562-23577 | pkg/analyzer/lib/src/dart/ast/ast.dart:23579-23593 | pkg/analyzer/lib/src/dart/ast/ast.dart:47618-47632 | pkg/analyzer/lib/src/dart/ast/ast.dart:47634-47647 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3400 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3400-3415 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3587-3600 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3602-3615 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3617-3630 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22672 — pkg/analyzer/lib/src/dart/ast/ast.dart:22672-22694 | pkg/analyzer/lib/src/dart/ast/ast.dart:37724-37738 | pkg/analyzer/lib/src/dart/ast/ast.dart:59947-59967 | pkg/analyzer/lib/src/dart/ast/ast.dart:62834-62847 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:486 — pkg/dev_compiler/lib/src/js_ast/printer.dart:486-499 | pkg/dev_compiler/lib/src/js_ast/printer.dart:606-620 | pkg/js_ast/lib/src/printer.dart:542-555 | pkg/js_ast/lib/src/printer.dart:664-678 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×6
  • Edited copies of one member (4 members, 10+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:498 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:498-507 | sdk/lib/_internal/wasm/common/typed_data.dart:2281-2291 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:739-748 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2239-2248 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 10+ corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/remove_comma.dart:45 — pkg/analysis_server/lib/src/services/correction/dart/remove_comma.dart:45-61 | pkg/analysis_server/lib/src/services/correction/dart/remove_lexeme.dart:43-63 | pkg/analysis_server/lib/src/services/correction/dart/remove_var.dart:22-31 | pkg/analysis_server/lib/src/services/correction/dart/remove_var_keyword.dart:23-34 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:20293 — pkg/analyzer/lib/src/dart/ast/ast.dart:20293-20302 | pkg/analyzer/lib/src/dart/ast/ast.dart:20531-20541 | pkg/analyzer/lib/src/dart/ast/ast.dart:41357-41367 | pkg/analyzer/lib/src/dart/ast/ast.dart:41627-41638 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:44568 — pkg/analyzer/lib/src/dart/ast/ast.dart:44568-44578 | pkg/analyzer/lib/src/dart/ast/ast.dart:58603-58612 | pkg/analyzer/lib/src/dart/ast/ast.dart:58942-58951 | pkg/analyzer/lib/src/dart/ast/ast.dart:59265-59274 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 10+ corresponding lines) pkg/native_compiler/lib/snapshot/snapshot.dart:672 — pkg/native_compiler/lib/snapshot/snapshot.dart:672-681 | pkg/native_compiler/lib/snapshot/snapshot.dart:869-878 | pkg/native_compiler/lib/snapshot/snapshot.dart:1161-1174 | pkg/native_compiler/lib/snapshot/snapshot.dart:1659-1668 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 10+ corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:218 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:218-228 | sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:246-255 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:238-248 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:258-267 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/compiler/lib/src/ssa/tracer.dart:698 — pkg/compiler/lib/src/ssa/tracer.dart:698-704 | pkg/compiler/lib/src/ssa/tracer.dart:706-712 | pkg/compiler/lib/src/ssa/tracer.dart:714-720 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/analyzer/lib/src/dart/analysis/experiments.dart:238 — pkg/analyzer/lib/src/dart/analysis/experiments.dart:238-244 | pkg/compiler/lib/src/universe/call_structure.dart:246-252 | pkg/vm/lib/transformations/type_flow/types.dart:831-837 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:590 — pkg/dev_compiler/lib/src/js_ast/template.dart:590-598 | pkg/dev_compiler/lib/src/js_ast/template.dart:741-747 | pkg/dev_compiler/lib/src/js_ast/template.dart:858-869 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:173 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:173-181 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:179-185 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:187-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/native_stack_traces/lib/src/macho.dart:355 — pkg/native_stack_traces/lib/src/macho.dart:355-361 | pkg/native_stack_traces/lib/src/macho.dart:646-654 | pkg/native_stack_traces/lib/src/macho.dart:930-938 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/observatory/lib/src/elements/allocation_profile.dart:96 — pkg/observatory/lib/src/elements/allocation_profile.dart:96-102 | pkg/observatory/lib/src/elements/metric/graph.dart:50-56 | pkg/observatory/lib/src/elements/vm_view.dart:80-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×6
  • Duplicated block (30 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:113 — pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:113-142 | pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart:91-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:113` 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 `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 (30 lines × 2) pkg/analyzer/lib/src/dart/ast/ast.dart:8200 — pkg/analyzer/lib/src/dart/ast/ast.dart:8200-8229 | pkg/analyzer/lib/src/dart/ast/ast.dart:8461-8490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:8200` 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 (30 lines × 2) pkg/analyzer/lib/src/generated/error_verifier.dart:1241 — pkg/analyzer/lib/src/generated/error_verifier.dart:1241-1270 | pkg/analyzer/lib/src/generated/error_verifier.dart:2433-2462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/generated/error_verifier.dart:1241` 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 `node` to `covariant FieldsDeclarationImpl` in one and `covariant TopLevelVariablesDeclarationImpl` 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 (30 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8130 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8130-8159 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8999-9028 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (30 lines × 2) pkg/front_end/lib/src/source/source_type_alias_builder.dart:498 — pkg/front_end/lib/src/source/source_type_alias_builder.dart:498-527 | pkg/front_end/lib/src/source/source_type_alias_builder.dart:557-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/source/source_type_alias_builder.dart:498` it does not close everything it opens, so those exact lines 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) pkg/wasm_builder/lib/src/ir/type.dart:764 — pkg/wasm_builder/lib/src/ir/type.dart:764-793 | pkg/wasm_builder/lib/src/ir/type.dart:811-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×6
  • Duplicated block (20–21 lines × 2) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:181 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:181-201 | pkg/front_end/tool/fuzz/analyzer_helper.dart:421-440 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart` and `pkg/front_end/tool/fuzz/analyzer_helper.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:181` it does not close everything it opens, so those 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 (20–21 lines × 2) pkg/front_end/lib/src/builder/record_type_builder.dart:397 — pkg/front_end/lib/src/builder/record_type_builder.dart:397-417 | pkg/front_end/lib/src/builder/record_type_builder.dart:418-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–21 lines × 2) pkg/front_end/lib/src/type_inference/body_inference_context.dart:891 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:891-910 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:1059-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/body_inference_context.dart:891` 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 (20–21 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3544 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3544-3563 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3590-3610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:3544` 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 `node` to `InternalForStatement` in one and `InternalPatternForStatement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20–21 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4994 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:4994-5013 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:10772-10792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:10772` 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 `node` to `ForElement` in one and `InternalPatternVariableDeclaration` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20–21 lines × 2) pkg/front_end/lib/src/type_inference/matching_expressions.dart:427 — pkg/front_end/lib/src/type_inference/matching_expressions.dart:427-447 | pkg/front_end/lib/src/type_inference/matching_expressions.dart:637-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/matching_expressions.dart:427` 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.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×6
  • Duplicated block (20 lines × 3) pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:27 — pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:27-46 | pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart:30-49 | pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart:28-47 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart` and `pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `pkg/analysis_server/lib/src/services/refactoring/convert_all_formal_parameters_to_named.dart:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 3) pkg/analyzer/lib/src/dart/ast/ast.dart:37372 — pkg/analyzer/lib/src/dart/ast/ast.dart:37372-37391 | pkg/analyzer/lib/src/dart/ast/ast.dart:40264-40283 | pkg/analyzer/lib/src/dart/ast/ast.dart:58753-58772 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:37372` 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 (20 lines × 3) pkg/front_end/lib/src/fragment/getter.dart:133 — pkg/front_end/lib/src/fragment/getter.dart:133-152 | pkg/front_end/lib/src/fragment/method.dart:131-150 | pkg/front_end/lib/src/fragment/setter.dart:133-152 — 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 (20 lines × 3) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:254 — pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:254-273 | pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:286-305 | pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:318-337 — 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 `pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:254` 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 (20 lines × 3) pkg/front_end/tool/bench_maker.dart:415 — pkg/front_end/tool/bench_maker.dart:415-434 | pkg/front_end/tool/bench_maker.dart:546-565 | pkg/front_end/tool/bench_maker.dart:571-590 — 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 `pkg/front_end/tool/bench_maker.dart:415` 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 `node` to `InterfaceType` in one and `TypedefType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2054 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:2054-2073 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:2072-2091 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2685-2704 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 · Duplicated block (19–20 lines × 2) · ×6
  • Duplicated block (19–20 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1348 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1348-1367 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:997-1015 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (19–20 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1369 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1369-1388 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:972-990 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (19–20 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:6157 — pkg/compiler/lib/src/ssa/builder.dart:6157-6176 | pkg/compiler/lib/src/ssa/builder.dart:6205-6223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:6157` 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 (19–20 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4351 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:4351-4369 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5291-5310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:4351` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `InternalListLiteral` in one and `MapOrSetLiteral` 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 (19–20 lines × 2) pkg/front_end/tool/coverage_merger.dart:1168 — pkg/front_end/tool/coverage_merger.dart:1168-1187 | pkg/front_end/tool/coverage_merger.dart:1238-1256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/tool/coverage_merger.dart:1238` it does not close everything it opens, so those 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `TopLevelFieldsEnd` in one and `BeginAndEndTokenParserAstNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/front_end/tool/coverage_merger.dart:1258` calls `accept` and `pkg/front_end/tool/coverage_merger.dart:1187` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19–20 lines × 2) sdk/lib/_internal/vm/lib/internal_patch.dart:110 — sdk/lib/_internal/vm/lib/internal_patch.dart:110-128 | sdk/lib/_internal/wasm/common/internal_patch.dart:13-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×6
  • Duplicated block (19 lines × 3) pkg/analyzer/tool/ast/generate.dart:196 — pkg/analyzer/tool/ast/generate.dart:196-217 | pkg/analyzer/tool/ast/generate.dart:822-899 | pkg/analyzer/tool/ast/generate.dart:1181-1199 — 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 `pkg/analyzer/tool/ast/generate.dart: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/tool/ast/generate.dart:900` calls `writeln` and `pkg/analyzer/tool/ast/generate.dart:218` 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 (19 lines × 3) pkg/compiler/lib/src/ssa/builder.dart:6662 — pkg/compiler/lib/src/ssa/builder.dart:6662-6680 | pkg/compiler/lib/src/ssa/builder.dart:6698-6716 | pkg/compiler/lib/src/ssa/builder.dart:6734-6752 — 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 `pkg/compiler/lib/src/ssa/builder.dart:6662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 3) pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:104 — pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:104-122 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:151-169 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:198-216 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 3) pkg/observatory/lib/src/elements/code_view.dart:205 — pkg/observatory/lib/src/elements/code_view.dart:205-223 | pkg/observatory/lib/src/elements/megamorphiccache_view.dart:118-136 | pkg/observatory/lib/src/elements/script_view.dart:125-143 — 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 `pkg/observatory/lib/src/elements/code_view.dart:205` 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 (19 lines × 3) pkg/observatory/lib/src/elements/instance_view.dart:384 — pkg/observatory/lib/src/elements/instance_view.dart:384-402 | pkg/observatory/lib/src/elements/instance_view.dart:423-441 | pkg/observatory/lib/src/elements/instance_view.dart:489-507 — 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 `pkg/observatory/lib/src/elements/instance_view.dart:384` it does not close everything it opens, so those exact lines 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 × 3) pkg/observatory/lib/src/elements/isolate_view.dart:198 — pkg/observatory/lib/src/elements/isolate_view.dart:198-216 | pkg/observatory/lib/src/elements/metric/graph.dart:78-96 | pkg/observatory/lib/src/elements/vm_view.dart:250-268 — 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 `pkg/observatory/lib/src/elements/isolate_view.dart:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×6
  • Duplicated block (15–17 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:31 — pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:31-47 | pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart:30-44 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart` and `pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:31` it does not close everything it opens, so those 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 (15–17 lines × 2) pkg/analyzer/lib/src/error/best_practices_verifier.dart:613 — pkg/analyzer/lib/src/error/best_practices_verifier.dart:613-629 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:892-906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/best_practices_verifier.dart:613` 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 `node` to `covariant LocalFunctionDeclarationImpl` in one and `covariant TopLevelSetterDeclarationImpl` 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–17 lines × 2) pkg/analyzer/lib/src/summary2/informative_data.dart:411 — pkg/analyzer/lib/src/summary2/informative_data.dart:411-427 | pkg/analyzer/lib/src/summary2/informative_data.dart:455-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/informative_data.dart:411` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 `info` to `_InfoExecutableDeclaration` in one and `(fragment,` 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–17 lines × 2) pkg/analyzer_utilities/tool/messages/use_literate_api_in_analyzer.dart:154 — pkg/analyzer_utilities/tool/messages/use_literate_api_in_analyzer.dart:154-170 | pkg/analyzer_utilities/tool/messages/use_new_with_arguments.dart:152-166 — 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 `pkg/analyzer_utilities/tool/messages/use_literate_api_in_analyzer.dart:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (15–17 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3165 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3165-3179 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3320-3336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–17 lines × 2) sdk/lib/_internal/js_runtime/lib/js_number.dart:598 — sdk/lib/_internal/js_runtime/lib/js_number.dart:598-614 | sdk/lib/_internal/vm/lib/integers.dart:420-434 — before extracting anything, compare `sdk/lib/_internal/js_runtime/lib/js_number.dart` and `sdk/lib/_internal/vm/lib/integers.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 `sdk/lib/_internal/js_runtime/lib/js_number.dart:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×6
  • Duplicated block (15 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:27914 — pkg/analyzer/lib/src/dart/ast/ast.dart:27914-27928 | pkg/analyzer/lib/src/dart/ast/ast.dart:28065-28079 | pkg/analyzer/lib/src/dart/ast/ast.dart:28680-28694 | pkg/analyzer/lib/src/dart/ast/ast.dart:28699-28713 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:27914` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analyzer/lib/src/dart/ast/ast.dart:27911` calls `_childContainingRange2` and `pkg/analyzer/lib/src/dart/ast/ast.dart:28698` 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 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:36754 — pkg/analyzer/lib/src/dart/ast/ast.dart:36754-36768 | pkg/analyzer/lib/src/dart/ast/ast.dart:37004-37018 | pkg/analyzer/lib/src/dart/ast/ast.dart:39789-39803 | pkg/analyzer/lib/src/dart/ast/ast.dart:54031-54045 — 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. 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 × 4) pkg/compiler/lib/src/ssa/builder.dart:6434 — pkg/compiler/lib/src/ssa/builder.dart:6434-6448 | pkg/compiler/lib/src/ssa/builder.dart:6457-6471 | pkg/compiler/lib/src/ssa/builder.dart:6691-6707 | pkg/compiler/lib/src/ssa/builder.dart:6727-6743 — 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 `pkg/compiler/lib/src/ssa/builder.dart:6434` 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. 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 × 4) pkg/front_end/lib/src/fragment/getter/encoding.dart:336 — pkg/front_end/lib/src/fragment/getter/encoding.dart:336-350 | pkg/front_end/lib/src/fragment/getter/encoding.dart:636-650 | pkg/front_end/lib/src/fragment/setter/encoding.dart:358-372 | pkg/front_end/lib/src/fragment/setter/encoding.dart:685-699 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/setter/encoding.dart` 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 14 separate duplicated blocks between them, totalling at least 275 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:336` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461-2475 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8681-8695 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8881-8895 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9151-9165 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461` 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) sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart:45 — sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart:45-59 | sdk/lib/_internal/js_runtime/lib/isolate_patch.dart:57-71 | sdk/lib/_internal/vm/lib/isolate_patch.dart:432-446 | sdk/lib/_internal/wasm/common/isolate_patch.dart:54-68 — before extracting anything, compare `sdk/lib/_internal/js_runtime/lib/isolate_patch.dart` and `sdk/lib/_internal/wasm/common/isolate_patch.dart` 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 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 `sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×6
  • Duplicated block (14 lines × 4) pkg/compiler/lib/src/js_model/elements.dart:564 — pkg/compiler/lib/src/js_model/elements.dart:564-577 | pkg/compiler/lib/src/js_model/elements.dart:700-713 | pkg/compiler/lib/src/js_model/elements.dart:780-793 | pkg/compiler/lib/src/js_model/elements.dart:856-869 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/compiler/lib/src/js_model/elements.dart:579` calls `readFromDataSource` and `pkg/compiler/lib/src/js_model/elements.dart:714` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 4) pkg/dartdev/lib/src/commands/compile.dart:158 — pkg/dartdev/lib/src/commands/compile.dart:158-171 | pkg/dartdev/lib/src/commands/compile.dart:213-226 | pkg/dartdev/lib/src/commands/development_service.dart:46-59 | pkg/dartdev/lib/src/commands/tooling_daemon.dart:40-53 — before extracting anything, compare `pkg/dartdev/lib/src/commands/development_service.dart` and `pkg/dartdev/lib/src/commands/tooling_daemon.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `pkg/dartdev/lib/src/commands/compile.dart: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. 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 × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420-1433 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1501-1514 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1961-1974 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2051-2064 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionTearOff` in one and `ExtensionGet` 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 × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1786 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1786-1799 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2374-2387 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7342-7355 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8969-8982 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 4) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:585 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:585-598 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:581-594 | sdk/lib/_internal/wasm/js_common/string_buffer_patch.dart:63-76 | sdk/lib/_internal/wasm/js_compatibility/string_buffer_patch.dart:49-62 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart` and `sdk/lib/_internal/js_runtime/lib/core_patch.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 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 `sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:585` 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 (14 lines × 4) sdk/lib/_internal/wasm/common/typed_data.dart:2505 — sdk/lib/_internal/wasm/common/typed_data.dart:2505-2518 | sdk/lib/_internal/wasm/common/typed_data.dart:2569-2582 | sdk/lib/_internal/wasm/common/typed_data.dart:2633-2646 | sdk/lib/_internal/wasm/common/typed_data.dart:2697-2710 — 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 `sdk/lib/_internal/wasm/common/typed_data.dart:2505` 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×6
  • Duplicated block (12–14 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:57 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:57-70 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:119-130 — 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 `pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:107 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:107-120 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:240-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:107` 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–14 lines × 2) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4580 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4580-4591 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4620-4633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4580` 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, `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4578` calls `accept2`, `resolve` and `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4620` 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 (12–14 lines × 2) pkg/analyzer/lib/src/generated/exhaustiveness.dart:202 — pkg/analyzer/lib/src/generated/exhaustiveness.dart:202-213 | pkg/front_end/lib/src/kernel/exhaustiveness.dart:544-557 — 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 `pkg/analyzer/lib/src/generated/exhaustiveness.dart:202` it does not close everything it opens, so those exact lines 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–14 lines × 2) pkg/dart2wasm/lib/code_generator.dart:2302 — pkg/dart2wasm/lib/code_generator.dart:2302-2313 | pkg/dart2wasm/lib/code_generator.dart:2420-2433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/code_generator.dart:2302` it does not close everything it opens, so those 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 `node` to `InstanceGet` in one and `InstanceTearOff` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/dart2wasm/lib/code_generator.dart:2434` calls `convertType` and `pkg/dart2wasm/lib/code_generator.dart:2314` 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–14 lines × 2) pkg/dart2wasm/lib/target.dart:474 — pkg/dart2wasm/lib/target.dart:474-485 | pkg/dart2wasm/lib/target.dart:496-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/target.dart:474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `arg` to `MapLiteral( List<MapLiteralEntry>.from( arguments.named.map((NamedExpression` in one and `List<MapLiteralEntry>.from( arguments.named.map((NamedExpression` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×6
  • Duplicated block (12 lines × 4) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:250 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:250-261 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:285-296 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:318-329 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:470-481 — 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 `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:250` 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) pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:39 — pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:39-50 | pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart:39-50 | pkg/analysis_server/lib/src/services/refactoring/inline_local_variable.dart:34-45 | pkg/analysis_server/lib/src/services/refactoring/inline_method.dart:34-45 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart` and `pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:39` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart:36` calls `ComputeStatusFailure` and `pkg/analysis_server/lib/src/services/refactoring/inline_local_variable.dart:32` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:9241 — pkg/analyzer/lib/src/dart/ast/ast.dart:9241-9252 | pkg/analyzer/lib/src/dart/ast/ast.dart:20589-20600 | pkg/analyzer/lib/src/dart/ast/ast.dart:29143-29154 | pkg/analyzer/lib/src/dart/ast/ast.dart:41686-41697 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:9241` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/dart/ast/ast.dart:20415 — pkg/analyzer/lib/src/dart/ast/ast.dart:20415-20426 | pkg/analyzer/lib/src/dart/ast/ast.dart:20594-20605 | pkg/analyzer/lib/src/dart/ast/ast.dart:41496-41507 | pkg/analyzer/lib/src/dart/ast/ast.dart:41691-41702 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:20415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 4) pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:44 — pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:44-55 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:122-133 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:200-211 | pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:232-243 — 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 `pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:44` 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, `pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:40` calls `getInt`, `getNum` and `pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:231` 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 (12 lines × 4) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:542 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:542-553 | sdk/lib/_internal/js_runtime/lib/js_number.dart:632-643 | sdk/lib/_internal/vm/lib/integers.dart:452-463 | sdk/lib/_internal/wasm/common/boxed_int.dart:346-357 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/js_dev_runtime/private/js_number.dart:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×6
  • Duplicated block (9–10 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:49 — pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:49-57 | pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart:66-75 — 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 `pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart: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. 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–10 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart:60 — pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart:60-68 | pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart:70-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/change_to_static_access.dart:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) pkg/dart2wasm/lib/code_generator.dart:4151 — pkg/dart2wasm/lib/code_generator.dart:4151-4159 | pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:219-228 — 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 `pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:219` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:295 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:295-303 | pkg/dds/lib/src/devtools/memory_profile.dart:335-344 — before extracting anything, compare `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart` and `pkg/dds/lib/src/devtools/memory_profile.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 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 `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:295` it does not close everything it opens, so those 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 (9–10 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6464 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6464-6473 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6579-6587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6579` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9–10 lines × 2) pkg/vm/lib/transformations/type_flow/types.dart:1708 — pkg/vm/lib/transformations/type_flow/types.dart:1708-1717 | pkg/vm/lib/transformations/type_flow/types.dart:1737-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/vm/lib/transformations/type_flow/types.dart:1708` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×6
  • Duplicated block (8–9 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:564 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:564-571 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:637-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) pkg/analyzer/lib/src/dart/micro/utils.dart:538 — pkg/analyzer/lib/src/dart/micro/utils.dart:538-546 | pkg/analyzer/lib/src/dart/micro/utils.dart:701-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/micro/utils.dart:538` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:647 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:647-654 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:859-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 `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:647` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `fragment` to `ExtensionFragmentImpl` in one and `MixinFragmentImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:868` calls `accept2` and `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:656` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 2) pkg/dev_compiler/lib/src/js_ast/template.dart:360 — pkg/dev_compiler/lib/src/js_ast/template.dart:360-367 | pkg/js_ast/lib/src/template.dart:348-356 — before extracting anything, compare `pkg/dev_compiler/lib/src/js_ast/template.dart` and `pkg/js_ast/lib/src/template.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 81 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 `pkg/dev_compiler/lib/src/js_ast/template.dart: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8–9 lines × 2) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4761 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:4761-4768 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:4882-4890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_evaluator.dart:4761` it does not close everything it opens, so those 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 `node` to `InstanceGet` in one and `DynamicGet` 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, `pkg/front_end/lib/src/kernel/constant_evaluator.dart:4881` calls `visitDynamicGet` and `pkg/front_end/lib/src/kernel/constant_evaluator.dart:4759` 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 (8–9 lines × 2) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:635 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:635-642 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2128-2136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2128` 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×6
  • Duplicated block (8 lines × 5) pkg/analyzer/lib/src/summary2/bundle_reader.dart:259 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:259-266 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:459-466 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:545-552 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:615-622 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1070-1077 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_reader.dart:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:257` calls `readBool` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:543` 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 (8 lines × 5) pkg/analyzer/lib/src/summary2/bundle_writer.dart:175 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:175-182 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:298-305 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:354-361 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:403-410 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:695-702 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/bundle_writer.dart:175` it does not close everything it opens, so those 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, `pkg/analyzer/lib/src/summary2/bundle_writer.dart:307` calls `writeList` and `pkg/analyzer/lib/src/summary2/bundle_writer.dart:363` 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 (8 lines × 5) pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766 — pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766-773 | sdk/lib/_http/http_impl.dart:1150-1157 | sdk/lib/_internal/vm_shared/lib/string_buffer_patch.dart:102-109 | sdk/lib/_internal/wasm/standalone/string_buffer_patch.dart:44-52 | sdk/lib/io/io_sink.dart:298-305 — before extracting anything, compare `sdk/lib/_http/http_impl.dart` and `sdk/lib/io/io_sink.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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 `pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) pkg/kernel/lib/src/ast/declarations.dart:488 — pkg/kernel/lib/src/ast/declarations.dart:488-495 | pkg/kernel/lib/src/ast/declarations.dart:645-652 | pkg/kernel/lib/src/ast/declarations.dart:886-893 | pkg/kernel/lib/src/ast/members.dart:152-159 | pkg/kernel/lib/src/ast/typedefs.dart:82-89 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 5) pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:36 — pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:36-43 | pkg/linter/lib/src/rules/avoid_implementing_value_types.dart:26-33 | pkg/linter/lib/src/rules/diagnostic_describe_all_properties.dart:32-39 | pkg/linter/lib/src/rules/hash_and_equals.dart:26-33 | pkg/linter/lib/src/rules/one_member_abstracts.dart:30-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/linter/lib/src/rules/avoid_implementing_value_types.dart:37` calls `Name` and `pkg/linter/lib/src/rules/hash_and_equals.dart:37` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 5) pkg/linter/lib/src/rules/prefer_adjacent_string_concatenation.dart:27 — pkg/linter/lib/src/rules/prefer_adjacent_string_concatenation.dart:27-34 | REDACTED:29-36 | pkg/linter/lib/src/rules/unnecessary_null_in_if_null_operators.dart:29-36 | pkg/linter/lib/src/rules/use_is_even_rather_than_modulo.dart:26-33 | pkg/linter/lib/src/rules/use_truncating_division.dart:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Edited copy of a member (65 corresponding lines) · ×5
  • Edited copy of a member (65 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:2064 — sdk/lib/_internal/vm/lib/convert_patch.dart:2064-2134 | sdk/lib/_internal/wasm/common/convert_patch.dart:2676-2740 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:221 — pkg/analyzer/lib/src/fasta/ast_builder.dart:221-287 | pkg/analyzer/lib/src/fasta/ast_builder.dart:494-558 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) pkg/front_end/lib/src/source/source_extension_builder.dart:282 — pkg/front_end/lib/src/source/source_extension_builder.dart:282-346 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:939-1009 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2599 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2599-2669 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3999-4063 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart:30 — pkg/analysis_server/lib/src/services/refactoring/convert_selected_formal_parameters_to_named.dart:30-94 | pkg/analysis_server/lib/src/services/refactoring/move_selected_formal_parameters_left.dart:28-98 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×5
  • Edited copy of a member (54 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:866 — pkg/dev_compiler/lib/src/js_ast/builder.dart:866-919 | pkg/js_ast/lib/src/builder.dart:790-844 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) pkg/observatory/lib/src/elements/objectpool_view.dart:92 — pkg/observatory/lib/src/elements/objectpool_view.dart:92-145 | pkg/observatory/lib/src/elements/script_view.dart:96-159 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) pkg/compiler/lib/src/js_backend/enqueuer.dart:194 — pkg/compiler/lib/src/js_backend/enqueuer.dart:194-247 | pkg/compiler/lib/src/resolution/enqueuer.dart:208-263 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) pkg/analysis_server/lib/src/lsp/lsp_packet_transformer.dart:54 — pkg/analysis_server/lib/src/lsp/lsp_packet_transformer.dart:54-107 | pkg/dap_adapters/lib/src/protocol_stream_transformers.dart:31-85 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) pkg/front_end/lib/src/source/builder_factory.dart:919 — pkg/front_end/lib/src/source/builder_factory.dart:919-979 | pkg/front_end/lib/src/source/builder_factory.dart:1176-1229 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×5
  • Edited copy of a member (46 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:2012 — sdk/lib/_internal/vm/lib/convert_patch.dart:2012-2062 | sdk/lib/_internal/wasm/common/convert_patch.dart:2596-2641 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) pkg/analyzer/lib/src/error/literal_element_verifier.dart:149 — pkg/analyzer/lib/src/error/literal_element_verifier.dart:149-194 | pkg/analyzer/lib/src/error/literal_element_verifier.dart:196-241 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) pkg/front_end/lib/src/source/source_builder_mixins.dart:106 — pkg/front_end/lib/src/source/source_builder_mixins.dart:106-151 | pkg/front_end/lib/src/source/source_type_alias_builder.dart:360-412 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) pkg/analyzer/lib/src/dart/element/type_algebra.dart:415 — pkg/analyzer/lib/src/dart/element/type_algebra.dart:415-460 | pkg/analyzer/lib/src/dart/element/type_algebra.dart:462-507 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) pkg/dart_runtime_service_dds/lib/src/dap_handler.dart:95 — pkg/dart_runtime_service_dds/lib/src/dap_handler.dart:95-144 | pkg/dds/lib/src/dap_handler.dart:57-102 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×5
  • Edited copy of a member (60 corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:2943 — pkg/front_end/lib/src/kernel/expression_generator.dart:2943-3002 | pkg/front_end/lib/src/kernel/expression_generator.dart:3418-3478 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (60 corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:2645 — pkg/front_end/lib/src/kernel/expression_generator.dart:2645-2704 | pkg/front_end/lib/src/kernel/expression_generator.dart:3118-3184 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (60 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4007 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:4007-4066 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:4068-4128 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (60 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:90 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:90-153 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_parameter_named.dart:155-214 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (60 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:417 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:417-476 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:752-820 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×5
  • Edited copy of a member (48 corresponding lines) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:473 — pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:473-526 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart:182-229 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) pkg/observatory/lib/src/elements/debugger.dart:2727 — pkg/observatory/lib/src/elements/debugger.dart:2727-2774 | pkg/observatory/lib/src/elements/debugger.dart:3021-3068 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:2618 — pkg/front_end/lib/src/kernel/body_builder.dart:2618-2665 | pkg/front_end/lib/src/kernel/body_builder.dart:2667-2715 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) pkg/front_end/lib/src/fragment/field/encoding.dart:2069 — pkg/front_end/lib/src/fragment/field/encoding.dart:2069-2116 | pkg/front_end/lib/src/fragment/field/encoding.dart:2118-2177 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) pkg/analyzer/lib/src/dart/ast/utilities.dart:118 — pkg/analyzer/lib/src/dart/ast/utilities.dart:118-165 | pkg/analyzer/lib/src/dart/ast/utilities.dart:267-314 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×5
  • Edited copies of one member (4 members, 20+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_array.dart:248 — sdk/lib/_internal/wasm/js_common/js_array.dart:248-267 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2153-2173 | sdk/lib/collection/list.dart:148-168 | sdk/lib/internal/iterable.dart:133-153 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 20+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:262 — pkg/compiler/lib/src/js/size_estimator.dart:262-281 | pkg/dev_compiler/lib/src/js_ast/printer.dart:440-461 | pkg/dev_compiler/lib/src/js_ast/printer.dart:463-484 | pkg/js_ast/lib/src/printer.dart:519-540 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 20+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2333 — pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2333-2352 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2480-2502 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3285-3304 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3620-3641 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 20+ corresponding lines) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1885 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1885-1906 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1932-1955 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1964-1983 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1992-2017 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 20+ corresponding lines) REDACTED:186 — REDACTED:186-207 | REDACTED:306-334 | REDACTED:1395-1420 | REDACTED:2103-2122 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×5
  • Edited copies of one member (5 members, 14+ corresponding lines) pkg/compiler/lib/src/js_backend/annotations.dart:527 — pkg/compiler/lib/src/js_backend/annotations.dart:527-540 | pkg/compiler/lib/src/js_backend/annotations.dart:542-555 | pkg/compiler/lib/src/js_backend/annotations.dart:557-570 | pkg/compiler/lib/src/js_backend/annotations.dart:572-585 | pkg/compiler/lib/src/js_backend/annotations.dart:587-600 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2757 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2757-2770 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3256-3269 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3271-3284 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3758-3773 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4779-4792 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 14+ corresponding lines) pkg/kernel/lib/binary/ast_from_binary.dart:1375 — pkg/kernel/lib/binary/ast_from_binary.dart:1375-1388 | pkg/kernel/lib/binary/ast_from_binary.dart:1405-1418 | pkg/kernel/lib/binary/ast_from_binary.dart:1420-1435 | pkg/kernel/lib/binary/ast_from_binary.dart:1482-1495 | pkg/kernel/lib/binary/ast_from_binary.dart:1545-1558 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 14+ corresponding lines) pkg/kernel/lib/clone.dart:811 — pkg/kernel/lib/clone.dart:811-825 | pkg/kernel/lib/clone.dart:827-841 | pkg/kernel/lib/clone.dart:843-856 | pkg/kernel/lib/clone.dart:907-920 | pkg/kernel/lib/clone.dart:922-936 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:56780 — pkg/analyzer/lib/src/dart/ast/ast.dart:56780-56796 | pkg/analyzer/lib/src/dart/ast/ast.dart:56798-56813 | pkg/analyzer/lib/src/dart/ast/ast.dart:56959-56972 | pkg/analyzer/lib/src/dart/ast/ast.dart:57731-57747 | pkg/analyzer/lib/src/dart/ast/ast.dart:57749-57764 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×5
  • Edited copies of one member (4 members, 8+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:393 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:393-400 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:440-447 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:940-947 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:963-970 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) sdk/lib/_internal/vm/lib/string_patch.dart:797 — sdk/lib/_internal/vm/lib/string_patch.dart:797-809 | sdk/lib/_internal/wasm/js_common/js_string.dart:359-371 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:267-274 | sdk/lib/_internal/wasm/standalone/embedder_string.dart:276-287 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:526 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:526-533 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:696-703 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2014-2021 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2196-2203 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:636 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:636-643 | sdk/lib/_internal/js_runtime/lib/js_array.dart:825-832 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:517-524 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2005-2012 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:645 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:645-652 | sdk/lib/_internal/js_runtime/lib/js_array.dart:834-841 | sdk/lib/_internal/wasm/js_common/js_array.dart:588-602 | sdk/lib/collection/list.dart:476-483 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×5
  • Edited copies of one member (4 members, 9+ corresponding lines) pkg/dartpad_worker/lib/src/worker.dart:356 — pkg/dartpad_worker/lib/src/worker.dart:356-366 | pkg/dartpad_worker/lib/src/worker.dart:368-378 | pkg/dartpad_worker/lib/src/worker.dart:400-412 | pkg/dartpad_worker/lib/src/worker.dart:433-441 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1028 — pkg/compiler/lib/src/js/rewrite_async.dart:1028-1036 | pkg/compiler/lib/src/js/rewrite_async.dart:1436-1444 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1044-1062 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1470-1485 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:158 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:158-166 | sdk/lib/_internal/js_dev_runtime/private/js_number.dart:185-193 | sdk/lib/_internal/js_runtime/lib/js_number.dart:199-207 | sdk/lib/_internal/js_runtime/lib/js_number.dart:224-232 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:2747 — pkg/analyzer/lib/src/fasta/ast_builder.dart:2747-2762 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3800-3816 | pkg/analyzer/lib/src/fasta/ast_builder.dart:3922-3930 | pkg/analyzer/lib/src/fasta/ast_builder.dart:5131-5146 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) pkg/linter/lib/src/rules/implicit_reopen.dart:31 — pkg/linter/lib/src/rules/implicit_reopen.dart:31-39 | pkg/linter/lib/src/rules/prefer_asserts_in_initializer_lists.dart:29-38 | pkg/linter/lib/src/rules/unnecessary_getters_setters.dart:27-35 | pkg/linter/lib/src/rules/use_key_in_widget_constructors.dart:29-38 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×5
  • Duplicated block (32 lines × 2) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_assist_other_file_could_add_late.dart:97 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_assist_other_file_could_add_late.dart:97-128 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_many_assist_calls.dart:100-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 (32 lines × 2) pkg/analyzer/lib/src/dart/element/element.dart:2846 — pkg/analyzer/lib/src/dart/element/element.dart:2846-2877 | pkg/analyzer/lib/src/dart/element/element.dart:5418-5449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (32 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4865 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4865-4896 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5475-5506 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (32 lines × 2) pkg/front_end/lib/src/type_inference/body_inference_context.dart:446 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:446-477 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:782-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/body_inference_context.dart:446` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/lib/src/type_inference/body_inference_context.dart:781` calls `flatten` and `pkg/front_end/lib/src/type_inference/body_inference_context.dart:445` 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 (32 lines × 2) pkg/kernel/lib/src/standard_bounds.dart:295 — pkg/kernel/lib/src/standard_bounds.dart:295-326 | pkg/kernel/lib/src/standard_bounds.dart:614-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/kernel/lib/src/standard_bounds.dart:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 · Duplicated block (20–22 lines × 2) · ×5
  • Duplicated block (20–22 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:42 — pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:42-61 | pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart:42-63 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart` and `pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:42` 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 (20–22 lines × 2) pkg/dart2wasm/lib/list_factory_specializer.dart:195 — pkg/dart2wasm/lib/list_factory_specializer.dart:195-216 | pkg/vm/lib/modular/specializer/list_factory_specializer.dart:176-195 — before extracting anything, compare `pkg/dart2wasm/lib/list_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/list_factory_specializer.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 151 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 (20–22 lines × 2) pkg/front_end/lib/src/kernel/expression_generator.dart:263 — pkg/front_end/lib/src/kernel/expression_generator.dart:263-282 | pkg/front_end/lib/src/kernel/expression_generator.dart:7435-7456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/expression_generator.dart:263` 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 (20–22 lines × 2) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1110 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1110-1131 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1148-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/collection_encoding.dart:1110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `element` to `InferredIfCaseElement` in one and `InferredIfElement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20–22 lines × 2) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1662 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1662-1683 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1700-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/collection_encoding.dart:1662` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `InferredIfCaseElement` in one and `InferredIfElement` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×5
  • Duplicated block (18–19 lines × 2) pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:352 — pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:352-369 | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:615-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:352` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) pkg/analysis_server/lib/src/services/refactoring/remove_constructor_name.dart:38 — pkg/analysis_server/lib/src/services/refactoring/remove_constructor_name.dart:38-56 | pkg/analysis_server/lib/src/services/refactoring/remove_import_prefix.dart:39-56 — 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 (18–19 lines × 2) pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352 — pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352-370 | pkg/analyzer/lib/src/dart/resolver/scope_context.dart:452-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/scope_context.dart:352` 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–19 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:10071 — pkg/front_end/lib/src/kernel/body_builder.dart:10071-10089 | pkg/front_end/lib/src/kernel/body_builder.dart:10401-10418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:10401` 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–19 lines × 2) pkg/front_end/lib/src/source/outline_builder.dart:2396 — pkg/front_end/lib/src/source/outline_builder.dart:2396-2414 | pkg/front_end/lib/src/source/outline_builder.dart:2615-2632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×5
  • Duplicated block (16 lines × 3) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:526 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:526-541 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:611-626 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:669-684 — 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 `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:526` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `fragment` to `ClassFragmentImpl` in one and `EnumFragmentImpl` 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 (16 lines × 3) pkg/compiler/lib/src/kernel/kernel_impact.dart:159 — pkg/compiler/lib/src/kernel/kernel_impact.dart:159-174 | pkg/compiler/lib/src/kernel/kernel_impact.dart:192-207 | pkg/compiler/lib/src/kernel/kernel_impact.dart:260-275 — 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 `pkg/compiler/lib/src/kernel/kernel_impact.dart:159` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/kernel/internal_ast.dart:3650 — pkg/front_end/lib/src/kernel/internal_ast.dart:3650-3665 | pkg/front_end/lib/src/kernel/internal_ast.dart:3740-3755 | pkg/front_end/lib/src/kernel/internal_ast.dart:4306-4321 — 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 `pkg/front_end/lib/src/kernel/internal_ast.dart:3650` it does not close everything it opens, so those 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 (16 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5521 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:5521-5536 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5606-5621 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5681-5696 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:5521` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `StaticIncDec` in one and `SuperIncDec` 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 (16 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1511 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1511-1526 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1530-1545 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2119-2134 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1511` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×5
  • Duplicated block (11 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:9010 — pkg/analyzer/lib/src/dart/ast/ast.dart:9010-9020 | pkg/analyzer/lib/src/dart/ast/ast.dart:20411-20421 | pkg/analyzer/lib/src/dart/ast/ast.dart:28984-28994 | pkg/analyzer/lib/src/dart/ast/ast.dart:41492-41502 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:9010` it does not close everything it opens, so those exact lines 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) pkg/analyzer/lib/src/fine/manifest_item.dart:86 — pkg/analyzer/lib/src/fine/manifest_item.dart:86-96 | pkg/analyzer/lib/src/fine/manifest_item.dart:276-286 | pkg/analyzer/lib/src/fine/manifest_item.dart:467-477 | pkg/analyzer/lib/src/fine/manifest_item.dart:1326-1336 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/fine/manifest_item.dart:97` calls `readOptional` and `pkg/analyzer/lib/src/fine/manifest_item.dart:287` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 4) pkg/analyzer/lib/src/summary2/informative_data.dart:283 — pkg/analyzer/lib/src/summary2/informative_data.dart:283-293 | pkg/analyzer/lib/src/summary2/informative_data.dart:319-329 | pkg/analyzer/lib/src/summary2/informative_data.dart:347-357 | pkg/analyzer/lib/src/summary2/informative_data.dart:477-487 — 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 `pkg/analyzer/lib/src/summary2/informative_data.dart:283` it does not close everything it opens, so those 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 `fragment` to `EnumFragmentImpl` in one and `ExtensionFragmentImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/summary2/informative_data.dart:294` calls `_applyToConstructors` and `pkg/analyzer/lib/src/summary2/informative_data.dart:330` 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 × 4) pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:218 — pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:218-228 | pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:255-265 | pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:293-303 | pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:330-340 — 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 `pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:218` it does not close everything it opens, so those exact lines 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) pkg/analyzer_plugin/lib/plugin/folding_mixin.dart:43 — pkg/analyzer_plugin/lib/plugin/folding_mixin.dart:43-53 | pkg/analyzer_plugin/lib/plugin/highlights_mixin.dart:43-53 | pkg/analyzer_plugin/lib/plugin/occurrences_mixin.dart:43-53 | pkg/analyzer_plugin/lib/plugin/outline_mixin.dart:43-53 — 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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×5
  • Duplicated block (8 lines × 4) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:239 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:239-246 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:278-285 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:313-320 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:465-472 — 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 `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:285` calls `write`, `addSimpleLinkedEdit` and `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:320` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 4) pkg/compiler/lib/src/js_model/closure.dart:632 — pkg/compiler/lib/src/js_model/closure.dart:632-639 | pkg/compiler/lib/src/js_model/closure.dart:688-695 | pkg/compiler/lib/src/js_model/closure.dart:744-751 | pkg/compiler/lib/src/js_model/closure.dart:843-850 — 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 (8 lines × 4) pkg/front_end/lib/src/builder/function_type_builder.dart:446 — pkg/front_end/lib/src/builder/function_type_builder.dart:446-453 | pkg/front_end/lib/src/builder/named_type_builder.dart:196-203 | pkg/front_end/lib/src/builder/record_type_builder.dart:500-507 | pkg/front_end/lib/src/builder/synthesized_type_builder.dart:89-96 — 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 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 4) pkg/linter/lib/src/rules/no_literal_bool_comparisons.dart:26 — pkg/linter/lib/src/rules/no_literal_bool_comparisons.dart:26-33 | pkg/linter/lib/src/rules/prefer_contains.dart:33-40 | pkg/linter/lib/src/rules/prefer_is_empty.dart:35-42 | pkg/linter/lib/src/rules/use_if_null_to_convert_nulls_to_bools.dart:32-39 — 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 4 call sites, so a change lands once.
  • Duplicated block (8 lines × 4) pkg/wasm_builder/lib/src/ir/functions.dart:23 — pkg/wasm_builder/lib/src/ir/functions.dart:23-30 | pkg/wasm_builder/lib/src/ir/globals.dart:22-29 | pkg/wasm_builder/lib/src/ir/tables.dart:22-29 | pkg/wasm_builder/lib/src/ir/tags.dart:124-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 all 4 call sites, so a change lands once.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×4
  • FunctionTooLong: graphexplorer.showTables runtime/tools/graphexplorer/graphexplorer.js:1835 — FunctionTooLong — showTables runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.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.
  • FunctionTooLong: D3SymbolTreeMap.D3SymbolTreeMap._handleInodes pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:382 — FunctionTooLong — D3SymbolTreeMap._handleInodes runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: graphexplorer.Graph.loadDartHeapSnapshot runtime/tools/graphexplorer/graphexplorer.js:155 — FunctionTooLong — Graph.loadDartHeapSnapshot runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: graphexplorer.createTreemapTile runtime/tools/graphexplorer/graphexplorer.js:1279 — FunctionTooLong — createTreemapTile runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (9 members, 50+ identical tokens) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart:119 — pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart:119-129 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart:105-115 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_import.dart:145-155 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart:58-68 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart:60-70 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart:233-243 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart:139-149 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_type_parameter.dart:73-83 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart:161-171 — 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.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) pkg/wasm_builder/lib/src/builder/instructions.dart:5763 — pkg/wasm_builder/lib/src/builder/instructions.dart:5763-5776 | pkg/wasm_builder/lib/src/builder/instructions.dart:5778-5791 | pkg/wasm_builder/lib/src/builder/instructions.dart:5793-5806 | pkg/wasm_builder/lib/src/builder/instructions.dart:5808-5821 | pkg/wasm_builder/lib/src/builder/instructions.dart:5823-5836 | pkg/wasm_builder/lib/src/builder/instructions.dart:5838-5851 | pkg/wasm_builder/lib/src/builder/instructions.dart:5853-5866 | pkg/wasm_builder/lib/src/builder/instructions.dart:5868-5881 | pkg/wasm_builder/lib/src/builder/instructions.dart:5973-5986 — 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.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:155 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:155-164 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:231-240 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:307-314 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:170-179 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:258-267 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:345-352 | sdk/lib/_internal/wasm/common/simd.dart:24-33 | sdk/lib/_internal/wasm/common/simd.dart:128-137 | sdk/lib/_internal/wasm/common/simd.dart:234-241 — 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.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:884 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:884-896 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1002-1014 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1119-1131 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1228-1240 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1349-1361 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1475-1487 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1599-1611 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1793-1805 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1897-1909 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Edited copy of a member (69 corresponding lines) · ×4
  • Edited copy of a member (69 corresponding lines) pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:77 — pkg/analysis_server/lib/src/plugin/server_isolate_channel.dart:77-155 | pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart:203-271 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (69 corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:73 — sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:73-141 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:337-406 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (69 corresponding lines) pkg/front_end/lib/src/type_inference/body_inference_context.dart:359 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:359-427 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:692-762 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (69 corresponding lines) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1206 — pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1206-1274 | pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1276-1363 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (72 corresponding lines) · ×4
  • Edited copy of a member (72 corresponding lines) pkg/kernel/lib/text/ast_to_text.dart:1503 — pkg/kernel/lib/text/ast_to_text.dart:1503-1574 | pkg/kernel/lib/text/ast_to_text.dart:1576-1659 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (72 corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:566 — pkg/compiler/lib/src/js/size_estimator.dart:566-637 | pkg/js_ast/lib/src/printer.dart:922-1000 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (72 corresponding lines) pkg/compiler/lib/src/js_backend/string_reference.dart:333 — pkg/compiler/lib/src/js_backend/string_reference.dart:333-404 | pkg/compiler/lib/src/js_backend/type_reference.dart:370-470 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (72 corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:907 — sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:907-978 | sdk/lib/_internal/js_runtime/lib/async_patch.dart:648-723 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×4
  • Edited copy of a member (53 corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:1958 — sdk/lib/_internal/wasm/common/typed_data.dart:1958-2010 | sdk/lib/_internal/wasm/common/typed_data.dart:2310-2365 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) pkg/kernel/lib/testing/type_parser_environment.dart:708 — pkg/kernel/lib/testing/type_parser_environment.dart:708-760 | pkg/kernel/lib/testing/type_parser_environment.dart:762-834 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:1083 — pkg/vm/lib/modular/transformations/ffi/use_sites.dart:1083-1136 | pkg/vm/lib/modular/transformations/ffi/use_sites.dart:1262-1314 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) pkg/analyzer/tool/generators/ast_generator.dart:901 — pkg/analyzer/tool/generators/ast_generator.dart:901-963 | pkg/analyzer/tool/generators/ast_generator.dart:965-1017 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×4
  • Edited copy of a member (49 corresponding lines) sdk/lib/_internal/wasm/js/string_patch.dart:154 — sdk/lib/_internal/wasm/js/string_patch.dart:154-202 | sdk/lib/_internal/wasm/js_compatibility/string_patch.dart:15-71 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) pkg/dart2wasm/lib/functions.dart:610 — pkg/dart2wasm/lib/functions.dart:610-670 | pkg/dart2wasm/lib/functions.dart:672-720 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2117 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2117-2165 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2389-2437 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) pkg/front_end/lib/src/type_inference/body_inference_context.dart:429 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:429-477 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:764-813 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 24+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:37368 — pkg/analyzer/lib/src/dart/ast/ast.dart:37368-37391 | pkg/analyzer/lib/src/dart/ast/ast.dart:40260-40283 | pkg/analyzer/lib/src/dart/ast/ast.dart:58749-58772 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22462 — pkg/analyzer/lib/src/dart/ast/ast.dart:22462-22485 | pkg/analyzer/lib/src/dart/ast/ast.dart:52768-52791 | pkg/analyzer/lib/src/dart/ast/ast.dart:56427-56450 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) pkg/front_end/lib/src/type_inference/object_access_target.dart:841 — pkg/front_end/lib/src/type_inference/object_access_target.dart:841-865 | pkg/front_end/lib/src/type_inference/object_access_target.dart:867-890 | pkg/front_end/lib/src/type_inference/object_access_target.dart:897-921 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:71 — pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:71-94 | pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:502-525 | pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:1373-1396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×4
  • Edited copies of one member (4 members, 19+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:18543 — pkg/analyzer/lib/src/dart/ast/ast.dart:18543-18566 | pkg/analyzer/lib/src/dart/ast/ast.dart:18735-18759 | pkg/analyzer/lib/src/dart/ast/ast.dart:21599-21617 | pkg/analyzer/lib/src/dart/ast/ast.dart:21773-21792 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 19+ corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:1791 — pkg/analyzer/lib/src/fasta/ast_builder.dart:1791-1809 | pkg/analyzer/lib/src/fasta/ast_builder.dart:1811-1831 | pkg/analyzer/lib/src/fasta/ast_builder.dart:1838-1858 | pkg/analyzer/lib/src/fasta/ast_builder.dart:2053-2071 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 19+ corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:3023 — pkg/front_end/lib/src/kernel/internal_ast.dart:3023-3046 | pkg/front_end/lib/src/kernel/internal_ast.dart:3259-3277 | pkg/front_end/lib/src/kernel/internal_ast.dart:3337-3355 | pkg/front_end/lib/src/kernel/internal_ast.dart:3420-3439 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 19+ corresponding lines) sdk/lib/async/zone.dart:803 — sdk/lib/async/zone.dart:803-821 | sdk/lib/async/zone.dart:952-970 | sdk/lib/async/zone.dart:983-1001 | sdk/lib/async/zone.dart:1003-1021 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×4
  • Edited copies of one member (5 members, 15+ corresponding lines) pkg/kernel/lib/src/merge_visitor.dart:15 — pkg/kernel/lib/src/merge_visitor.dart:15-31 | pkg/kernel/lib/src/merge_visitor.dart:147-161 | pkg/kernel/lib/src/merge_visitor.dart:216-230 | pkg/kernel/lib/src/merge_visitor.dart:256-270 | pkg/kernel/lib/src/merge_visitor.dart:456-470 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 15+ corresponding lines) pkg/analyzer/lib/src/fine/requirements.dart:2089 — pkg/analyzer/lib/src/fine/requirements.dart:2089-2103 | pkg/analyzer/lib/src/fine/requirements.dart:2105-2119 | pkg/analyzer/lib/src/fine/requirements.dart:2137-2151 | pkg/analyzer/lib/src/fine/requirements.dart:2153-2167 | pkg/analyzer/lib/src/fine/requirements.dart:2185-2199 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 15+ corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:767 — pkg/analyzer/lib/src/fine/library_manifest.dart:767-781 | pkg/analyzer/lib/src/fine/library_manifest.dart:783-797 | pkg/analyzer/lib/src/fine/library_manifest.dart:799-813 | pkg/analyzer/lib/src/fine/library_manifest.dart:815-829 | pkg/analyzer/lib/src/fine/library_manifest.dart:831-845 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 15+ corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:2061 — pkg/analyzer/lib/src/dart/constant/value.dart:2061-2075 | pkg/analyzer/lib/src/dart/constant/value.dart:2085-2099 | pkg/analyzer/lib/src/dart/constant/value.dart:2101-2115 | pkg/analyzer/lib/src/dart/constant/value.dart:2373-2391 | pkg/analyzer/lib/src/dart/constant/value.dart:2393-2411 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) · ×4
  • Edited copies of one member (5 members, 9+ corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:558 — sdk/lib/_internal/wasm/common/typed_data.dart:558-566 | sdk/lib/_internal/wasm/common/typed_data.dart:629-637 | sdk/lib/_internal/wasm/common/typed_data.dart:712-720 | sdk/lib/_internal/wasm/common/typed_data.dart:784-792 | sdk/lib/_internal/wasm/common/typed_data.dart:868-876 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 9+ corresponding lines) pkg/vm/lib/transformations/type_flow/summary_collector.dart:277 — pkg/vm/lib/transformations/type_flow/summary_collector.dart:277-288 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:300-311 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:313-324 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:326-334 | pkg/vm/lib/transformations/type_flow/summary_collector.dart:336-347 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 9+ corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_list_element.dart:22 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_list_element.dart:22-30 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_map_entry.dart:22-32 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_map_entry.dart:46-56 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_set_element.dart:22-32 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware_spread.dart:22-30 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 9+ corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:2271 — pkg/kernel/lib/src/ast/expressions.dart:2271-2279 | pkg/kernel/lib/src/ast/expressions.dart:2444-2454 | pkg/kernel/lib/src/ast/expressions.dart:2456-2466 | pkg/kernel/lib/src/ast/expressions.dart:2585-2595 | pkg/kernel/lib/src/ast/expressions.dart:2597-2608 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×4
  • Edited copies of one member (4 members, 4+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:343 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:343-346 | sdk/lib/_internal/js_runtime/lib/js_array.dart:452-455 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:334-337 | sdk/lib/collection/list.dart:357-360 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:439 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:439-443 | sdk/lib/_internal/js_runtime/lib/js_number.dart:531-534 | sdk/lib/_internal/vm/lib/integers.dart:209-217 | sdk/lib/_internal/wasm/common/boxed_int.dart:176-185 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:561 — sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart:561-564 | sdk/lib/_internal/js_runtime/lib/core_patch.dart:557-560 | sdk/lib/_internal/wasm/js_common/string_buffer_patch.dart:35-38 | sdk/lib/_internal/wasm/js_compatibility/string_buffer_patch.dart:25-28 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 4+ corresponding lines) pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:24 — pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:24-27 | pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart:24-27 | pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart:24-27 | pkg/front_end/testcases/general/error_recovery/issue_26810.dart:28-31 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×4
  • Duplicated block (43 lines × 2) pkg/analyzer/tool/generators/ast_generator.dart:1350 — pkg/analyzer/tool/generators/ast_generator.dart:1350-1392 | pkg/analyzer/tool/generators/string_search_util_generator.dart:197-239 — 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 `pkg/analyzer/tool/generators/ast_generator.dart:1350` 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 `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 (43 lines × 2) pkg/compiler/lib/src/js_model/element_map_impl.dart:1300 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1300-1342 | pkg/compiler/lib/src/kernel/element_map_impl.dart:983-1025 — `pkg/compiler/lib/src/js_model/element_map_impl.dart` and `pkg/compiler/lib/src/kernel/element_map_impl.dart` 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 22 separate duplicated blocks between them, totalling at least 305 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (43 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:9229 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:9229-9271 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9452-9494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:9229` it does not close everything it opens, so those 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 `node` to `AnonymousMethodExpression` in one and `AnonymousMethodBlock` 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, `pkg/front_end/lib/src/type_inference/inference_visitor.dart:9450` calls `getExpressionInfo` and `pkg/front_end/lib/src/type_inference/inference_visitor.dart:9227` 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 (43 lines × 2) pkg/observatory/lib/src/elements/heap_snapshot.dart:670 — pkg/observatory/lib/src/elements/heap_snapshot.dart:670-712 | pkg/observatory/lib/src/elements/process_snapshot.dart:358-400 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:670` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×4
  • Duplicated block (39 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5351 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5351-5389 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5961-5999 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5351` 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 (39 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1543 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1543-1581 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1561-1599 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1543` 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 (39 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_string.dart:212 — sdk/lib/_internal/js_dev_runtime/private/js_string.dart:212-250 | sdk/lib/_internal/js_runtime/lib/js_string.dart:199-237 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_string.dart` and `sdk/lib/_internal/js_runtime/lib/js_string.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 93 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 (39 lines × 2) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:235 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:235-273 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:795-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 `sdk/lib/_internal/js_runtime/lib/collection_patch.dart: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. 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 · Duplicated block (31 lines × 2) · ×4
  • Duplicated block (31 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/keyword_state.dart:48 — pkg/_fe_analyzer_shared/lib/src/scanner/keyword_state.dart:48-78 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/keyword_state.dart:16-46 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/keyword_state.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/keyword_state.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/keyword_state.dart:16` 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 (31 lines × 2) pkg/analysis_server/lib/src/server/error_notifier.dart:21 — pkg/analysis_server/lib/src/server/error_notifier.dart:21-51 | pkg/analysis_server/lib/src/session_logger/user_notifying_session_listener.dart:39-69 — 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 (31 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5783 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5783-5813 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6438-6468 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (31 lines × 2) sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart:66 — sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart:66-96 | sdk/lib/_internal/wasm/standalone/boxed_double_patch.dart:19-49 — `sdk/lib/_internal/wasm/js_common/boxed_double_patch.dart` and `sdk/lib/_internal/wasm/standalone/boxed_double_patch.dart` 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 76 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. 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 · Duplicated block (22 lines × 3) · ×4
  • Duplicated block (22 lines × 3) pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:404 — pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:404-425 | pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:480-501 | pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:681-702 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `CompoundAssignment` in one and `DirectAssignment` 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 (22 lines × 3) pkg/front_end/lib/src/fragment/enum_element.dart:97 — pkg/front_end/lib/src/fragment/enum_element.dart:97-118 | pkg/front_end/lib/src/fragment/field/declaration.dart:331-352 | pkg/front_end/lib/src/fragment/primary_constructor_field.dart:124-145 — before extracting anything, compare `pkg/front_end/lib/src/fragment/enum_element.dart` and `pkg/front_end/lib/src/fragment/field/declaration.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `pkg/front_end/lib/src/fragment/enum_element.dart:97` it does not close everything it opens, so those exact lines 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 × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:381 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:381-402 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:384-405 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:453-474 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:381` it does not close everything it opens, so those 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 (22 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1339 — sdk/lib/_internal/vm/lib/convert_patch.dart:1339-1360 | sdk/lib/_internal/wasm/common/convert_patch.dart:1525-1546 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1217-1238 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1339` 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×4
  • Duplicated block (21–22 lines × 2) pkg/analyzer/lib/src/summary2/element_builder.dart:598 — pkg/analyzer/lib/src/summary2/element_builder.dart:598-619 | pkg/analyzer/lib/src/summary2/element_builder.dart:705-725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/element_builder.dart:598` 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 (21–22 lines × 2) pkg/dart2wasm/lib/dynamic_dispatchers.dart:100 — pkg/dart2wasm/lib/dynamic_dispatchers.dart:100-120 | pkg/dart2wasm/lib/dynamic_dispatchers.dart:136-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/dynamic_dispatchers.dart:100` it does not close everything it opens, so those exact lines 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 × 2) pkg/front_end/lib/src/kernel/expression_generator.dart:2955 — pkg/front_end/lib/src/kernel/expression_generator.dart:2955-2976 | pkg/front_end/lib/src/kernel/expression_generator.dart:3429-3449 — both copies are in the same file, so extract the 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, `pkg/front_end/lib/src/kernel/expression_generator.dart:2954` calls `_createThisAccess` and `pkg/front_end/lib/src/kernel/expression_generator.dart:3428` 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 (21–22 lines × 2) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1805 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1805-1826 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1830-1850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/collection_encoding.dart:1805` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×4
  • Duplicated block (11–13 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:100 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:100-112 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:168-178 — 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 `pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:100` it does not close everything it opens, so those exact lines 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–13 lines × 2) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:245 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:245-255 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:330-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/element/replacement_visitor.dart: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. 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–13 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:253 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:253-263 | sdk/lib/_internal/js_runtime/lib/js_array.dart:351-363 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 `sdk/lib/_internal/js_dev_runtime/private/js_array.dart:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–13 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:288 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:288-298 | sdk/lib/_internal/js_runtime/lib/js_array.dart:392-404 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 · Duplicated block (10 lines × 5) · ×4
  • Duplicated block (10 lines × 5) pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:249 — pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:249-258 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:281-290 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:313-322 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:541-550 | pkg/front_end/lib/src/util/abstracted_ast_nodes.dart:572-581 — 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. 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 × 5) sdk/lib/vmservice/devfs.dart:205 — sdk/lib/vmservice/devfs.dart:205-214 | sdk/lib/vmservice/devfs.dart:225-234 | sdk/lib/vmservice/devfs.dart:282-291 | sdk/lib/vmservice/devfs.dart:339-348 | sdk/lib/vmservice/devfs.dart:399-408 — 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. 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 × 5) pkg/linter/lib/src/rules/always_declare_return_types.dart:29 — pkg/linter/lib/src/rules/always_declare_return_types.dart:29-38 | pkg/linter/lib/src/rules/annotate_overrides.dart:26-35 | pkg/linter/lib/src/rules/avoid_types_as_parameter_names.dart:32-41 | pkg/linter/lib/src/rules/noop_primitive_operations.dart:24-33 | pkg/linter/lib/src/rules/unnecessary_null_aware_operator_on_extension_on_nullable.dart:33-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
  • Duplicated block (10 lines × 5) pkg/test_runner/lib/src/runtime_configuration.dart:444 — pkg/test_runner/lib/src/runtime_configuration.dart:444-454 | pkg/test_runner/lib/src/runtime_configuration.dart:486-496 | pkg/test_runner/lib/src/runtime_configuration.dart:519-528 | pkg/test_runner/lib/src/runtime_configuration.dart:554-563 | pkg/test_runner/lib/src/runtime_configuration.dart:589-599 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/test_runner/lib/src/runtime_configuration.dart: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. 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, `pkg/test_runner/lib/src/runtime_configuration.dart:484` calls `DartPrecompiledRuntimeConfiguration` and `pkg/test_runner/lib/src/runtime_configuration.dart:443` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×4
  • Duplicated block (7 lines × 6) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1579 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1579-1585 | sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1621-1627 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1597-1603 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1639-1645 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2181-2187 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2223-2229 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1579` it does not close everything it opens, so those exact lines 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 × 6) pkg/front_end/lib/src/dill/dill_class_builder.dart:281 — pkg/front_end/lib/src/dill/dill_class_builder.dart:281-287 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:232-239 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:405-411 | pkg/front_end/lib/src/source/source_class_builder.dart:188-194 | pkg/front_end/lib/src/source/source_extension_builder.dart:113-119 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:132-138 — before extracting anything, compare `pkg/front_end/lib/src/dill/dill_class_builder.dart` and `pkg/front_end/lib/src/dill/dill_extension_builder.dart` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 6) pkg/front_end/lib/src/dill/dill_class_builder.dart:294 — pkg/front_end/lib/src/dill/dill_class_builder.dart:294-300 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:246-253 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:418-424 | pkg/front_end/lib/src/source/source_class_builder.dart:200-206 | pkg/front_end/lib/src/source/source_extension_builder.dart:125-131 | pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:144-150 — before extracting anything, compare `pkg/front_end/lib/src/dill/dill_class_builder.dart` and `pkg/front_end/lib/src/dill/dill_extension_builder.dart` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 6) pkg/kernel/lib/src/ast/expressions.dart:128 — pkg/kernel/lib/src/ast/expressions.dart:128-134 | pkg/kernel/lib/src/ast/expressions.dart:243-249 | pkg/kernel/lib/src/ast/functions.dart:66-72 | pkg/kernel/lib/src/ast/functions.dart:258-264 | pkg/kernel/lib/src/ast/types.dart:79-85 | pkg/kernel/lib/src/ast/types.dart:162-168 — before extracting anything, compare `pkg/kernel/lib/src/ast/expressions.dart` and `pkg/kernel/lib/src/ast/types.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 46 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `generator` to `Expression Function(int index)` in one and `NamedExpression Function(int index)` 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.
IC1 · Incompleteness & stubs · Dead branch · ×4
  • Dead branch — condition is always false pkg/front_end/testcases/general/constants/unused_non_const.dart:12 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false pkg/front_end/testcases/general/constants/unused_non_const.dart:13 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false pkg/front_end/testcases/general/constants/unused_non_const.dart:14 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
  • Dead branch — condition is always false pkg/front_end/testcases/general/constants/unused_non_const.dart:15 — A branch guarded by a literal `false` can never execute — left-over disabled code. Remove it or restore the real condition.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience pkg/analysis_server/lib/src/services/pub/pub_api.dart:61 — `http.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_change_requests_processing.dart:124 — `HttpClient()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience runtime/tools/dartfuzz/collect_data.py:46 — `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience runtime/tools/dartfuzz/collect_data.py:99 — `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
S1 · Web-Security Posture · Weak hash algorithm · ×4
  • Weak hash algorithm pkg/analysis_server/lib/src/plugin/plugin_manager.dart:1104 — MD5/SHA1 is computed 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+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm pkg/analyzer/lib/src/dart/analysis/file_content_cache.dart:58 — MD5/SHA1 is computed 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+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm pkg/analyzer/lib/src/summary/api_signature.dart:167 — MD5/SHA1 is computed 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+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm pkg/compiler/lib/src/hash/sha1.dart:16 — MD5/SHA1 is computed 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+ (`sha256.convert(…)` from `package:crypto`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×3
  • Focus outline removed in CSS without a :focus replacement pkg/observatory/web/timeline.html:24 — `#trace-viewer:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement pkg/observatory/lib/src/elements/css/shared.css:2653 — `.search-bar button:enabled` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement pkg/observatory/lib/src/elements/css/shared.css:2861 — `.virtual-tree .expander:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parseNumber (cyclomatic 42) · ×3
  • _ChunkedJsonParser.parseNumber (cyclomatic 42) sdk/lib/_internal/vm/lib/convert_patch.dart:1303 — _ChunkedJsonParser.parseNumber has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • _ChunkedJsonParser.parseNumber (cyclomatic 42) sdk/lib/_internal/wasm/common/convert_patch.dart:1489 — _ChunkedJsonParser.parseNumber has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • _ChunkedJsonParser.parseNumber (cyclomatic 42) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1181 — _ChunkedJsonParser.parseNumber has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parsePartialNumber (cyclomatic 25) · ×3
  • _ChunkedJsonParser.parsePartialNumber (cyclomatic 25) sdk/lib/_internal/vm/lib/convert_patch.dart:640 — _ChunkedJsonParser.parsePartialNumber 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.
  • _ChunkedJsonParser.parsePartialNumber (cyclomatic 25) sdk/lib/_internal/wasm/common/convert_patch.dart:720 — _ChunkedJsonParser.parsePartialNumber 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.
  • _ChunkedJsonParser.parsePartialNumber (cyclomatic 25) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:593 — _ChunkedJsonParser.parsePartialNumber 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.
D1 · Cyclomatic Complexity · _BigIntImpl.toDouble (cyclomatic 16) · ×3
  • _BigIntImpl.toDouble (cyclomatic 16) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1884 — _BigIntImpl.toDouble 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.
  • _BigIntImpl.toDouble (cyclomatic 16) sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1902 — _BigIntImpl.toDouble 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.
  • _BigIntImpl.toDouble (cyclomatic 16) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2496 — _BigIntImpl.toDouble has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseNumber (cognitive 96) · ×3
  • _ChunkedJsonParser.parseNumber (cognitive 96) sdk/lib/_internal/vm/lib/convert_patch.dart:1303 — _ChunkedJsonParser.parseNumber has cognitive complexity 96 (threshold 15). Drivers by points: if/else 35 (74 pts), ternaries 4 (14 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • _ChunkedJsonParser.parseNumber (cognitive 96) sdk/lib/_internal/wasm/common/convert_patch.dart:1489 — _ChunkedJsonParser.parseNumber has cognitive complexity 96 (threshold 15). Drivers by points: if/else 35 (74 pts), ternaries 4 (14 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • _ChunkedJsonParser.parseNumber (cognitive 96) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1181 — _ChunkedJsonParser.parseNumber has cognitive complexity 96 (threshold 15). Drivers by points: if/else 35 (74 pts), ternaries 4 (14 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ChunkedJsonParser.parsePartialNumber (cognitive 47) · ×3
  • _ChunkedJsonParser.parsePartialNumber (cognitive 47) sdk/lib/_internal/vm/lib/convert_patch.dart:640 — _ChunkedJsonParser.parsePartialNumber has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 3, boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _ChunkedJsonParser.parsePartialNumber (cognitive 47) sdk/lib/_internal/wasm/common/convert_patch.dart:720 — _ChunkedJsonParser.parsePartialNumber has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 3, boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _ChunkedJsonParser.parsePartialNumber (cognitive 47) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:593 — _ChunkedJsonParser.parsePartialNumber has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 3, boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BigIntImpl.toDouble (cognitive 33) · ×3
  • _BigIntImpl.toDouble (cognitive 33) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1884 — _BigIntImpl.toDouble has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _BigIntImpl.toDouble (cognitive 33) sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1902 — _BigIntImpl.toDouble has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _BigIntImpl.toDouble (cognitive 33) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2496 — _BigIntImpl.toDouble has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitMethodDeclaration (cognitive 17) · ×3
  • _Visitor.visitMethodDeclaration (cognitive 17) pkg/linter/lib/src/rules/avoid_returning_this.dart:69 — _Visitor.visitMethodDeclaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _Visitor.visitMethodDeclaration (cognitive 17) pkg/linter/lib/src/rules/no_logic_in_create_state.dart:35 — _Visitor.visitMethodDeclaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _Visitor.visitMethodDeclaration (cognitive 17) pkg/linter/lib/src/rules/use_setters_to_change_properties.dart:43 — _Visitor.visitMethodDeclaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (8 members, 50+ identical tokens) pkg/analyzer/lib/src/dart/constant/value.dart:1150 — pkg/analyzer/lib/src/dart/constant/value.dart:1150-1170 | pkg/analyzer/lib/src/dart/constant/value.dart:1172-1192 | pkg/analyzer/lib/src/dart/constant/value.dart:1250-1270 | pkg/analyzer/lib/src/dart/constant/value.dart:1272-1292 | pkg/analyzer/lib/src/dart/constant/value.dart:2148-2168 | pkg/analyzer/lib/src/dart/constant/value.dart:2170-2190 | pkg/analyzer/lib/src/dart/constant/value.dart:2246-2266 | pkg/analyzer/lib/src/dart/constant/value.dart:2268-2288 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) pkg/front_end/lib/src/kernel/internal_ast.dart:2667 — pkg/front_end/lib/src/kernel/internal_ast.dart:2667-2688 | pkg/front_end/lib/src/kernel/internal_ast.dart:2860-2883 | pkg/front_end/lib/src/kernel/internal_ast.dart:3187-3212 | pkg/front_end/lib/src/kernel/internal_ast.dart:4437-4456 | pkg/front_end/lib/src/kernel/internal_ast.dart:4593-4614 | pkg/front_end/lib/src/kernel/internal_ast.dart:4736-4757 | pkg/front_end/lib/src/kernel/internal_ast.dart:4880-4901 | pkg/front_end/lib/src/kernel/internal_ast.dart:5008-5027 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:641 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:641-665 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:679-701 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1096-1115 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1124-1145 | sdk/lib/_internal/wasm/common/compact_hash.dart:606-633 | sdk/lib/_internal/wasm/common/compact_hash.dart:636-658 | sdk/lib/_internal/wasm/common/compact_hash.dart:1016-1035 | sdk/lib/_internal/wasm/common/compact_hash.dart:1045-1068 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×3
  • Edited copy of a member (81 corresponding lines) pkg/compiler/lib/src/universe/codegen_world_builder.dart:495 — pkg/compiler/lib/src/universe/codegen_world_builder.dart:495-575 | pkg/compiler/lib/src/universe/resolution_world_builder.dart:799-884 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (81 corresponding lines) pkg/compiler/lib/src/ssa/builder.dart:4130 — pkg/compiler/lib/src/ssa/builder.dart:4130-4210 | pkg/compiler/lib/src/ssa/builder.dart:4212-4297 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (81 corresponding lines) pkg/front_end/lib/src/source/outline_builder.dart:1089 — pkg/front_end/lib/src/source/outline_builder.dart:1089-1170 | pkg/front_end/lib/src/source/outline_builder.dart:1252-1332 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×3
  • Edited copy of a member (56 corresponding lines) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:492 — pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:492-547 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1424-1479 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (56 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:8392 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8392-8447 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9344-9399 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (56 corresponding lines) pkg/front_end/lib/src/kernel/resolver.dart:252 — pkg/front_end/lib/src/kernel/resolver.dart:252-307 | pkg/front_end/lib/src/kernel/resolver.dart:309-371 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×3
  • Edited copy of a member (43 corresponding lines) pkg/vm/lib/transformations/type_flow/transformer.dart:2629 — pkg/vm/lib/transformations/type_flow/transformer.dart:2629-2671 | pkg/vm/lib/transformations/type_flow/transformer.dart:2673-2720 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_assist_other_file_could_add_late.dart:94 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_assist_other_file_could_add_late.dart:94-136 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_many_assist_calls.dart:97-147 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:4382 — pkg/front_end/lib/src/kernel/body_builder.dart:4382-4424 | pkg/front_end/lib/src/kernel/body_builder.dart:4426-4476 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×3
  • Edited copy of a member (44 corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:7770 — pkg/front_end/lib/src/kernel/internal_ast.dart:7770-7813 | pkg/kernel/lib/src/ast/statements.dart:1292-1335 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) pkg/kernel/lib/verifier.dart:579 — pkg/kernel/lib/verifier.dart:579-622 | pkg/kernel/lib/verifier.dart:643-690 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) pkg/dev_compiler/lib/src/js_ast/printer.dart:342 — pkg/dev_compiler/lib/src/js_ast/printer.dart:342-396 | pkg/js_ast/lib/src/printer.dart:432-475 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×3
  • Edited copy of a member (50 corresponding lines) pkg/front_end/lib/src/kernel/body_builder.dart:1511 — pkg/front_end/lib/src/kernel/body_builder.dart:1511-1565 | pkg/front_end/lib/src/kernel/body_builder.dart:1670-1719 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) pkg/front_end/lib/src/type_inference/body_inference_context.dart:919 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:919-970 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:1088-1137 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:901 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:901-951 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1985-2034 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 31+ corresponding lines) pkg/analysis_server/lib/src/services/snippets/dart/for_in_statement.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/for_in_statement.dart:19-49 | pkg/analysis_server/lib/src/services/snippets/dart/function_declaration.dart:19-50 | pkg/analysis_server/lib/src/services/snippets/dart/switch_expression.dart:19-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 31+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:490 — pkg/compiler/lib/src/js/size_estimator.dart:490-520 | pkg/dev_compiler/lib/src/js_ast/printer.dart:737-768 | pkg/js_ast/lib/src/printer.dart:806-841 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 31+ corresponding lines) pkg/front_end/lib/src/fragment/constructor/declaration.dart:1012 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:1012-1042 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1184-1214 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1429-1459 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 24+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 24+ corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1471 — pkg/compiler/lib/src/js/rewrite_async.dart:1471-1494 | pkg/compiler/lib/src/js/rewrite_async.dart:1496-1519 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1508-1534 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1536-1562 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 24+ corresponding lines) pkg/wasm_builder/lib/src/serialize/sections.dart:292 — pkg/wasm_builder/lib/src/serialize/sections.dart:292-315 | pkg/wasm_builder/lib/src/serialize/sections.dart:335-360 | pkg/wasm_builder/lib/src/serialize/sections.dart:380-406 | pkg/wasm_builder/lib/src/serialize/sections.dart:426-450 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 24+ corresponding lines) pkg/analyzer/lib/src/error/best_practices_verifier.dart:610 — pkg/analyzer/lib/src/error/best_practices_verifier.dart:610-635 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:834-858 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:860-887 | pkg/analyzer/lib/src/error/best_practices_verifier.dart:889-912 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 27+ corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:68 — pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:68-94 | pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:53-79 | pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart:48-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) pkg/compiler/lib/src/ssa/nodes.dart:140 — pkg/compiler/lib/src/ssa/nodes.dart:140-171 | pkg/compiler/lib/src/ssa/nodes.dart:173-202 | pkg/compiler/lib/src/ssa/nodes.dart:409-435 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) pkg/compiler/lib/src/serialization/strategies.dart:99 — pkg/compiler/lib/src/serialization/strategies.dart:99-126 | pkg/compiler/lib/src/serialization/strategies.dart:193-219 | pkg/compiler/lib/src/serialization/strategies.dart:287-313 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 16+ corresponding lines) pkg/compiler/lib/src/util/maplet.dart:61 — pkg/compiler/lib/src/util/maplet.dart:61-76 | pkg/compiler/lib/src/util/setlet.dart:71-86 | pkg/compiler/lib/src/util/setlet.dart:165-180 | pkg/compiler/lib/src/util/setlet.dart:182-206 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 16+ corresponding lines) pkg/analyzer/lib/src/binary/binary_writer.dart:289 — pkg/analyzer/lib/src/binary/binary_writer.dart:289-304 | pkg/compiler/lib/src/serialization/binary_sink.dart:94-112 | pkg/dart2js_info/lib/src/binary/sink.dart:277-295 | pkg/kernel/lib/binary/ast_to_binary.dart:108-124 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 16+ corresponding lines) pkg/observatory/lib/src/elements/class_allocation_profile.dart:121 — pkg/observatory/lib/src/elements/class_allocation_profile.dart:121-136 | pkg/observatory/lib/src/elements/cpu_profile.dart:155-170 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:475-490 | pkg/observatory/lib/src/elements/native_memory_profiler.dart:146-161 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 18+ corresponding lines) pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:32 — pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:32-52 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:54-76 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:78-95 | pkg/analysis_server/tool/benchmark_tools/lsp_messages.dart:289-306 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 18+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:1260 — pkg/analyzer/lib/src/dart/ast/ast.dart:1260-1278 | pkg/analyzer/lib/src/dart/ast/ast.dart:1280-1297 | pkg/analyzer/lib/src/dart/ast/ast.dart:26762-26780 | pkg/analyzer/lib/src/dart/ast/ast.dart:26782-26802 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 18+ corresponding lines) pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:215 — pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:215-233 | pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:235-254 | pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:272-290 | pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart:292-309 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×3
  • Edited copies of one member (5 members, 17+ corresponding lines) pkg/analyzer/lib/src/dart/element/element.dart:5474 — pkg/analyzer/lib/src/dart/element/element.dart:5474-5490 | pkg/analyzer/lib/src/dart/element/element.dart:5492-5508 | pkg/analyzer/lib/src/dart/element/element.dart:5533-5549 | pkg/analyzer/lib/src/dart/element/element.dart:5551-5567 | pkg/analyzer/lib/src/dart/element/element.dart:6157-6173 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 17+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:5595 — pkg/analyzer/lib/src/dart/ast/ast.dart:5595-5611 | pkg/analyzer/lib/src/dart/ast/ast.dart:12824-12840 | pkg/analyzer/lib/src/dart/ast/ast.dart:21016-21032 | pkg/analyzer/lib/src/dart/ast/ast.dart:32481-32497 | pkg/analyzer/lib/src/dart/ast/ast.dart:50376-50392 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 17+ corresponding lines) pkg/analyzer/lib/src/fine/requirements.dart:1829 — pkg/analyzer/lib/src/fine/requirements.dart:1829-1851 | pkg/analyzer/lib/src/fine/requirements.dart:1853-1869 | pkg/analyzer/lib/src/fine/requirements.dart:1940-1956 | pkg/analyzer/lib/src/fine/requirements.dart:1958-1974 | pkg/analyzer/lib/src/fine/requirements.dart:1976-1992 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (5 members, 13+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200 — pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:200-216 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:229-242 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:281-298 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:403-415 | pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart:427-439 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 13+ corresponding lines) pkg/observatory/lib/src/elements/heap_map.dart:39 — pkg/observatory/lib/src/elements/heap_map.dart:39-53 | pkg/observatory/lib/src/elements/logging.dart:40-54 | pkg/observatory/lib/src/elements/process_snapshot.dart:218-230 | pkg/observatory/lib/src/elements/sentinel_view.dart:33-49 | pkg/observatory/lib/src/elements/timeline_page.dart:42-56 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 13+ corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:568 — sdk/lib/_internal/wasm/common/typed_data.dart:568-580 | sdk/lib/_internal/wasm/common/typed_data.dart:639-651 | sdk/lib/_internal/wasm/common/typed_data.dart:722-734 | sdk/lib/_internal/wasm/common/typed_data.dart:794-806 | sdk/lib/_internal/wasm/common/typed_data.dart:878-890 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (6 members, 10+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:3035 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:3035-3044 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3058-3067 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3081-3090 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3104-3113 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3127-3136 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:3150-3159 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22329 — pkg/analyzer/lib/src/dart/ast/ast.dart:22329-22341 | pkg/analyzer/lib/src/dart/ast/ast.dart:22343-22354 | pkg/analyzer/lib/src/dart/ast/ast.dart:52639-52649 | pkg/analyzer/lib/src/dart/ast/ast.dart:52651-52660 | pkg/analyzer/lib/src/dart/ast/ast.dart:56294-56306 | pkg/analyzer/lib/src/dart/ast/ast.dart:56308-56319 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 10+ corresponding lines) sdk/lib/_internal/js_runtime/lib/js_array.dart:558 — sdk/lib/_internal/js_runtime/lib/js_array.dart:558-568 | sdk/lib/_internal/js_runtime/lib/js_array.dart:570-580 | sdk/lib/collection/list.dart:100-109 | sdk/lib/collection/list.dart:111-120 | sdk/lib/internal/iterable.dart:85-94 | sdk/lib/internal/iterable.dart:96-105 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (8 members, 11+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1210 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1210-1222 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1333-1343 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1457-1469 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1583-1593 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1775-1787 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1879-1891 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2364-2376 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2492-2504 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
  • Edited copies of one member (8 members, 11+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:2174 — pkg/analyzer/lib/src/dart/ast/ast.dart:2174-2184 | pkg/analyzer/lib/src/dart/ast/ast.dart:7323-7335 | pkg/analyzer/lib/src/dart/ast/ast.dart:11148-11158 | pkg/analyzer/lib/src/dart/ast/ast.dart:15409-15419 | pkg/analyzer/lib/src/dart/ast/ast.dart:30115-30126 | pkg/analyzer/lib/src/dart/ast/ast.dart:30918-30929 | pkg/analyzer/lib/src/dart/ast/ast.dart:57325-57335 | pkg/analyzer/lib/src/dart/ast/ast.dart:57903-57913 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
  • Edited copies of one member (8 members, 11+ corresponding lines) pkg/wasm_builder/lib/src/builder/instructions.dart:5688 — pkg/wasm_builder/lib/src/builder/instructions.dart:5688-5701 | pkg/wasm_builder/lib/src/builder/instructions.dart:5883-5896 | pkg/wasm_builder/lib/src/builder/instructions.dart:5898-5911 | pkg/wasm_builder/lib/src/builder/instructions.dart:5913-5926 | pkg/wasm_builder/lib/src/builder/instructions.dart:5928-5941 | pkg/wasm_builder/lib/src/builder/instructions.dart:5943-5956 | pkg/wasm_builder/lib/src/builder/instructions.dart:5958-5971 | pkg/wasm_builder/lib/src/builder/instructions.dart:6329-6339 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (6 members, 14+ corresponding lines) pkg/analyzer/lib/src/summary2/informative_data.dart:683 — pkg/analyzer/lib/src/summary2/informative_data.dart:683-696 | pkg/analyzer/lib/src/summary2/informative_data.dart:912-926 | pkg/analyzer/lib/src/summary2/informative_data.dart:928-942 | pkg/analyzer/lib/src/summary2/informative_data.dart:1113-1130 | pkg/analyzer/lib/src/summary2/informative_data.dart:1132-1148 | pkg/analyzer/lib/src/summary2/informative_data.dart:1150-1166 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 14+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:10333 — pkg/analyzer/lib/src/dart/ast/ast.dart:10333-10346 | pkg/analyzer/lib/src/dart/ast/ast.dart:25020-25035 | pkg/analyzer/lib/src/dart/ast/ast.dart:25271-25286 | pkg/analyzer/lib/src/dart/ast/ast.dart:25500-25515 | pkg/analyzer/lib/src/dart/ast/ast.dart:56716-56730 | pkg/analyzer/lib/src/dart/ast/ast.dart:57667-57681 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 14+ corresponding lines) pkg/analysis_server/lib/src/computer/computer_highlights.dart:1030 — pkg/analysis_server/lib/src/computer/computer_highlights.dart:1030-1043 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1233-1246 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1248-1261 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1330-1343 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1345-1358 | pkg/analysis_server/lib/src/computer/computer_highlights.dart:1913-1926 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (5 members, 12+ corresponding lines) pkg/observatory/lib/src/elements/icdata_ref.dart:53 — pkg/observatory/lib/src/elements/icdata_ref.dart:53-64 | pkg/observatory/lib/src/elements/megamorphiccache_ref.dart:55-66 | pkg/observatory/lib/src/elements/objectpool_ref.dart:53-64 | pkg/observatory/lib/src/elements/singletargetcache_ref.dart:56-68 | pkg/observatory/lib/src/elements/unlinkedcall_ref.dart:53-64 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 12+ corresponding lines) pkg/vm/lib/transformations/type_flow/transformer.dart:1852 — pkg/vm/lib/transformations/type_flow/transformer.dart:1852-1863 | pkg/vm/lib/transformations/type_flow/transformer.dart:1880-1892 | pkg/vm/lib/transformations/type_flow/transformer.dart:1894-1909 | pkg/vm/lib/transformations/type_flow/transformer.dart:1941-1954 | pkg/vm/lib/transformations/type_flow/transformer.dart:2000-2016 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 12+ corresponding lines) pkg/cfg/lib/passes/constant_propagation.dart:373 — pkg/cfg/lib/passes/constant_propagation.dart:373-387 | pkg/cfg/lib/passes/constant_propagation.dart:414-428 | pkg/cfg/lib/passes/constant_propagation.dart:587-598 | pkg/cfg/lib/passes/constant_propagation.dart:618-629 | pkg/cfg/lib/passes/constant_propagation.dart:631-642 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 4+ corresponding lines) pkg/dtd/lib/src/response_types/_connected_app.dart:37 — pkg/dtd/lib/src/response_types/_connected_app.dart:37-40 | pkg/dtd/lib/src/response_types/_file_system.dart:112-115 | pkg/dtd/lib/src/response_types/response_types.dart:159-164 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:318 — pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:318-321 | pkg/compiler/lib/src/js_backend/string_reference.dart:220-223 | pkg/compiler/lib/src/js_backend/type_reference.dart:221-224 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:493 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:493-496 | sdk/lib/_internal/wasm/common/typed_data.dart:2276-2279 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:750-753 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (68 lines × 2) · ×3
  • Duplicated block (68 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7458 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7458-7525 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8325-8392 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7458` it does not close everything it opens, so those 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 (68 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:132 — sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart:132-199 | sdk/lib/_internal/js_runtime/lib/math_patch.dart:128-195 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart` and `sdk/lib/_internal/js_runtime/lib/math_patch.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 144 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 (68 lines × 2) sdk/lib/_internal/vm/lib/integers.dart:444 — sdk/lib/_internal/vm/lib/integers.dart:444-511 | sdk/lib/_internal/wasm/common/boxed_int.dart:338-405 — before extracting anything, compare `sdk/lib/_internal/vm/lib/integers.dart` and `sdk/lib/_internal/wasm/common/boxed_int.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 · Duplicated block (56 lines × 2) · ×3
  • Duplicated block (56 lines × 2) pkg/dart2wasm/lib/list_factory_specializer.dart:38 — pkg/dart2wasm/lib/list_factory_specializer.dart:38-93 | pkg/vm/lib/modular/specializer/list_factory_specializer.dart:36-91 — before extracting anything, compare `pkg/dart2wasm/lib/list_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/list_factory_specializer.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 151 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 `pkg/dart2wasm/lib/list_factory_specializer.dart:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (56 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5128 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5128-5183 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5738-5793 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5128` it does not close everything it opens, so those 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 (56 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:922 — sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:922-977 | sdk/lib/_internal/js_runtime/lib/async_patch.dart:664-719 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart` and `sdk/lib/_internal/js_runtime/lib/async_patch.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 174 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 `sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:922` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×3
  • Duplicated block (50 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1985 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1985-2034 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1524-1573 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1985` 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 (50 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3623 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3623-3672 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4224-4273 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:3623` it does not close everything it opens, so those exact lines 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) pkg/dart_service_protocol_shared/lib/src/named_lookup.dart:19 — pkg/dart_service_protocol_shared/lib/src/named_lookup.dart:19-68 | pkg/dds/lib/src/named_lookup.dart:19-68 — before extracting anything, compare `pkg/dart_service_protocol_shared/lib/src/named_lookup.dart` and `pkg/dds/lib/src/named_lookup.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart_service_protocol_shared/lib/src/named_lookup.dart:19` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×3
  • Duplicated block (38 lines × 2) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:352 — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:352-389 | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:818-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:352` 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 (38 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13851 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:13851-13888 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:14137-14174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:13851` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `DotShorthandInvocation` in one and `DotShorthandPropertyGet` 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 (38 lines × 2) sdk/lib/vmservice/devfs.dart:229 — sdk/lib/vmservice/devfs.dart:229-266 | sdk/lib/vmservice/devfs.dart:286-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×3
  • Duplicated block (37 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1479 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1479-1515 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1187-1223 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (37 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4770 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4770-4806 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5380-5416 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (37 lines × 2) pkg/observatory/lib/src/elements/cpu_profile.dart:108 — pkg/observatory/lib/src/elements/cpu_profile.dart:108-144 | pkg/observatory/lib/src/elements/native_memory_profiler.dart:98-134 — 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 `pkg/observatory/lib/src/elements/cpu_profile.dart:108` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×3
  • Duplicated block (36 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4733 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4733-4768 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5343-5378 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (36 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7595 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7595-7630 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8462-8497 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (36 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8412 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8412-8447 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9364-9399 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:8412` 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.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×3
  • Duplicated block (26–27 lines × 2) pkg/compiler/lib/src/universe/member_usage.dart:340 — pkg/compiler/lib/src/universe/member_usage.dart:340-366 | pkg/compiler/lib/src/universe/member_usage.dart:495-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (26–27 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3706 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3706-3732 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4306-4331 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:3706` 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 (26–27 lines × 2) pkg/front_end/lib/src/kernel/kernel_helper.dart:91 — pkg/front_end/lib/src/kernel/kernel_helper.dart:91-117 | pkg/front_end/lib/src/kernel/kernel_helper.dart:131-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/kernel_helper.dart:91` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×3
  • Duplicated block (23–24 lines × 2) pkg/dart2wasm/lib/code_generator.dart:3080 — pkg/dart2wasm/lib/code_generator.dart:3080-3103 | pkg/dart2wasm/lib/code_generator.dart:3185-3207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/code_generator.dart:3080` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ListLiteral` in one and `SetLiteral` 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 (23–24 lines × 2) pkg/front_end/lib/src/type_inference/collection_encoding.dart:1084 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:1084-1106 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1635-1658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/collection_encoding.dart:1084` 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 (23–24 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1267 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1267-1289 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3836-3859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/lib/src/type_inference/inference_visitor.dart:3832` calls `ifNullExpression_end`, `toNonNull` and `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1264` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×3
  • Duplicated block (22–23 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:484 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:484-506 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1149-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:484` 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 (22–23 lines × 2) pkg/front_end/lib/src/fragment/field/encoding.dart:1286 — pkg/front_end/lib/src/fragment/field/encoding.dart:1286-1307 | pkg/front_end/lib/src/fragment/field/encoding.dart:1570-1592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/field/encoding.dart:1286` it does not close everything it opens, so those 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 (22–23 lines × 2) pkg/front_end/lib/src/kernel/internal_ast.dart:7290 — pkg/front_end/lib/src/kernel/internal_ast.dart:7290-7312 | pkg/kernel/lib/src/ast/patterns.dart:835-856 — before extracting anything, compare `pkg/front_end/lib/src/kernel/internal_ast.dart` and `pkg/kernel/lib/src/ast/patterns.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 80 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 `pkg/front_end/lib/src/kernel/internal_ast.dart:7290` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×3
  • Duplicated block (20 lines × 4) pkg/front_end/lib/src/fragment/class/declaration.dart:69 — pkg/front_end/lib/src/fragment/class/declaration.dart:69-88 | pkg/front_end/lib/src/fragment/class/declaration.dart:135-154 | pkg/front_end/lib/src/fragment/class/declaration.dart:202-221 | pkg/front_end/lib/src/fragment/class/declaration.dart:323-342 — 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 (20 lines × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5557 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:5557-5576 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5645-5664 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5719-5738 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5856-5875 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:5557` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `StaticIncDec` in one and `SuperIncDec` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 4) sdk/lib/internal/internal.dart:537 — sdk/lib/internal/internal.dart:537-556 | sdk/lib/internal/internal.dart:579-598 | sdk/lib/internal/internal.dart:623-642 | sdk/lib/internal/internal.dart:669-688 — 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 `sdk/lib/internal/internal.dart:537` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×3
  • Duplicated block (13–16 lines × 2) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:70 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:70-85 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:73-85 — 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:70` 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–16 lines × 2) sdk/lib/_internal/vm/lib/growable_array.dart:50 — sdk/lib/_internal/vm/lib/growable_array.dart:50-65 | sdk/lib/_internal/wasm/common/list.dart:570-582 — 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 `sdk/lib/_internal/vm/lib/growable_array.dart:50` 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 `iterable` to `Iterable<T>` in one and `Iterable<E>` 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–16 lines × 2) sdk/lib/core/uri.dart:2282 — sdk/lib/core/uri.dart:2282-2297 | sdk/lib/core/uri.dart:4746-4758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/core/uri.dart:2282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×3
  • Duplicated block (14–16 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3000 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3000-3015 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3135-3148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:3000` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `TypeAliasedConstructorInvocation` in one and `TypeAliasedFactoryInvocation` 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–16 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8580 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8580-8595 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8786-8799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:8580` 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 `node` to `CompoundIndexSet` in one and `CompoundSuperIndexSet` 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–16 lines × 2) pkg/observatory/lib/src/elements/inbound_references.dart:102 — pkg/observatory/lib/src/elements/inbound_references.dart:102-117 | pkg/observatory/lib/src/elements/retaining_path.dart:105-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/inbound_references.dart:102` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×3
  • Duplicated block (12–13 lines × 3) pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:40 — pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:40-52 | pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart:47-59 | pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateless_widget.dart:39-50 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget_with_animation.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 `pkg/analysis_server/lib/src/services/snippets/dart/flutter_stateful_widget.dart:40` it does not close everything it opens, so those exact lines 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 × 3) pkg/analyzer/lib/src/dart/analysis/driver.dart:1809 — pkg/analyzer/lib/src/dart/analysis/driver.dart:1809-1821 | pkg/analyzer/lib/src/dart/analysis/driver.dart:1884-1896 | pkg/analyzer/lib/src/dart/analysis/driver.dart:2092-2103 — 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 `pkg/analyzer/lib/src/dart/analysis/driver.dart:1809` it does not close everything it opens, so those exact lines 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 × 3) pkg/analyzer/lib/src/summary2/bundle_reader.dart:253 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:253-265 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:454-465 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1064-1076 — 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 `pkg/analyzer/lib/src/summary2/bundle_reader.dart:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×3
  • Duplicated block (12 lines × 6) pkg/analyzer/lib/src/dart/ast/ast.dart:27912 — pkg/analyzer/lib/src/dart/ast/ast.dart:27912-27923 | pkg/analyzer/lib/src/dart/ast/ast.dart:28063-28074 | pkg/analyzer/lib/src/dart/ast/ast.dart:37372-37383 | pkg/analyzer/lib/src/dart/ast/ast.dart:40264-40275 | pkg/analyzer/lib/src/dart/ast/ast.dart:40500-40511 | pkg/analyzer/lib/src/dart/ast/ast.dart:58753-58764 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:27912` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 6) pkg/analyzer/tool/ast/generate.dart:398 — pkg/analyzer/tool/ast/generate.dart:398-409 | pkg/analyzer/tool/ast/generate.dart:475-486 | pkg/analyzer/tool/ast/generate.dart:552-563 | pkg/analyzer/tool/ast/generate.dart:634-645 | pkg/analyzer/tool/ast/generate.dart:727-738 | pkg/analyzer/tool/ast/generate.dart:894-905 — 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 `pkg/analyzer/tool/ast/generate.dart:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 6) pkg/analyzer/tool/ast/generate.dart:441 — pkg/analyzer/tool/ast/generate.dart:441-452 | pkg/analyzer/tool/ast/generate.dart:511-522 | pkg/analyzer/tool/ast/generate.dart:597-608 | pkg/analyzer/tool/ast/generate.dart:680-691 | pkg/analyzer/tool/ast/generate.dart:773-784 | pkg/analyzer/tool/ast/generate.dart:986-997 — 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 `pkg/analyzer/tool/ast/generate.dart:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×3
  • Duplicated block (10–12 lines × 3) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:56 — pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:56-67 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:118-127 | pkg/analysis_server/lib/src/services/correction/dart/add_missing_switch_cases.dart:157-166 — 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 `pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart: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.
  • Duplicated block (10–12 lines × 3) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:206 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:206-215 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:381-390 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:424-435 — 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 `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:206` it does not close everything it opens, so those 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–12 lines × 3) sdk/lib/_internal/vm/lib/mirrors_impl.dart:251 — sdk/lib/_internal/vm/lib/mirrors_impl.dart:251-260 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:348-357 | sdk/lib/_internal/vm/lib/mirrors_impl.dart:722-733 — 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 `sdk/lib/_internal/vm/lib/mirrors_impl.dart:722` it does not close everything it opens, so those 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 9) · ×3
  • Duplicated block (11 lines × 9) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart:119 — pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart:119-129 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_extension_member.dart:105-115 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_import.dart:145-155 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart:58-68 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart:60-70 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_local.dart:233-243 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart:139-149 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_type_parameter.dart:73-83 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart:161-171 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart` and `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart` 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. 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 (11 lines × 9) pkg/analyzer/lib/src/dart/ast/ast.dart:27908 — pkg/analyzer/lib/src/dart/ast/ast.dart:27908-27918 | pkg/analyzer/lib/src/dart/ast/ast.dart:29483-29493 | pkg/analyzer/lib/src/dart/ast/ast.dart:37368-37378 | pkg/analyzer/lib/src/dart/ast/ast.dart:40260-40270 | pkg/analyzer/lib/src/dart/ast/ast.dart:44711-44721 | pkg/analyzer/lib/src/dart/ast/ast.dart:54373-54383 | pkg/analyzer/lib/src/dart/ast/ast.dart:58749-58759 | pkg/analyzer/lib/src/dart/ast/ast.dart:59074-59084 | pkg/analyzer/lib/src/dart/ast/ast.dart:59396-59406 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:27908` it does not close everything it opens, so those exact lines 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 × 9) pkg/wasm_builder/lib/src/builder/instructions.dart:5764 — pkg/wasm_builder/lib/src/builder/instructions.dart:5764-5774 | pkg/wasm_builder/lib/src/builder/instructions.dart:5779-5789 | pkg/wasm_builder/lib/src/builder/instructions.dart:5794-5804 | pkg/wasm_builder/lib/src/builder/instructions.dart:5809-5819 | pkg/wasm_builder/lib/src/builder/instructions.dart:5824-5834 | pkg/wasm_builder/lib/src/builder/instructions.dart:5839-5849 | pkg/wasm_builder/lib/src/builder/instructions.dart:5854-5864 | pkg/wasm_builder/lib/src/builder/instructions.dart:5869-5879 | pkg/wasm_builder/lib/src/builder/instructions.dart:5974-5984 — 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×3
  • Duplicated block (7–9 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/client.dart:137 — pkg/dart_runtime_service/lib/src/io/devtools/client.dart:137-145 | pkg/dds/lib/src/devtools/client.dart:136-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 (7–9 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:459 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:459-465 | sdk/lib/_internal/js_runtime/lib/js_array.dart:560-568 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `test` to `bool Function(E)` in one and `bool Function(E element)` 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 × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:469 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:469-475 | sdk/lib/_internal/js_runtime/lib/js_array.dart:572-580 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `test` to `bool Function(E)` in one and `bool Function(E element)` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×3
  • Duplicated block (8 lines × 6) pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242 — pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242-249 | pkg/analysis_server/lib/src/protocol/protocol_internal.dart:286-293 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:497-504 | pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart:538-545 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:581-588 | pkg/analyzer_plugin/lib/src/protocol/protocol_internal.dart:621-628 — before extracting anything, compare `pkg/analysis_server/lib/src/protocol/protocol_internal.dart` and `pkg/analysis_server_client/lib/src/protocol/protocol_internal.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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 `pkg/analysis_server/lib/src/protocol/protocol_internal.dart:242` it does not close everything it opens, so those exact lines 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 × 6) pkg/linter/lib/src/rules/analyzer_v1_ast_use.dart:49 — pkg/linter/lib/src/rules/analyzer_v1_ast_use.dart:49-56 | pkg/linter/lib/src/rules/deprecated_member_use_from_same_package.dart:43-50 | pkg/linter/lib/src/rules/document_ignores.dart:30-37 | pkg/linter/lib/src/rules/eol_at_end_of_file.dart:26-33 | pkg/linter/lib/src/rules/lines_longer_than_80_chars.dart:40-47 | pkg/linter/lib/src/rules/unreachable_from_main.dart:37-44 — 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 6 call sites, so a change lands once.
  • Duplicated block (8 lines × 6) pkg/linter/lib/src/rules/dangling_library_doc_comments.dart:26 — pkg/linter/lib/src/rules/dangling_library_doc_comments.dart:26-33 | pkg/linter/lib/src/rules/directives_ordering.dart:77-84 | pkg/linter/lib/src/rules/file_names.dart:24-31 | pkg/linter/lib/src/rules/flutter_style_todos.dart:32-39 | pkg/linter/lib/src/rules/library_annotations.dart:27-34 | pkg/linter/lib/src/rules/library_private_types_in_public_api.dart:30-37 — 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 6 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/linter/lib/src/rules/flutter_style_todos.dart:42` calls `invalidTodo`, `startsWith` and `pkg/linter/lib/src/rules/file_names.dart:32` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×3
  • Duplicated block (7–8 lines × 2) pkg/analyzer/lib/src/dart/micro/utils.dart:613 — pkg/analyzer/lib/src/dart/micro/utils.dart:613-620 | pkg/analyzer/lib/src/dart/micro/utils.dart:639-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/micro/utils.dart:613` 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 `node` to `RedirectingConstructorInvocation` in one and `SuperConstructorInvocation` 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–8 lines × 2) pkg/analyzer/lib/src/utilities/string_search.dart:105 — pkg/analyzer/lib/src/utilities/string_search.dart:105-111 | pkg/analyzer/lib/src/utilities/string_search.dart:143-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 `pkg/analyzer/lib/src/utilities/string_search.dart:105` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) pkg/dart2wasm/lib/constants.dart:1067 — pkg/dart2wasm/lib/constants.dart:1067-1073 | pkg/dart2wasm/lib/constants.dart:1077-1084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/constants.dart:1077` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×3
  • Duplicated block (6 lines × 5) pkg/observatory/lib/src/elements/heap_map.dart:99 — pkg/observatory/lib/src/elements/heap_map.dart:99-104 | pkg/observatory/lib/src/elements/icdata_view.dart:91-96 | pkg/observatory/lib/src/elements/ports.dart:81-86 | pkg/observatory/lib/src/elements/sentinel_view.dart:68-73 | pkg/observatory/lib/src/elements/singletargetcache_view.dart:96-101 — before extracting anything, compare `pkg/observatory/lib/src/elements/icdata_view.dart` and `pkg/observatory/lib/src/elements/singletargetcache_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `pkg/observatory/lib/src/elements/heap_map.dart:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/observatory/lib/src/elements/ports.dart:87` calls `NavRefreshElement`, `listen`, `_refresh` and `pkg/observatory/lib/src/elements/sentinel_view.dart:74` 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 × 5) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_import.dart:138 — pkg/analysis_server/lib/src/services/refactoring/legacy/rename_import.dart:138-143 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart:51-56 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart:53-58 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_parameter.dart:132-137 | pkg/analysis_server/lib/src/services/refactoring/legacy/rename_type_parameter.dart:66-71 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_label.dart` and `pkg/analysis_server/lib/src/services/refactoring/legacy/rename_library.dart` 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. 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 (6 lines × 5) pkg/wasm_builder/lib/src/ir/function.dart:246 — pkg/wasm_builder/lib/src/ir/function.dart:246-251 | pkg/wasm_builder/lib/src/ir/global.dart:147-152 | pkg/wasm_builder/lib/src/ir/memory.dart:144-149 | pkg/wasm_builder/lib/src/ir/table.dart:132-137 | pkg/wasm_builder/lib/src/ir/tags.dart:15-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
IC1 · Incompleteness & stubs · Unfinished stub · ×3
  • Unfinished stub — throws UnimplementedError pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:880 — `lookupMemberTypeInternal` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:2442 — `assertInErrorRecovery` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws UnimplementedError pkg/dwds/lib/src/readers/frontend_server_asset_reader.dart:126 — `metadataContents` is a shipped member whose whole body throws UnimplementedError — scaffolding that was never completed. Implement it or remove the dead surface.
IC1 · Incompleteness & stubs · Hollow method · ×3
  • Hollow method — returns a constant without doing the work pkg/dev_compiler/lib/src/js_ast/template.dart:187 — `makeNull` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work pkg/front_end/testcases/extensions/explicit_extension_inference.dart:18 — `genericMethod1` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work pkg/front_end/testcases/extensions/implicit_extension_inference.dart:18 — `genericMethod1` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×3
  • Duplicated block (12 lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:868 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:868 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:902 — all 2 copies are in the same file, 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 (12 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:32 — runtime/tools/graphexplorer/graphexplorer.js:32 · runtime/tools/graphexplorer/graphexplorer.js:46 — both copies are in the same file, so extract the 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 locations) runtime/tools/graphexplorer/graphexplorer.js:1078 — runtime/tools/graphexplorer/graphexplorer.js:1078 · runtime/tools/graphexplorer/graphexplorer.js:1091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×3
  • Duplicated block (7 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:70 — runtime/tools/graphexplorer/graphexplorer.js:70 · runtime/tools/graphexplorer/graphexplorer.js:202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:981 — runtime/tools/graphexplorer/graphexplorer.js:981 · runtime/tools/graphexplorer/graphexplorer.js:994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:1878 — runtime/tools/graphexplorer/graphexplorer.js:1878 · runtime/tools/graphexplorer/graphexplorer.js:1887 — all 2 copies are in the same file, 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.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×3
  • Length read from the parsed input is spent without ever being bounded pkg/kernel/lib/binary/ast_from_binary.dart:1067 — `length` is read from the bytes being parsed at line 1064 (`readUint32`), then used to size a `List.filled` at line 1067 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded pkg/dart2native/lib/macho.dart:573 — `sectionCount` is read from the bytes being parsed at line 570 (`readUint32`), then used to size a `List.generate` at line 573 — and nowhere in its scope is `sectionCount` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `sectionCount` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded pkg/analyzer/lib/src/binary/binary_reader.dart:290 — `length` is read from the bytes being parsed at line 289 (`readUint32`), then used to size a `Uint32List` at line 290 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and an allocation the VM cannot satisfy throws `OutOfMemoryError` — an `Error`, not an `Exception`, so the `on FormatException` or `on Exception` handler a parser writes for malformed input does not catch it — while a negative length throws `RangeError` instead. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
AC3 · Page structure · Page without a main landmark · ×2
  • Page without a main landmark pkg/front_end/tool/benchmark_visualiser.html:1 — 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 pkg/vm_snapshot_analysis/lib/src/assets/index.html:6 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×2
  • Animation without a prefers-reduced-motion guard pkg/observatory/lib/src/elements/css/shared.css:414 — `.shake` moves (`animation: shake 0.5s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard pkg/observatory/lib/src/elements/css/shared.css:2175 — `.nav-exception > div` moves (`animation: fadein 1s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D1 · Cyclomatic Complexity · _BigIntImpl._binaryGcd (cyclomatic 77) · ×2
  • _BigIntImpl._binaryGcd (cyclomatic 77) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504 — _BigIntImpl._binaryGcd has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • _BigIntImpl._binaryGcd (cyclomatic 77) sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1523 — _BigIntImpl._binaryGcd has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cyclomatic 22) · ×2
  • AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cyclomatic 22) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1386 — AbstractScanner.tokenizeLanguageVersionOrSingleLineComment has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cyclomatic 22) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1826 — AbstractScanner.tokenizeLanguageVersionOrSingleLineComment has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AbstractScanner.tokenizeKeywordOrIdentifier (cyclomatic 17) · ×2
  • AbstractScanner.tokenizeKeywordOrIdentifier (cyclomatic 17) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1353 — AbstractScanner.tokenizeKeywordOrIdentifier has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • AbstractScanner.tokenizeKeywordOrIdentifier (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088 — AbstractScanner.tokenizeKeywordOrIdentifier has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parseStringEscape (cyclomatic 17) · ×2
  • _ChunkedJsonParser.parseStringEscape (cyclomatic 17) sdk/lib/_internal/vm/lib/convert_patch.dart:1191 — _ChunkedJsonParser.parseStringEscape has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • _ChunkedJsonParser.parseStringEscape (cyclomatic 17) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1069 — _ChunkedJsonParser.parseStringEscape has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · _BigIntImpl._binaryGcd (cognitive 181) · ×2
  • _BigIntImpl._binaryGcd (cognitive 181) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504 — _BigIntImpl._binaryGcd has cognitive complexity 181 (threshold 15). Drivers by points: if/else 62 (142 pts), boolean chains 24, loops 8 (14 pts), ternaries 1 (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • _BigIntImpl._binaryGcd (cognitive 181) sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1523 — _BigIntImpl._binaryGcd has cognitive complexity 181 (threshold 15). Drivers by points: if/else 62 (142 pts), boolean chains 24, loops 8 (14 pts), ternaries 1 (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.tokenizeMultiLineComment (cognitive 38) · ×2
  • AbstractScanner.tokenizeMultiLineComment (cognitive 38) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1513 — AbstractScanner.tokenizeMultiLineComment has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AbstractScanner.tokenizeMultiLineComment (cognitive 38) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964 — AbstractScanner.tokenizeMultiLineComment has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.tokenizeNumber (cognitive 35) · ×2
  • AbstractScanner.tokenizeNumber (cognitive 35) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1686 — AbstractScanner.tokenizeNumber has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (8 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AbstractScanner.tokenizeNumber (cognitive 35) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1531 — AbstractScanner.tokenizeNumber has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (8 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.tokenizeMultiLineString (cognitive 33) · ×2
  • AbstractScanner.tokenizeMultiLineString (cognitive 33) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1621 — AbstractScanner.tokenizeMultiLineString has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • AbstractScanner.tokenizeMultiLineString (cognitive 33) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2401 — AbstractScanner.tokenizeMultiLineString has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DevToolsServer._serveDevToolsWithArgs (cognitive 28) · ×2
  • DevToolsServer._serveDevToolsWithArgs (cognitive 28) pkg/dart_runtime_service_dds/lib/devtools_server.dart:547 — DevToolsServer._serveDevToolsWithArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, ternaries 5, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • DevToolsServer._serveDevToolsWithArgs (cognitive 28) pkg/dds/lib/devtools_server.dart:510 — DevToolsServer._serveDevToolsWithArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7, boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AsyncRewriterBase.visitSwitch (cognitive 26) · ×2
  • AsyncRewriterBase.visitSwitch (cognitive 26) pkg/compiler/lib/src/js/rewrite_async.dart:1571 — AsyncRewriterBase.visitSwitch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AsyncRewriterBase.visitSwitch (cognitive 26) pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1615 — AsyncRewriterBase.visitSwitch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.tokenizeMultiLineRawString (cognitive 24) · ×2
  • AbstractScanner.tokenizeMultiLineRawString (cognitive 24) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1575 — AbstractScanner.tokenizeMultiLineRawString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AbstractScanner.tokenizeMultiLineRawString (cognitive 24) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2351 — AbstractScanner.tokenizeMultiLineRawString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.tokenizeHex (cognitive 22) · ×2
  • AbstractScanner.tokenizeHex (cognitive 22) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1225 — AbstractScanner.tokenizeHex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AbstractScanner.tokenizeHex (cognitive 22) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1608 — AbstractScanner.tokenizeHex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cognitive 21) · ×2
  • AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cognitive 21) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1386 — AbstractScanner.tokenizeLanguageVersionOrSingleLineComment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AbstractScanner.tokenizeLanguageVersionOrSingleLineComment (cognitive 21) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1826 — AbstractScanner.tokenizeLanguageVersionOrSingleLineComment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AbstractScanner.tokenizeIdentifier (cognitive 20) · ×2
  • AbstractScanner.tokenizeIdentifier (cognitive 20) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1268 — AbstractScanner.tokenizeIdentifier has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AbstractScanner.tokenizeIdentifier (cognitive 20) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2123 — AbstractScanner.tokenizeIdentifier has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BazelUriConverter.uriToPath (cognitive 20) · ×2
  • BazelUriConverter.uriToPath (cognitive 20) pkg/dart_runtime_service_dds/lib/src/bazel_uri_converter.dart:46 — BazelUriConverter.uriToPath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BazelUriConverter.uriToPath (cognitive 20) pkg/dds/lib/src/bazel_uri_converter.dart:38 — BazelUriConverter.uriToPath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.discardBeginGroupUntil (cognitive 19) · ×2
  • AbstractScanner.discardBeginGroupUntil (cognitive 19) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:686 — AbstractScanner.discardBeginGroupUntil has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AbstractScanner.discardBeginGroupUntil (cognitive 19) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:733 — AbstractScanner.discardBeginGroupUntil has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseStringEscape (cognitive 19) · ×2
  • _ChunkedJsonParser.parseStringEscape (cognitive 19) sdk/lib/_internal/vm/lib/convert_patch.dart:1191 — _ChunkedJsonParser.parseStringEscape has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _ChunkedJsonParser.parseStringEscape (cognitive 19) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1069 — _ChunkedJsonParser.parseStringEscape has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.tokenizeSingleLineString (cognitive 18) · ×2
  • AbstractScanner.tokenizeSingleLineString (cognitive 18) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1852 — AbstractScanner.tokenizeSingleLineString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AbstractScanner.tokenizeSingleLineString (cognitive 18) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2197 — AbstractScanner.tokenizeSingleLineString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · int._parse (cognitive 18) · ×2
  • int._parse (cognitive 18) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:88 — int._parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • int._parse (cognitive 18) sdk/lib/_internal/wasm/common/int_patch.dart:52 — int._parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.visitBinaryExpression (cognitive 18) · ×2
  • _Visitor.visitBinaryExpression (cognitive 18) REDACTED:42 — _Visitor.visitBinaryExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _Visitor.visitBinaryExpression (cognitive 18) pkg/linter/lib/src/rules/use_is_even_rather_than_modulo.dart:37 — _Visitor.visitBinaryExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AbstractScanner.tokenizeKeywordOrIdentifier (cognitive 17) · ×2
  • AbstractScanner.tokenizeKeywordOrIdentifier (cognitive 17) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1353 — AbstractScanner.tokenizeKeywordOrIdentifier has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, loops 1. 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.
  • AbstractScanner.tokenizeKeywordOrIdentifier (cognitive 17) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:2088 — AbstractScanner.tokenizeKeywordOrIdentifier has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, loops 1. 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.
D2 · Cognitive Complexity · _Visitor.visitPrimaryConstructorDeclaration (cognitive 17) · ×2
  • _Visitor.visitPrimaryConstructorDeclaration (cognitive 17) pkg/linter/lib/src/rules/public_member_api_docs.dart:260 — _Visitor.visitPrimaryConstructorDeclaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _Visitor.visitPrimaryConstructorDeclaration (cognitive 17) pkg/linter/lib/src/rules/use_late_for_private_fields_and_variables.dart:170 — _Visitor.visitPrimaryConstructorDeclaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LinkedHashSetMixin._add (cognitive 16) · ×2
  • _LinkedHashSetMixin._add (cognitive 16) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1060 — _LinkedHashSetMixin._add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • _LinkedHashSetMixin._add (cognitive 16) sdk/lib/_internal/wasm/common/compact_hash.dart:980 — _LinkedHashSetMixin._add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncRewriterBase.visitTry (cognitive 16) · ×2
  • AsyncRewriterBase.visitTry (cognitive 16) pkg/compiler/lib/src/js/rewrite_async.dart:1715 — AsyncRewriterBase.visitTry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AsyncRewriterBase.visitTry (cognitive 16) pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1765 — AsyncRewriterBase.visitTry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication · Near-duplicate member pair (88 shared lines) · ×2
  • Near-duplicate member pair (88 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840-7086 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7088-7281 — These two members are variants of one another: 88 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.
  • Near-duplicate member pair (88 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840-7086 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7283-7553 — These two members are variants of one another: 88 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (14 members, 50+ identical tokens) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:132 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:132-180 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:242-284 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:575-613 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:623-670 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:692-739 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:787-826 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:833-869 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:876-910 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:942-991 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:998-1040 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1055-1097 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1203-1237 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1248-1282 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1389-1435 — 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.
  • Members sharing a duplicated core (14 members, 50+ identical tokens) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:155 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:155-164 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:199-205 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:231-240 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:275-281 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:170-179 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:214-220 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:258-267 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:302-308 | sdk/lib/_internal/wasm/common/simd.dart:24-33 | sdk/lib/_internal/wasm/common/simd.dart:64-70 | sdk/lib/_internal/wasm/common/simd.dart:128-137 | sdk/lib/_internal/wasm/common/simd.dart:168-174 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1708-1716 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2621-2629 — 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 (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) pkg/analyzer/lib/src/summary2/informative_data.dart:178 — pkg/analyzer/lib/src/summary2/informative_data.dart:178-205 | pkg/analyzer/lib/src/summary2/informative_data.dart:207-224 | pkg/analyzer/lib/src/summary2/informative_data.dart:279-306 | pkg/analyzer/lib/src/summary2/informative_data.dart:315-341 | pkg/analyzer/lib/src/summary2/informative_data.dart:343-370 | pkg/analyzer/lib/src/summary2/informative_data.dart:473-500 | pkg/analyzer/lib/src/summary2/informative_data.dart:523-534 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) pkg/observatory/lib/src/elements/heap_snapshot.dart:1234 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1234-1266 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1268-1297 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1299-1328 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1330-1348 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1350-1381 | pkg/observatory/lib/src/elements/process_snapshot.dart:499-516 | pkg/observatory/lib/src/elements/process_snapshot.dart:518-547 — These 7 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 7 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 7 times.
D4 · Code Duplication · Edited copy of a member (104 corresponding lines) · ×2
  • Edited copy of a member (104 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:1571 — pkg/compiler/lib/src/js/rewrite_async.dart:1571-1674 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1615-1726 — These two members are one piece of code written twice and then edited apart: 104 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (104 corresponding lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1869 — sdk/lib/_internal/vm/lib/convert_patch.dart:1869-1972 | sdk/lib/_internal/wasm/common/convert_patch.dart:2415-2534 — These two members are one piece of code written twice and then edited apart: 104 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (105 corresponding lines) · ×2
  • Edited copy of a member (105 corresponding lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:701 — pkg/dev_compiler/lib/src/js_ast/builder.dart:701-805 | pkg/js_ast/lib/src/builder.dart:619-729 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (105 corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:443 — pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:443-550 | pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:552-656 — These two members are one piece of code written twice and then edited apart: 105 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (84 corresponding lines) · ×2
  • Edited copy of a member (84 corresponding lines) pkg/compiler/lib/src/dump_info.dart:1828 — pkg/compiler/lib/src/dump_info.dart:1828-1911 | pkg/compiler/lib/src/dump_info.dart:1913-1999 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (84 corresponding lines) pkg/front_end/lib/src/type_inference/body_inference_context.dart:228 — pkg/front_end/lib/src/type_inference/body_inference_context.dart:228-311 | pkg/front_end/lib/src/type_inference/body_inference_context.dart:534-644 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (78 corresponding lines) · ×2
  • Edited copy of a member (78 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart:25 — pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart:25-102 | pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart:25-108 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (78 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:41 — pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart:41-124 | pkg/analysis_server/lib/src/lsp/handlers/code_actions/pubspec.dart:43-120 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:233 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:233-284 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:793-843 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (51 corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:22 — pkg/analysis_server/lib/src/lsp/handlers/commands/organize_imports.dart:22-72 | pkg/analysis_server/lib/src/lsp/handlers/commands/sort_members.dart:22-79 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (93 corresponding lines) · ×2
  • Edited copy of a member (93 corresponding lines) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:99 — pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:99-192 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:402-494 — These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (93 corresponding lines) pkg/test_runner/lib/src/process_queue.dart:683 — pkg/test_runner/lib/src/process_queue.dart:683-820 | pkg/test_runner/lib/src/process_queue.dart:822-914 — These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×2
  • Edited copy of a member (59 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:1296 — pkg/compiler/lib/src/js_model/element_map_impl.dart:1296-1354 | pkg/compiler/lib/src/kernel/element_map_impl.dart:979-1037 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (59 corresponding lines) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:342 — pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:342-403 | pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:809-867 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (77 corresponding lines) · ×2
  • Edited copy of a member (77 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3930 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3930-4006 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:4858-4950 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (77 corresponding lines) pkg/front_end/lib/src/source/builder_factory.dart:488 — pkg/front_end/lib/src/source/builder_factory.dart:488-575 | pkg/front_end/lib/src/source/builder_factory.dart:981-1057 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×2
  • Edited copy of a member (61 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1964-2034 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1513-1573 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (61 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:3655 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:3655-3729 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:3731-3791 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×2
  • Edited copy of a member (67 corresponding lines) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:40 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_with_plugin_that_times_out.dart:40-106 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_with_plugin_that_times_out.dart:40-107 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (67 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:9706 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:9706-9773 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9775-9841 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×2
  • Edited copy of a member (70 corresponding lines) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:307 — pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:307-376 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:378-464 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (70 corresponding lines) sdk/lib/_internal/vm/lib/async_patch.dart:583 — sdk/lib/_internal/vm/lib/async_patch.dart:583-660 | sdk/lib/_internal/wasm/common/sync_star_patch.dart:111-180 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×2
  • Edited copy of a member (52 corresponding lines) pkg/observatory/lib/src/sample_profile/sample_profile.dart:1233 — pkg/observatory/lib/src/sample_profile/sample_profile.dart:1233-1286 | pkg/observatory/lib/src/sample_profile/sample_profile.dart:1288-1339 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) pkg/analyzer/lib/src/fasta/ast_builder.dart:3342 — pkg/analyzer/lib/src/fasta/ast_builder.dart:3342-3393 | pkg/analyzer/lib/src/fasta/ast_builder.dart:6371-6438 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 32+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 32+ corresponding lines) pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:402 — pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:402-444 | pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:478-509 | pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart:678-721 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 32+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:229 — pkg/compiler/lib/src/js/size_estimator.dart:229-260 | pkg/dev_compiler/lib/src/js_ast/printer.dart:403-438 | pkg/js_ast/lib/src/printer.dart:482-517 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 30+ corresponding lines) pkg/analyzer/lib/src/summary2/element_builder.dart:2165 — pkg/analyzer/lib/src/summary2/element_builder.dart:2165-2195 | pkg/analyzer/lib/src/summary2/element_builder.dart:2197-2226 | pkg/analyzer/lib/src/summary2/element_builder.dart:2228-2257 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 30+ corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:1881 — pkg/analyzer/lib/src/fine/library_manifest.dart:1881-1910 | pkg/analyzer/lib/src/fine/library_manifest.dart:1912-1941 | pkg/analyzer/lib/src/fine/library_manifest.dart:1968-1997 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 34+ corresponding lines) pkg/front_end/lib/src/kernel/constant_collection_builders.dart:133 — pkg/front_end/lib/src/kernel/constant_collection_builders.dart:133-168 | pkg/front_end/lib/src/kernel/constant_collection_builders.dart:224-257 | pkg/front_end/lib/src/kernel/constant_collection_builders.dart:398-438 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 34+ corresponding lines) pkg/compiler/lib/src/ssa/codegen.dart:3809 — pkg/compiler/lib/src/ssa/codegen.dart:3809-3844 | pkg/compiler/lib/src/ssa/codegen.dart:3846-3879 | pkg/compiler/lib/src/ssa/codegen.dart:3881-3914 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 23+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 23+ corresponding lines) pkg/analyzer/lib/src/summary2/bundle_reader.dart:329 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:329-356 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:820-844 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:996-1026 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1164-1188 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1246-1268 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 23+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:43 — pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:43-68 | pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:75-97 | pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:116-152 | pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:161-186 | pkg/_fe_analyzer_shared/lib/src/metadata/scope.dart:193-218 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 22+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 22+ corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:2036 — pkg/analyzer/lib/src/dart/constant/value.dart:2036-2059 | pkg/analyzer/lib/src/dart/constant/value.dart:2125-2146 | pkg/analyzer/lib/src/dart/constant/value.dart:2313-2336 | pkg/analyzer/lib/src/dart/constant/value.dart:2346-2371 | pkg/analyzer/lib/src/dart/constant/value.dart:2413-2436 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 22+ corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5662 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5662-5683 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5685-5710 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5712-5739 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5741-5767 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5769-5793 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 29+ corresponding lines) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:721 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:721-751 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:753-782 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:810-838 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 29+ corresponding lines) pkg/front_end/lib/src/type_inference/type_schema_environment.dart:99 — pkg/front_end/lib/src/type_inference/type_schema_environment.dart:99-128 | pkg/front_end/lib/src/type_inference/type_schema_environment.dart:130-158 | pkg/kernel/lib/type_environment.dart:263-291 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 21+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 21+ corresponding lines) pkg/analyzer/lib/src/dart/constant/value.dart:1098 — pkg/analyzer/lib/src/dart/constant/value.dart:1098-1118 | pkg/analyzer/lib/src/dart/constant/value.dart:1128-1148 | pkg/analyzer/lib/src/dart/constant/value.dart:1294-1314 | pkg/analyzer/lib/src/dart/constant/value.dart:1324-1344 | pkg/analyzer/lib/src/dart/constant/value.dart:1346-1366 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 21+ corresponding lines) pkg/front_end/lib/src/source/fragment_factory_impl.dart:149 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:149-169 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:231-251 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:348-368 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:435-458 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:492-512 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 25+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:2456 — pkg/front_end/lib/src/kernel/expression_generator.dart:2456-2480 | pkg/front_end/lib/src/kernel/expression_generator.dart:2887-2913 | pkg/front_end/lib/src/kernel/expression_generator.dart:3360-3388 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 25+ corresponding lines) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:145 — pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:145-171 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:260-284 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:780-804 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 26+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 26+ corresponding lines) pkg/analyzer/lib/src/summary2/bundle_reader.dart:358 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:358-384 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:846-871 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1028-1057 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1190-1215 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1270-1296 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 26+ corresponding lines) pkg/front_end/lib/src/util/parser_ast_helper.dart:280 — pkg/front_end/lib/src/util/parser_ast_helper.dart:280-305 | pkg/front_end/lib/src/util/parser_ast_helper.dart:1366-1391 | pkg/front_end/lib/src/util/parser_ast_helper.dart:1922-1947 | pkg/front_end/lib/src/util/parser_ast_helper.dart:1970-1997 | pkg/front_end/lib/src/util/parser_ast_helper.dart:2418-2443 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 21+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:30261 — pkg/analyzer/lib/src/dart/ast/ast.dart:30261-30282 | pkg/analyzer/lib/src/dart/ast/ast.dart:30284-30304 | pkg/analyzer/lib/src/dart/ast/ast.dart:31055-31076 | pkg/analyzer/lib/src/dart/ast/ast.dart:31078-31098 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 21+ corresponding lines) pkg/front_end/lib/src/fragment/field/encoding.dart:987 — pkg/front_end/lib/src/fragment/field/encoding.dart:987-1007 | pkg/front_end/lib/src/fragment/field/encoding.dart:1050-1071 | pkg/front_end/lib/src/fragment/field/encoding.dart:1088-1111 | pkg/front_end/lib/src/fragment/field/encoding.dart:1117-1139 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 15+ corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:150 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:150-164 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:198-212 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:451-469 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:791-807 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1496-1514 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1914-1928 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 15+ corresponding lines) pkg/dartdev/lib/src/templates/cli.dart:10 — pkg/dartdev/lib/src/templates/cli.dart:10-24 | pkg/dartdev/lib/src/templates/console.dart:10-26 | pkg/dartdev/lib/src/templates/console_simple.dart:10-24 | pkg/dartdev/lib/src/templates/package.dart:10-27 | pkg/dartdev/lib/src/templates/server_shelf.dart:10-26 | pkg/dartdev/lib/src/templates/web.dart:12-28 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 19+ corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:226 — pkg/dev_compiler/lib/src/js_ast/template.dart:226-245 | pkg/dev_compiler/lib/src/js_ast/template.dart:274-292 | pkg/dev_compiler/lib/src/js_ast/template.dart:360-379 | pkg/js_ast/lib/src/template.dart:264-284 | pkg/js_ast/lib/src/template.dart:297-316 | pkg/js_ast/lib/src/template.dart:348-368 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 19+ corresponding lines) pkg/front_end/lib/src/type_inference/collection_encoding.dart:792 — pkg/front_end/lib/src/type_inference/collection_encoding.dart:792-810 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:812-830 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1501-1522 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:1575-1595 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:2120-2138 | pkg/front_end/lib/src/type_inference/collection_encoding.dart:2140-2158 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 16+ corresponding lines) pkg/analyzer/lib/src/binary/binary_reader.dart:255 — pkg/analyzer/lib/src/binary/binary_reader.dart:255-270 | pkg/compiler/lib/src/serialization/binary_source.dart:97-113 | pkg/dart2bytecode/lib/bytecode_serialization.dart:311-326 | pkg/dart2js_info/lib/src/binary/source.dart:254-270 | pkg/kernel/lib/binary/ast_from_binary.dart:217-232 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 16+ corresponding lines) pkg/analyzer/lib/src/fine/requirements.dart:1871 — pkg/analyzer/lib/src/fine/requirements.dart:1871-1886 | pkg/analyzer/lib/src/fine/requirements.dart:1888-1903 | pkg/analyzer/lib/src/fine/requirements.dart:1905-1920 | pkg/analyzer/lib/src/fine/requirements.dart:1922-1938 | pkg/analyzer/lib/src/fine/requirements.dart:2058-2073 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 18+ corresponding lines) pkg/dart2bytecode/lib/assembler.dart:314 — pkg/dart2bytecode/lib/assembler.dart:314-331 | pkg/dart2bytecode/lib/assembler.dart:333-350 | pkg/dart2bytecode/lib/assembler.dart:352-370 | pkg/dart2bytecode/lib/assembler.dart:372-390 | pkg/dart2bytecode/lib/assembler.dart:392-410 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 18+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2371 — pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2371-2391 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2504-2524 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2896-2913 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3001-3018 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3417-3434 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 17+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:20219 — pkg/analyzer/lib/src/dart/ast/ast.dart:20219-20236 | pkg/analyzer/lib/src/dart/ast/ast.dart:21397-21413 | pkg/analyzer/lib/src/dart/ast/ast.dart:29259-29277 | pkg/analyzer/lib/src/dart/ast/ast.dart:54153-54171 | pkg/analyzer/lib/src/dart/ast/ast.dart:58858-58875 | pkg/analyzer/lib/src/dart/ast/ast.dart:59183-59200 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 17+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2271 — pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2271-2292 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2808-2827 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2878-2894 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:2969-2988 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3020-3037 | pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3398-3415 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 17+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:25002 — pkg/analyzer/lib/src/dart/ast/ast.dart:25002-25018 | pkg/analyzer/lib/src/dart/ast/ast.dart:25482-25498 | pkg/analyzer/lib/src/dart/ast/ast.dart:56697-56714 | pkg/analyzer/lib/src/dart/ast/ast.dart:57648-57665 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 17+ corresponding lines) pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:796 — pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart:796-823 | pkg/analyzer/lib/src/fasta/ast_builder.dart:1762-1789 | pkg/front_end/lib/src/source/diet_listener.dart:357-373 | pkg/front_end/lib/src/util/textual_outline.dart:910-928 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 7+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:137 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:137-143 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:709-716 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1152-1159 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:100-108 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 7+ corresponding lines) sdk/lib/_internal/vm/lib/array.dart:114 — sdk/lib/_internal/vm/lib/array.dart:114-122 | sdk/lib/_internal/vm/lib/growable_array.dart:125-133 | sdk/lib/_internal/wasm/common/list.dart:203-212 | sdk/lib/_internal/wasm/common/list.dart:425-431 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 6+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:163 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:163-171 | sdk/lib/_internal/js_runtime/lib/js_string.dart:27-34 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:170-177 | sdk/lib/_internal/vm/lib/regexp_patch.dart:185-190 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) pkg/front_end/lib/src/kernel/type_builder_computer.dart:403 — pkg/front_end/lib/src/kernel/type_builder_computer.dart:403-411 | pkg/kernel/lib/src/bounds_checks.dart:1110-1115 | pkg/kernel/lib/src/dart_type_equivalence.dart:31-36 | pkg/kernel/lib/src/merge_visitor.dart:494-499 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×2
  • Edited copy of a member (1 corresponding lines) sdk/lib/_internal/js_runtime/lib/constant_map.dart:44 — sdk/lib/_internal/js_runtime/lib/constant_map.dart:44-44 | sdk/lib/collection/maps.dart:32-32 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:2158 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:2158-2158 | sdk/lib/_internal/wasm/common/simd.dart:573-573 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (97 lines × 2) · ×2
  • Duplicated block (97 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1826 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1826-1922 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1386-1482 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 (97 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2205 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2205-2301 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6045-6141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:2205` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionIfNullSet` in one and `IfNullPropertySet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (90 lines × 2) · ×2
  • Duplicated block (90 lines × 2) pkg/js_shared/lib/synced/recipe_syntax.dart:170 — pkg/js_shared/lib/synced/recipe_syntax.dart:170-259 | sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart:170-259 — before extracting anything, compare `pkg/js_shared/lib/synced/recipe_syntax.dart` and `sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 (90 lines × 2) pkg/front_end/testcases/general/getter_call.dart:27 — pkg/front_end/testcases/general/getter_call.dart:27-116 | pkg/front_end/testcases/implicit_getter_calls/getter_call.dart:27-116 — `pkg/front_end/testcases/general/getter_call.dart` and `pkg/front_end/testcases/implicit_getter_calls/getter_call.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 90 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 `pkg/front_end/testcases/general/getter_call.dart:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (61 lines × 2) · ×2
  • Duplicated block (61 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart:42 — pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart:42-102 | pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart:48-108 — 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 `pkg/analysis_server/lib/src/services/correction/dart/join_if_with_inner.dart:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (61 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2160 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2160-2220 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2460-2520 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:2160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×2
  • Duplicated block (57 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4665 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4665-4721 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5275-5331 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:4665` it does not close everything it opens, so those 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 (57 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6456 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6456-6512 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7145-7201 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×2
  • Duplicated block (55 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2061 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2061-2115 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2361-2415 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (55 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4052 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4052-4106 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4648-4702 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 · Duplicated block (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091-1139 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:429-477 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091` it does not close everything it opens, so those 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, `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1089` calls `skipSpaces` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:427` 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 (49 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5750 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:5750-5798 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5897-5945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:5750` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `PropertyIncDec` in one and `CompoundPropertySet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (46 lines × 2) · ×2
  • Duplicated block (46 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:1233 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1233-1278 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1526-1571 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (46 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5304 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5304-5349 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5914-5959 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5304` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×2
  • Duplicated block (42 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7060 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7060-7101 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7927-7968 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7060` it does not close everything it opens, so those exact lines 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) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6905 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6905-6946 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8517-8558 — both copies are in the same file, so extract the 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 `node` to `IfNullIndexSet` in one and `CompoundIndexSet` 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, `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6903` calls `getIndexSetValueType` and `pkg/front_end/lib/src/type_inference/inference_visitor.dart:8515` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×2
  • Duplicated block (37–38 lines × 2) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4010 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:4010-4047 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:4071-4107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_evaluator.dart:4010` it does not close everything it opens, so those 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 `node` to `DynamicInvocation` in one and `InstanceInvocation` 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 (37–38 lines × 2) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:317 — pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:317-353 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:406-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30 lines × 3) · ×2
  • Duplicated block (30 lines × 3) pkg/front_end/lib/src/source/source_method_builder.dart:335 — pkg/front_end/lib/src/source/source_method_builder.dart:335-364 | pkg/front_end/lib/src/source/source_property_builder.dart:659-688 | pkg/front_end/lib/src/source/source_property_builder.dart:805-834 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (30 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5555 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:5555-5584 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5643-5672 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:5717-5746 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:5555` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `StaticIncDec` in one and `SuperIncDec` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (29 lines × 4) · ×2
  • Duplicated block (29 lines × 4) pkg/front_end/testcases/general/lookup.dart:82 — pkg/front_end/testcases/general/lookup.dart:82-110 | pkg/front_end/testcases/general/lookup.dart:127-155 | pkg/front_end/testcases/general/lookup.dart:175-203 | pkg/front_end/testcases/general/lookup.dart:221-249 — 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 (29 lines × 4) pkg/front_end/testcases/general/lookup.dart:372 — pkg/front_end/testcases/general/lookup.dart:372-400 | pkg/front_end/testcases/general/lookup.dart:419-447 | pkg/front_end/testcases/general/lookup.dart:467-495 | pkg/front_end/testcases/general/lookup.dart:513-541 — 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×2
  • Duplicated block (28–29 lines × 2) pkg/dart_runtime_service_dds/lib/devtools_server.dart:662 — pkg/dart_runtime_service_dds/lib/devtools_server.dart:662-690 | pkg/dds/lib/devtools_server.dart:618-645 — 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 `pkg/dart_runtime_service_dds/lib/devtools_server.dart:662` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–29 lines × 2) pkg/front_end/lib/src/builder/type_parameter_builder.dart:286 — pkg/front_end/lib/src/builder/type_parameter_builder.dart:286-313 | pkg/front_end/lib/src/builder/type_parameter_builder.dart:545-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/builder/type_parameter_builder.dart:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×2
  • Duplicated block (25–26 lines × 2) pkg/compiler/lib/src/dump_info.dart:688 — pkg/compiler/lib/src/dump_info.dart:688-713 | pkg/compiler/lib/src/dump_info.dart:1501-1525 — both copies are in the same file, so extract the 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, `pkg/compiler/lib/src/dump_info.dart:715` calls `getFunctionType` and `pkg/compiler/lib/src/dump_info.dart:1527` 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 (25–26 lines × 2) pkg/front_end/lib/src/kernel/internal_ast.dart:7770 — pkg/front_end/lib/src/kernel/internal_ast.dart:7770-7795 | pkg/kernel/lib/src/ast/statements.dart:1292-1316 — 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 `pkg/front_end/lib/src/kernel/internal_ast.dart:7770` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–25 lines × 2) · ×2
  • Duplicated block (19–25 lines × 2) pkg/analyzer/tool/ast/generate.dart:233 — pkg/analyzer/tool/ast/generate.dart:233-257 | pkg/analyzer/tool/ast/generate.dart:1212-1230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/ast/generate.dart:233` it does not close everything it opens, so those exact lines 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–25 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:10159 — pkg/front_end/lib/src/kernel/body_builder.dart:10159-10183 | pkg/front_end/lib/src/kernel/body_builder.dart:10498-10516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:10159` 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.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×2
  • Duplicated block (22–24 lines × 2) pkg/analyzer/lib/src/error/element_usage_detector.dart:433 — pkg/analyzer/lib/src/error/element_usage_detector.dart:433-454 | pkg/analyzer/lib/src/error/element_usage_detector.dart:914-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/element_usage_detector.dart:433` it does not close everything it opens, so those 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–24 lines × 2) pkg/dart2wasm/lib/transformers.dart:1308 — pkg/dart2wasm/lib/transformers.dart:1308-1331 | pkg/dart2wasm/lib/transformers.dart:1465-1486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×2
  • Duplicated block (23 lines × 3) pkg/analyzer/lib/src/summary2/bundle_reader.dart:494 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:494-516 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:649-671 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1105-1127 — 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 `pkg/analyzer/lib/src/summary2/bundle_reader.dart:494` 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 × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2273 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2273-2295 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6113-6135 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6232-6254 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:2273` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `IfNullPropertySet` in one and `IfNullSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) pkg/analysis_server/tool/code_completion/completion_metrics.dart:810 — pkg/analysis_server/tool/code_completion/completion_metrics.dart:810-830 | REDACTED:489-507 — 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 `pkg/analysis_server/tool/code_completion/completion_metrics.dart:810` it does not close everything it opens, so those exact lines 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–21 lines × 2) pkg/front_end/lib/src/kernel/constant_evaluator.dart:1773 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:1773-1791 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:1882-1902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_evaluator.dart:1882` 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 `node` to `PatternVariableDeclaration` in one and `PatternAssignment` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/front_end/lib/src/kernel/constant_evaluator.dart:1905` calls `createExpressionStatement` and `pkg/front_end/lib/src/kernel/constant_evaluator.dart:1792` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×2
  • Duplicated block (18–19 lines × 3) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:264 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:264-282 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:301-319 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:369-386 — 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 `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:319` calls `delayed`, `Duration`, `send` and `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:282` 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 (18–19 lines × 3) sdk/lib/_internal/vm/lib/math_patch.dart:297 — sdk/lib/_internal/vm/lib/math_patch.dart:297-314 | sdk/lib/_internal/wasm/js_common/math_externs_patch.dart:120-138 | sdk/lib/_internal/wasm/standalone/math_externs_patch.dart:71-89 — 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 `sdk/lib/_internal/vm/lib/math_patch.dart:297` 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.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) pkg/analyzer/lib/src/generated/error_verifier.dart:1983 — pkg/analyzer/lib/src/generated/error_verifier.dart:1983-2000 | pkg/analyzer/lib/src/generated/error_verifier.dart:2018-2035 | pkg/analyzer/lib/src/generated/error_verifier.dart:2044-2061 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `covariant ReceiverMethodInvocationImpl` in one and `covariant ReceiverPropertyAssignmentTargetImpl` 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, `pkg/analyzer/lib/src/generated/error_verifier.dart:2043` calls `checkNameExpression` and `pkg/analyzer/lib/src/generated/error_verifier.dart:1982` 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 × 3) pkg/wasm_builder/lib/src/serialize/sections.dart:1184 — pkg/wasm_builder/lib/src/serialize/sections.dart:1184-1201 | pkg/wasm_builder/lib/src/serialize/sections.dart:1236-1253 | pkg/wasm_builder/lib/src/serialize/sections.dart:1292-1309 — 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 `pkg/wasm_builder/lib/src/serialize/sections.dart:1184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:964 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:964-981 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1164-1179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:964` 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 (16–18 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:100 — pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:100-117 | pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:148-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:100` 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.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×2
  • Duplicated block (13–17 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:241 — pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:241-257 | pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart:280-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/surround_with.dart: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 (13–17 lines × 2) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2052 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2052-2068 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:3471-3483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2052` 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.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×2
  • Duplicated block (16 lines × 6) pkg/front_end/lib/src/fragment/getter/encoding.dart:434 — pkg/front_end/lib/src/fragment/getter/encoding.dart:434-449 | pkg/front_end/lib/src/fragment/getter/encoding.dart:763-778 | pkg/front_end/lib/src/fragment/method/encoding.dart:366-381 | pkg/front_end/lib/src/fragment/method/encoding.dart:746-761 | pkg/front_end/lib/src/fragment/setter/encoding.dart:454-469 | pkg/front_end/lib/src/fragment/setter/encoding.dart:811-826 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (16 lines × 6) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6915 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6915-6930 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7126-7141 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7386-7401 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8527-8542 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8736-8751 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8994-9009 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6915` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×2
  • Duplicated block (16 lines × 5) pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:31 — pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:31-46 | pkg/analysis_server/lib/src/services/snippets/dart/for_in_statement.dart:34-49 | pkg/analysis_server/lib/src/services/snippets/dart/function_declaration.dart:35-50 | pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart:31-46 | pkg/analysis_server/lib/src/services/snippets/dart/test_group_definition.dart:33-48 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:31` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/lib/src/services/snippets/dart/for_in_statement.dart:31` calls `write`, `addSimpleLinkedEdit` and `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:29` 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 lines × 5) pkg/analyzer/lib/src/lint/pub.dart:331 — pkg/analyzer/lib/src/lint/pub.dart:331-346 | pkg/analyzer/lib/src/summary2/informative_data.dart:654-669 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1048-1065 | pkg/front_end/lib/src/kernel/resolver.dart:1482-1497 | pkg/front_end/lib/src/source/source_compilation_unit.dart:215-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/lint/pub.dart:331` 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, `pkg/analyzer/lib/src/summary2/informative_data.dart:653` calls `_getDocumentationComment` and `pkg/front_end/lib/src/fragment/constructor/encoding.dart:1047` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:22369 — pkg/analyzer/lib/src/dart/ast/ast.dart:22369-22384 | pkg/analyzer/lib/src/dart/ast/ast.dart:24347-24362 | pkg/analyzer/lib/src/dart/ast/ast.dart:52675-52690 | pkg/analyzer/lib/src/dart/ast/ast.dart:56334-56349 — 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 (16 lines × 4) pkg/front_end/lib/src/fragment/constructor/encoding.dart:225 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:225-240 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:274-289 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:930-945 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1028-1043 — 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 `pkg/front_end/lib/src/fragment/constructor/encoding.dart:225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×2
  • Duplicated block (14–15 lines × 3) pkg/analyzer/lib/src/dart/element/element.dart:1062 — pkg/analyzer/lib/src/dart/element/element.dart:1062-1076 | pkg/analyzer/lib/src/dart/element/element.dart:9173-9186 | pkg/analyzer/lib/src/dart/element/element.dart:11058-11071 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `fragments` to `List<ConstructorFragmentImpl>` in one and `List<MethodFragmentImpl>` 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–15 lines × 3) pkg/analyzer/lib/src/summary2/metadata_resolver.dart:72 — pkg/analyzer/lib/src/summary2/metadata_resolver.dart:72-85 | pkg/analyzer/lib/src/summary2/metadata_resolver.dart:112-125 | pkg/analyzer/lib/src/summary2/metadata_resolver.dart:153-167 — 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 `pkg/analyzer/lib/src/summary2/metadata_resolver.dart:153` 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 `node` to `covariant ClassDeclaration2Impl` in one and `covariant EnumDeclaration2Impl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×2
  • Duplicated block (13–15 lines × 2) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:127 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:127-139 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:216-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:127` 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 (13–15 lines × 2) pkg/test_runner/lib/src/runtime_configuration.dart:218 — pkg/test_runner/lib/src/runtime_configuration.dart:218-232 | pkg/test_runner/lib/src/runtime_configuration.dart:293-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/test_runner/lib/src/runtime_configuration.dart:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×2
  • Duplicated block (13–14 lines × 3) pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:37 — pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:37-50 | pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart:31-43 | pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart:30-42 — before extracting anything, compare `pkg/analysis_server/lib/src/lsp/handlers/handler_format_range.dart` and `pkg/analysis_server/lib/src/lsp/handlers/handler_formatting.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `pkg/analysis_server/lib/src/lsp/handlers/handler_format_on_type.dart:37` 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 (13–14 lines × 3) pkg/analyzer/lib/src/summary2/bundle_writer.dart:139 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:139-152 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:265-277 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:662-674 — 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 `pkg/analyzer/lib/src/summary2/bundle_writer.dart:139` it does not close everything it opens, so those 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 `elements` to `List<ClassElementImpl>` in one and `List<EnumElementImpl>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×2
  • Duplicated block (12 lines × 5) pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:95 — pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:95-106 | pkg/analysis_server/lib/src/services/refactoring/add_import_prefix.dart:101-112 | pkg/analysis_server/lib/src/services/refactoring/extract_method.dart:77-88 | pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart:78-89 | pkg/analysis_server/lib/src/services/refactoring/remove_import_prefix.dart:50-61 — before extracting anything, compare `pkg/analysis_server/lib/src/services/refactoring/extract_method.dart` and `pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:95` 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 (12 lines × 5) pkg/analyzer/lib/src/dart/ast/ast.dart:14626 — pkg/analyzer/lib/src/dart/ast/ast.dart:14626-14637 | pkg/analyzer/lib/src/dart/ast/ast.dart:22462-22473 | pkg/analyzer/lib/src/dart/ast/ast.dart:52768-52779 | pkg/analyzer/lib/src/dart/ast/ast.dart:56427-56438 | pkg/analyzer/lib/src/dart/ast/ast.dart:62931-62942 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:14626` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×2
  • Duplicated block (11–12 lines × 3) pkg/compiler/lib/src/ir/scope_visitor.dart:1140 — pkg/compiler/lib/src/ir/scope_visitor.dart:1140-1150 | pkg/compiler/lib/src/ir/scope_visitor.dart:1168-1179 | pkg/compiler/lib/src/ir/scope_visitor.dart:1186-1197 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ir.InstanceInvocation` in one and `ir.InstanceGetterInvocation` 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–12 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7052 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7052-7062 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7257-7268 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7525-7536 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:7052` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×2
  • Duplicated block (11 lines × 7) pkg/analyzer/lib/src/dart/ast/ast.dart:14641 — pkg/analyzer/lib/src/dart/ast/ast.dart:14641-14651 | pkg/analyzer/lib/src/dart/ast/ast.dart:22487-22497 | pkg/analyzer/lib/src/dart/ast/ast.dart:22843-22853 | pkg/analyzer/lib/src/dart/ast/ast.dart:37874-37884 | pkg/analyzer/lib/src/dart/ast/ast.dart:52793-52803 | pkg/analyzer/lib/src/dart/ast/ast.dart:56452-56462 | pkg/analyzer/lib/src/dart/ast/ast.dart:60107-60117 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:14641` it does not close everything it opens, so those exact lines 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 × 7) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461-2472 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8659-8669 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8681-8692 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8859-8869 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8881-8892 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9127-9137 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9151-9162 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:2461` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×2
  • Duplicated block (11 lines × 6) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1230 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1230-1240 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1351-1361 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1477-1487 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1601-1611 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1795-1805 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1899-1909 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 6) pkg/kernel/lib/src/ast/constants.dart:131 — pkg/kernel/lib/src/ast/constants.dart:131-141 | pkg/kernel/lib/src/ast/expressions.dart:226-236 | pkg/kernel/lib/src/ast/functions.dart:54-64 | pkg/kernel/lib/src/ast/functions.dart:151-161 | pkg/kernel/lib/src/ast/functions.dart:246-256 | pkg/kernel/lib/src/ast/types.dart:261-271 — before extracting anything, compare `pkg/kernel/lib/src/ast/constants.dart` and `pkg/kernel/lib/src/ast/expressions.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) pkg/analyzer/lib/src/summary2/element_builder.dart:1636 — pkg/analyzer/lib/src/summary2/element_builder.dart:1636-1645 | pkg/analyzer/lib/src/summary2/element_builder.dart:1669-1678 | pkg/analyzer/lib/src/summary2/element_builder.dart:1838-1848 — 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 `pkg/analyzer/lib/src/summary2/element_builder.dart:1636` it does not close everything it opens, so those 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 `node` to `covariant ExtensionDeclaration2Impl` in one and `covariant ExtensionTypeDeclaration2Impl` 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 (10–11 lines × 3) pkg/observatory/lib/src/elements/field_view.dart:169 — pkg/observatory/lib/src/elements/field_view.dart:169-178 | pkg/observatory/lib/src/elements/function_view.dart:152-161 | pkg/observatory/lib/src/elements/instance_view.dart:170-180 — before extracting anything, compare `pkg/observatory/lib/src/elements/field_view.dart` and `pkg/observatory/lib/src/elements/function_view.dart` 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 `pkg/observatory/lib/src/elements/field_view.dart:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×2
  • Duplicated block (8 lines × 7) pkg/analyzer/lib/src/summary2/informative_data.dart:181 — pkg/analyzer/lib/src/summary2/informative_data.dart:181-189 | pkg/analyzer/lib/src/summary2/informative_data.dart:210-218 | pkg/analyzer/lib/src/summary2/informative_data.dart:282-290 | pkg/analyzer/lib/src/summary2/informative_data.dart:318-326 | pkg/analyzer/lib/src/summary2/informative_data.dart:346-354 | pkg/analyzer/lib/src/summary2/informative_data.dart:476-484 | pkg/analyzer/lib/src/summary2/informative_data.dart:524-531 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/summary2/informative_data.dart:181` 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 `info` to `_InfoClassDeclaration` in one and `_InfoClassTypeAlias` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analyzer/lib/src/summary2/informative_data.dart:294` calls `_applyToConstructors` and `pkg/analyzer/lib/src/summary2/informative_data.dart:330` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 7) pkg/linter/lib/src/rules/avoid_function_literals_in_foreach_calls.dart:52 — pkg/linter/lib/src/rules/avoid_function_literals_in_foreach_calls.dart:52-59 | pkg/linter/lib/src/rules/avoid_print.dart:26-33 | pkg/linter/lib/src/rules/avoid_slow_async_io.dart:33-40 | pkg/linter/lib/src/rules/prefer_inlined_adds.dart:26-33 | pkg/linter/lib/src/rules/prefer_iterable_whereType.dart:25-32 | pkg/linter/lib/src/rules/prefer_spread_collections.dart:23-30 | pkg/linter/lib/src/rules/unnecessary_unawaited.dart:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×2
  • Duplicated block (7–8 lines × 4) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7116 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7116-7122 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7356-7363 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8068-8075 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8091-8098 — 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 `pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7116` it does not close everything it opens, so those exact lines 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 × 4) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:91 — pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:91-98 | pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:120-126 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:710-716 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:732-738 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:91` 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:785 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:785-791 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1751-1757 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2277-2283 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2663-2672 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2752-2761 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:785` it does not close everything it opens, so those exact lines 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 × 5) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:525 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:525-531 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:610-616 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:646-652 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:668-674 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:858-864 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:525` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `fragment` to `ClassFragmentImpl` in one and `EnumFragmentImpl` 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, `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:523` calls `where`, `toList` and `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:645` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:598 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:598-602 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:282-286 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:500-504 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:521-525 — before extracting anything, compare `sdk/lib/_internal/js_runtime/lib/collection_patch.dart` and `sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart` as WHOLE FILES: this scan already matched 8 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. 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 `sdk/lib/_internal/js_runtime/lib/collection_patch.dart:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 4) pkg/analyzer_plugin/lib/plugin/folding_mixin.dart:20 — pkg/analyzer_plugin/lib/plugin/folding_mixin.dart:20-24 | pkg/analyzer_plugin/lib/plugin/highlights_mixin.dart:20-24 | pkg/analyzer_plugin/lib/plugin/occurrences_mixin.dart:20-24 | pkg/analyzer_plugin/lib/plugin/outline_mixin.dart:20-24 — 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 4 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:3190 — pkg/dev_compiler/lib/src/kernel/compiler.dart:3190-3229 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3705-3744 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 (40 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:4898 — pkg/dev_compiler/lib/src/kernel/compiler.dart:4898-4937 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5508-5547 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 · Duplicated block (8 lines × 9) · ×2
  • Duplicated block (8 lines × 9) pkg/linter/lib/src/rules/avoid_equals_and_hash_code_on_mutable_classes.dart:33 — pkg/linter/lib/src/rules/avoid_equals_and_hash_code_on_mutable_classes.dart:33-40 | pkg/linter/lib/src/rules/avoid_null_checks_in_equality_operators.dart:54-61 | pkg/linter/lib/src/rules/avoid_returning_this.dart:28-35 | pkg/linter/lib/src/rules/no_logic_in_create_state.dart:24-31 | pkg/linter/lib/src/rules/prefer_constructors_over_static_methods.dart:33-40 | pkg/linter/lib/src/rules/unnecessary_overrides.dart:28-35 | pkg/linter/lib/src/rules/use_setters_to_change_properties.dart:32-39 | pkg/linter/lib/src/rules/use_to_and_as_if_applicable.dart:35-42 | pkg/linter/tool/checks/rules/visit_registered_nodes.dart:27-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times.
  • Duplicated block (8 lines × 9) pkg/linter/lib/src/rules/avoid_unnecessary_containers.dart:25 — pkg/linter/lib/src/rules/avoid_unnecessary_containers.dart:25-33 | pkg/linter/lib/src/rules/sized_box_for_whitespace.dart:24-32 | pkg/linter/lib/src/rules/sized_box_shrink_expand.dart:26-34 | pkg/linter/lib/src/rules/sort_child_properties_last.dart:24-31 | pkg/linter/lib/src/rules/unnecessary_new.dart:27-34 | pkg/linter/lib/src/rules/use_colored_box.dart:25-33 | pkg/linter/lib/src/rules/use_decorated_box.dart:24-32 | pkg/linter/lib/src/rules/use_full_hex_values_for_flutter_colors.dart:30-37 | pkg/linter/lib/src/rules/valid_regexps.dart:23-30 — 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 9 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/linter/lib/src/rules/use_full_hex_values_for_flutter_colors.dart:41` calls `RegExp` and `pkg/linter/lib/src/rules/avoid_unnecessary_containers.dart:37` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×2
  • Duplicated block (6 lines × 6) pkg/smith/lib/configuration.dart:814 — pkg/smith/lib/configuration.dart:814-819 | pkg/smith/lib/configuration.dart:984-989 | pkg/smith/lib/configuration.dart:1036-1041 | pkg/smith/lib/configuration.dart:1068-1073 | pkg/smith/lib/configuration.dart:1103-1108 | pkg/test_runner/lib/src/configuration.dart:641-646 — 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. 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 × 6) pkg/compiler/tool/modular_test_suite_helper.dart:268 — pkg/compiler/tool/modular_test_suite_helper.dart:268-274 | pkg/compiler/tool/modular_test_suite_helper.dart:330-336 | pkg/compiler/tool/modular_test_suite_helper.dart:385-391 | pkg/compiler/tool/modular_test_suite_helper.dart:451-456 | pkg/compiler/tool/modular_test_suite_helper.dart:514-519 | pkg/compiler/tool/modular_test_suite_helper.dart:579-584 — 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 `pkg/compiler/tool/modular_test_suite_helper.dart:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) REDACTED:1705 — REDACTED:1705 · REDACTED:1736 — all 2 copies are in the same file, 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 (22 lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:443 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:443 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:609 — all 2 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) REDACTED:711 — REDACTED:711 · REDACTED:750 — all 2 copies are in the same file, 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 (10 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:144 — runtime/tools/graphexplorer/graphexplorer.js:144 · runtime/tools/graphexplorer/graphexplorer.js:299 — all 2 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×2
  • Duplicated block (9 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:341 — runtime/tools/graphexplorer/graphexplorer.js:341 · runtime/tools/graphexplorer/graphexplorer.js:359 — all 2 copies are in the same file, 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) runtime/tools/graphexplorer/graphexplorer.js:392 — runtime/tools/graphexplorer/graphexplorer.js:392 · runtime/tools/graphexplorer/graphexplorer.js:796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.4 · ×1
  • Low contrast colour pair in CSS (4.4:1) runtime/tools/wiki/styles/style.scss:317 — `& .gi` sets color: #22863a on background-color: #f0fff4 — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.9 · ×1
  • Low contrast colour pair in CSS (3.9:1) pkg/observatory/lib/src/elements/css/shared.css:2049 — `nav.nav-bar > ul` sets color: white on background-color: #0489c3 — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · Intrinsifier.generateStaticIntrinsic (cyclomatic 409) · ×1
  • Intrinsifier.generateStaticIntrinsic (cyclomatic 409) pkg/dart2wasm/lib/intrinsics.dart:1355 — Intrinsifier.generateStaticIntrinsic has cyclomatic complexity 409 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Instruction.deserialize (cyclomatic 241) · ×1
  • Instruction.deserialize (cyclomatic 241) pkg/wasm_builder/lib/src/ir/instruction.dart:87 — Instruction.deserialize has cyclomatic complexity 241 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Types.performSubtypeCheck (cyclomatic 195) · ×1
  • Types.performSubtypeCheck (cyclomatic 195) pkg/kernel/lib/src/types.dart:65 — Types.performSubtypeCheck has cyclomatic complexity 195 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LogSanitizer._sanitizeParams (cyclomatic 134) · ×1
  • LogSanitizer._sanitizeParams (cyclomatic 134) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:675 — LogSanitizer._sanitizeParams has cyclomatic complexity 134 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _HttpParser._doParse (cyclomatic 127) · ×1
  • _HttpParser._doParse (cyclomatic 127) sdk/lib/_http/http_parser.dart:486 — _HttpParser._doParse has cyclomatic complexity 127 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RequirementsManifest.isSatisfied (cyclomatic 115) · ×1
  • RequirementsManifest.isSatisfied (cyclomatic 115) pkg/analyzer/lib/src/fine/requirements.dart:1004 — RequirementsManifest.isSatisfied has cyclomatic complexity 115 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImpactData.apply (cyclomatic 100) · ×1
  • ImpactData.apply (cyclomatic 100) pkg/compiler/lib/src/ir/impact_data.dart:1438 — ImpactData.apply has cyclomatic complexity 100 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _Visitor.visitParenthesizedExpression (cyclomatic 94) · ×1
  • _Visitor.visitParenthesizedExpression (cyclomatic 94) pkg/linter/lib/src/rules/unnecessary_parenthesis.dart:56 — _Visitor.visitParenthesizedExpression has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.resolveAndBuildConstructorInvocation (cyclomatic 92) · ×1
  • BodyBuilderImpl.resolveAndBuildConstructorInvocation (cyclomatic 92) pkg/front_end/lib/src/kernel/body_builder.dart:9991 — BodyBuilderImpl.resolveAndBuildConstructorInvocation has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (cyclomatic 90) · ×1
  • Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (cyclomatic 90) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5281 — Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseFormalParameter (cyclomatic 85) · ×1
  • Parser.parseFormalParameter (cyclomatic 85) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:2033 — Parser.parseFormalParameter has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubtypeHelper._isSubtypeOf (cyclomatic 85) · ×1
  • SubtypeHelper._isSubtypeOf (cyclomatic 85) pkg/analyzer/lib/src/dart/element/subtype.dart:262 — SubtypeHelper._isSubtypeOf has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceClassBuilder.checkSupertypes (cyclomatic 85) · ×1
  • SourceClassBuilder.checkSupertypes (cyclomatic 85) pkg/front_end/lib/src/source/source_class_builder.dart:731 — SourceClassBuilder.checkSupertypes has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.processLookupResult (cyclomatic 83) · ×1
  • BodyBuilderImpl.processLookupResult (cyclomatic 83) pkg/front_end/lib/src/kernel/body_builder.dart:9220 — BodyBuilderImpl.processLookupResult has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler.visitStaticInvocation (cyclomatic 82) · ×1
  • LibraryCompiler.visitStaticInvocation (cyclomatic 82) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7395 — LibraryCompiler.visitStaticInvocation has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FfiUseSiteTransformer._visitStaticInvocation (cyclomatic 81) · ×1
  • _FfiUseSiteTransformer._visitStaticInvocation (cyclomatic 81) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:359 — _FfiUseSiteTransformer._visitStaticInvocation has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartTypes._subtypeHelper (cyclomatic 81) · ×1
  • DartTypes._subtypeHelper (cyclomatic 81) pkg/compiler/lib/src/elements/types.dart:1949 — DartTypes._subtypeHelper has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StandardBounds.getStandardUpperBoundInternal (cyclomatic 81) · ×1
  • StandardBounds.getStandardUpperBoundInternal (cyclomatic 81) pkg/kernel/lib/src/standard_bounds.dart:593 — StandardBounds.getStandardUpperBoundInternal has cyclomatic complexity 81 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StandardBounds.getStandardLowerBoundInternal (cyclomatic 80) · ×1
  • StandardBounds.getStandardLowerBoundInternal (cyclomatic 80) pkg/kernel/lib/src/standard_bounds.dart:268 — StandardBounds.getStandardLowerBoundInternal has cyclomatic complexity 80 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · V1Projection._toV1Expression (cyclomatic 78) · ×1
  • V1Projection._toV1Expression (cyclomatic 78) pkg/analyzer/lib/src/dart/ast/ast.dart:62253 — V1Projection._toV1Expression has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator.visitBinaryExpression (cyclomatic 78) · ×1
  • ConstantEvaluator.visitBinaryExpression (cyclomatic 78) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:116 — ConstantEvaluator.visitBinaryExpression has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed (cyclomatic 78) · ×1
  • RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed (cyclomatic 78) pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart:1075 — RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler.visitStaticInvocation (cyclomatic 78) · ×1
  • ProgramCompiler.visitStaticInvocation (cyclomatic 78) pkg/dev_compiler/lib/src/kernel/compiler.dart:6706 — ProgramCompiler.visitStaticInvocation has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Type.generate (cyclomatic 77) · ×1
  • Type.generate (cyclomatic 77) pkg/vm_service/tool/dart/generate_dart_common.dart:571 — Type.generate has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _BigIntImpl._binaryGcd (cyclomatic 76) · ×1
  • _BigIntImpl._binaryGcd (cyclomatic 76) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2112 — _BigIntImpl._binaryGcd has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseMethod (cyclomatic 76) · ×1
  • Parser.parseMethod (cyclomatic 76) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5807 — Parser.parseMethod has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeUseGenerator.buildSelectorAccess (cyclomatic 76) · ×1
  • TypeUseGenerator.buildSelectorAccess (cyclomatic 76) pkg/front_end/lib/src/kernel/expression_generator.dart:4693 — TypeUseGenerator.buildSelectorAccess has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Processor.calculate (cyclomatic 74) · ×1
  • _Processor.calculate (cyclomatic 74) pkg/front_end/lib/src/util/outline_extractor.dart:309 — _Processor.calculate has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VmServerConnection._delegateRequest (cyclomatic 74) · ×1
  • VmServerConnection._delegateRequest (cyclomatic 74) pkg/vm_service_interface/lib/src/vm_service_interface.dart:1403 — VmServerConnection._delegateRequest 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.
D1 · Cyclomatic Complexity · ConstantEvaluator._handleInvocation (cyclomatic 73) · ×1
  • ConstantEvaluator._handleInvocation (cyclomatic 73) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4300 — ConstantEvaluator._handleInvocation has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MixinInferenceSolution._solveForEquality (cyclomatic 73) · ×1
  • _MixinInferenceSolution._solveForEquality (cyclomatic 73) pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:261 — _MixinInferenceSolution._solveForEquality has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceLoader._checkSupertypeClassModifiers (cyclomatic 73) · ×1
  • SourceLoader._checkSupertypeClassModifiers (cyclomatic 73) pkg/front_end/lib/src/source/source_loader.dart:2222 — SourceLoader._checkSupertypeClassModifiers has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResolvedCorrectionProducer.inferUndefinedExpressionType (cyclomatic 70) · ×1
  • ResolvedCorrectionProducer.inferUndefinedExpressionType (cyclomatic 70) pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:514 — ResolvedCorrectionProducer.inferUndefinedExpressionType has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator2.visitBinaryOperatorInvocation (cyclomatic 69) · ×1
  • ConstantEvaluator2.visitBinaryOperatorInvocation (cyclomatic 69) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:438 — ConstantEvaluator2.visitBinaryOperatorInvocation has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartScopeBuilder2._filter (cyclomatic 69) · ×1
  • DartScopeBuilder2._filter (cyclomatic 69) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:605 — DartScopeBuilder2._filter has cyclomatic complexity 69 (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.
D1 · Cyclomatic Complexity · DartFileEditBuilderImpl._addLibraryImports (cyclomatic 67) · ×1
  • DartFileEditBuilderImpl._addLibraryImports (cyclomatic 67) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2533 — DartFileEditBuilderImpl._addLibraryImports has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Tuple.sanitize (cyclomatic 67) · ×1
  • _Tuple.sanitize (cyclomatic 67) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1481 — _Tuple.sanitize has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassMembersNodeBuilder.build (cyclomatic 65) · ×1
  • ClassMembersNodeBuilder.build (cyclomatic 65) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:597 — ClassMembersNodeBuilder.build has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantsTransformer.visitPatternSwitchStatement (cyclomatic 64) · ×1
  • ConstantsTransformer.visitPatternSwitchStatement (cyclomatic 64) pkg/front_end/lib/src/kernel/constant_evaluator.dart:750 — ConstantsTransformer.visitPatternSwitchStatement has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Intrinsifier.generateInstanceIntrinsic (cyclomatic 63) · ×1
  • Intrinsifier.generateInstanceIntrinsic (cyclomatic 63) pkg/dart2wasm/lib/intrinsics.dart:774 — Intrinsifier.generateInstanceIntrinsic has cyclomatic complexity 63 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _Tuple.sanitize (cyclomatic 63) · ×1
  • _Tuple.sanitize (cyclomatic 63) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:549 — _Tuple.sanitize has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodegenImpactTransformer.transformCodegenImpact (cyclomatic 60) · ×1
  • CodegenImpactTransformer.transformCodegenImpact (cyclomatic 60) pkg/compiler/lib/src/js_backend/impact_transformer.dart:77 — CodegenImpactTransformer.transformCodegenImpact has cyclomatic complexity 60 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Parser.parseTopLevelMemberImpl (cyclomatic 59) · ×1
  • Parser.parseTopLevelMemberImpl (cyclomatic 59) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4193 — Parser.parseTopLevelMemberImpl has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser._parsePrecedenceExpressionLoop (cyclomatic 59) · ×1
  • Parser._parsePrecedenceExpressionLoop (cyclomatic 59) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7211 — Parser._parsePrecedenceExpressionLoop has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LeastUpperBoundHelper._computeLeastUpperBound (cyclomatic 59) · ×1
  • LeastUpperBoundHelper._computeLeastUpperBound (cyclomatic 59) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:391 — LeastUpperBoundHelper._computeLeastUpperBound has cyclomatic complexity 59 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypeSystemImpl.canBeSubtypeOf (cyclomatic 59) · ×1
  • TypeSystemImpl.canBeSubtypeOf (cyclomatic 59) pkg/analyzer/lib/src/dart/element/type_system.dart:141 — TypeSystemImpl.canBeSubtypeOf has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationByElementLocator.visitNode (cyclomatic 57) · ×1
  • DeclarationByElementLocator.visitNode (cyclomatic 57) pkg/analyzer/lib/src/dart/analysis/results.dart:96 — DeclarationByElementLocator.visitNode has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Collector.collect (cyclomatic 56) · ×1
  • _Collector.collect (cyclomatic 56) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:76 — _Collector.collect has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelTarget._finishConstruction (cyclomatic 56) · ×1
  • KernelTarget._finishConstruction (cyclomatic 56) pkg/front_end/lib/src/kernel/kernel_target.dart:1552 — KernelTarget._finishConstruction has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SanitizedMember.computeMembers (cyclomatic 55) · ×1
  • _SanitizedMember.computeMembers (cyclomatic 55) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1960 — _SanitizedMember.computeMembers has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DuplicateDefinitionVerifier.checkUnit (cyclomatic 54) · ×1
  • DuplicateDefinitionVerifier.checkUnit (cyclomatic 54) pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart:112 — DuplicateDefinitionVerifier.checkUnit has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._doTryInlineMethod (cyclomatic 54) · ×1
  • KernelSsaGraphBuilder._doTryInlineMethod (cyclomatic 54) pkg/compiler/lib/src/ssa/builder.dart:7879 — KernelSsaGraphBuilder._doTryInlineMethod has cyclomatic complexity 54 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SummaryCollector.createSummary (cyclomatic 54) · ×1
  • SummaryCollector.createSummary (cyclomatic 54) pkg/vm/lib/transformations/type_flow/summary_collector.dart:772 — SummaryCollector.createSummary has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HttpDate._parseCookieDate (cyclomatic 53) · ×1
  • HttpDate._parseCookieDate (cyclomatic 53) sdk/lib/_http/http_date.dart:280 — HttpDate._parseCookieDate has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JFieldAnalysis.from (cyclomatic 53) · ×1
  • JFieldAnalysis.from (cyclomatic 53) pkg/compiler/lib/src/js_backend/field_analysis.dart:289 — JFieldAnalysis.from has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FrontendCompiler.compile (cyclomatic 52) · ×1
  • FrontendCompiler.compile (cyclomatic 52) pkg/frontend_server/lib/frontend_server.dart:699 — FrontendCompiler.compile has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GreatestLowerBoundHelper.getGreatestLowerBound (cyclomatic 52) · ×1
  • GreatestLowerBoundHelper.getGreatestLowerBound (cyclomatic 52) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:23 — GreatestLowerBoundHelper.getGreatestLowerBound has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase._inferInvocation (cyclomatic 52) · ×1
  • InferenceVisitorBase._inferInvocation (cyclomatic 52) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1738 — InferenceVisitorBase._inferInvocation has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SwitchInfo.SwitchInfo (cyclomatic 51) · ×1
  • SwitchInfo.SwitchInfo (cyclomatic 51) pkg/dart2wasm/lib/code_generator.dart:5364 — SwitchInfo.SwitchInfo has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Evaluator._visitExpression (cyclomatic 51) · ×1
  • Evaluator._visitExpression (cyclomatic 51) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:48 — Evaluator._visitExpression has cyclomatic complexity 51 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · UseResultVerifier._isUsed (cyclomatic 51) · ×1
  • UseResultVerifier._isUsed (cyclomatic 51) pkg/analyzer/lib/src/error/use_result_verifier.dart:140 — UseResultVerifier._isUsed has cyclomatic complexity 51 (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.
D1 · Cyclomatic Complexity · Uri.parse (cyclomatic 50) · ×1
  • Uri.parse (cyclomatic 50) sdk/lib/core/uri.dart:841 — Uri.parse has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModifyParameters.apply (cyclomatic 50) · ×1
  • ModifyParameters.apply (cyclomatic 50) pkg/analysis_server/lib/src/services/correction/fix/data_driven/modify_parameters.dart:81 — ModifyParameters.apply has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Intrinsifier.generateMemberIntrinsic (cyclomatic 49) · ×1
  • Intrinsifier.generateMemberIntrinsic (cyclomatic 49) pkg/dart2wasm/lib/intrinsics.dart:3741 — Intrinsifier.generateMemberIntrinsic has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseExpressionStatementOrDeclarationAfterModifiers (cyclomatic 49) · ×1
  • Parser.parseExpressionStatementOrDeclarationAfterModifiers (cyclomatic 49) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9891 — Parser.parseExpressionStatementOrDeclarationAfterModifiers has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddNullCheck.compute (cyclomatic 49) · ×1
  • AddNullCheck.compute (cyclomatic 49) pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart:79 — AddNullCheck.compute has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InterceptorStubGenerator.generateGetInterceptorMethod (cyclomatic 49) · ×1
  • InterceptorStubGenerator.generateGetInterceptorMethod (cyclomatic 49) pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart:50 — InterceptorStubGenerator.generateGetInterceptorMethod has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OutlineBuilder.endFormalParameters (cyclomatic 49) · ×1
  • OutlineBuilder.endFormalParameters (cyclomatic 49) pkg/front_end/lib/src/source/outline_builder.dart:3296 — OutlineBuilder.endFormalParameters has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractScanner.bigSwitch (cyclomatic 48) · ×1
  • AbstractScanner.bigSwitch (cyclomatic 48) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091 — AbstractScanner.bigSwitch has cyclomatic complexity 48 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SnapshotSerializer.getCluster (cyclomatic 47) · ×1
  • SnapshotSerializer.getCluster (cyclomatic 47) pkg/native_compiler/lib/snapshot/snapshot.dart:365 — SnapshotSerializer.getCluster has cyclomatic complexity 47 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HValidator.visitBasicBlock (cyclomatic 47) · ×1
  • HValidator.visitBasicBlock (cyclomatic 47) pkg/compiler/lib/src/ssa/validate.dart:23 — HValidator.visitBasicBlock has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartDebugAdapter.variablesRequest (cyclomatic 47) · ×1
  • DartDebugAdapter.variablesRequest (cyclomatic 47) pkg/dap_adapters/lib/src/adapters/dart.dart:2554 — DartDebugAdapter.variablesRequest has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler._initializeExperimentalInvalidation (cyclomatic 47) · ×1
  • IncrementalCompiler._initializeExperimentalInvalidation (cyclomatic 47) pkg/front_end/lib/src/base/incremental_compiler.dart:1283 — IncrementalCompiler._initializeExperimentalInvalidation has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase.createPropertyGet (cyclomatic 47) · ×1
  • InferenceVisitorBase.createPropertyGet (cyclomatic 47) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5358 — InferenceVisitorBase.createPropertyGet has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MiniJsParser.getToken (cyclomatic 47) · ×1
  • MiniJsParser.getToken (cyclomatic 47) pkg/js_ast/lib/src/builder.dart:619 — MiniJsParser.getToken has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Class.test (cyclomatic 46) · ×1
  • Class.test (cyclomatic 46) pkg/front_end/testcases/general/for_in.dart:295 — Class.test has cyclomatic complexity 46 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Parser.parsePrimary (cyclomatic 46) · ×1
  • Parser.parsePrimary (cyclomatic 46) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8111 — Parser.parsePrimary has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompletionHandler._getServerDartItems (cyclomatic 46) · ×1
  • CompletionHandler._getServerDartItems (cyclomatic 46) pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart:386 — CompletionHandler._getServerDartItems has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitVariableDeclaration (cyclomatic 46) · ×1
  • InScopeCompletionPass.visitVariableDeclaration (cyclomatic 46) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3418 — InScopeCompletionPass.visitVariableDeclaration has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RelevanceComputer.computeRelevance (cyclomatic 46) · ×1
  • RelevanceComputer.computeRelevance (cyclomatic 46) pkg/analysis_server/lib/src/services/completion/dart/relevance_computer.dart:109 — RelevanceComputer.computeRelevance has cyclomatic complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ConvertToDeclaringParameter.compute (cyclomatic 46) · ×1
  • ConvertToDeclaringParameter.compute (cyclomatic 46) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:41 — ConvertToDeclaringParameter.compute has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForAugmentationFormalParameters (cyclomatic 46) · ×1
  • ErrorVerifier._checkForAugmentationFormalParameters (cyclomatic 46) pkg/analyzer/lib/src/generated/error_verifier.dart:3117 — ErrorVerifier._checkForAugmentationFormalParameters has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InvokeDynamicSpecializer.lookupSpecializer (cyclomatic 46) · ×1
  • InvokeDynamicSpecializer.lookupSpecializer (cyclomatic 46) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:71 — InvokeDynamicSpecializer.lookupSpecializer has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalyzeCommand.run (cyclomatic 46) · ×1
  • AnalyzeCommand.run (cyclomatic 46) pkg/dartdev/lib/src/commands/analyze.dart:195 — AnalyzeCommand.run has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LinearScanRegisterAllocator.resolveDataFlow (cyclomatic 45) · ×1
  • LinearScanRegisterAllocator.resolveDataFlow (cyclomatic 45) pkg/native_compiler/lib/back_end/register_allocator.dart:941 — LinearScanRegisterAllocator.resolveDataFlow has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MiniJsParser.getToken (cyclomatic 45) · ×1
  • MiniJsParser.getToken (cyclomatic 45) pkg/dev_compiler/lib/src/js_ast/builder.dart:701 — MiniJsParser.getToken has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency (cyclomatic 45) · ×1
  • SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency (cyclomatic 45) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:509 — SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractScanner.bigSwitch (cyclomatic 44) · ×1
  • AbstractScanner.bigSwitch (cyclomatic 44) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:429 — AbstractScanner.bigSwitch has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DartLanguageServerBenchmark._listenToStdout (cyclomatic 44) · ×1
  • DartLanguageServerBenchmark._listenToStdout (cyclomatic 44) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:347 — DartLanguageServerBenchmark._listenToStdout has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BytecodeGenerator.getFunctionDeclaration (cyclomatic 44) · ×1
  • BytecodeGenerator.getFunctionDeclaration (cyclomatic 44) pkg/dart2bytecode/lib/bytecode_generator.dart:621 — BytecodeGenerator.getFunctionDeclaration has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantVerifier._reportError (cyclomatic 44) · ×1
  • ConstantVerifier._reportError (cyclomatic 44) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:775 — ConstantVerifier._reportError has cyclomatic complexity 44 (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.
D1 · Cyclomatic Complexity · SourceTypeAliasBuilder._checkCyclicTypedefDependency (cyclomatic 44) · ×1
  • SourceTypeAliasBuilder._checkCyclicTypedefDependency (cyclomatic 44) pkg/front_end/lib/src/source/source_type_alias_builder.dart:165 — SourceTypeAliasBuilder._checkCyclicTypedefDependency has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantPragmaAnnotationParser.parsePragma (cyclomatic 43) · ×1
  • ConstantPragmaAnnotationParser.parsePragma (cyclomatic 43) pkg/vm/lib/modular/transformations/pragma.dart:165 — ConstantPragmaAnnotationParser.parsePragma has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddFieldFormalParameters._computeFromPieces (cyclomatic 43) · ×1
  • AddFieldFormalParameters._computeFromPieces (cyclomatic 43) pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart:87 — AddFieldFormalParameters._computeFromPieces has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReplaceWithVar.compute (cyclomatic 43) · ×1
  • ReplaceWithVar.compute (cyclomatic 43) pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart:33 — ReplaceWithVar.compute has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartSnippetRequest._getContext (cyclomatic 43) · ×1
  • DartSnippetRequest._getContext (cyclomatic 43) pkg/analysis_server/lib/src/services/snippets/dart_snippet_request.dart:98 — DartSnippetRequest._getContext has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardingNode.finalize (cyclomatic 43) · ×1
  • ForwardingNode.finalize (cyclomatic 43) pkg/front_end/lib/src/kernel/forwarding_node.dart:71 — ForwardingNode.finalize has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitClassDeclaration (cyclomatic 43) · ×1
  • _Visitor.visitClassDeclaration (cyclomatic 43) pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:54 — _Visitor.visitClassDeclaration has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlutterConvertToStatefulWidget.compute (cyclomatic 42) · ×1
  • FlutterConvertToStatefulWidget.compute (cyclomatic 42) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:30 — FlutterConvertToStatefulWidget.compute has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ClassVerifier.verify (cyclomatic 41) · ×1
  • _ClassVerifier.verify (cyclomatic 41) pkg/analyzer/lib/src/error/inheritance_override.dart:313 — _ClassVerifier.verify has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment (cyclomatic 41) · ×1
  • LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment (cyclomatic 41) pkg/analyzer/lib/src/error/language_version_override_verifier.dart:37 — LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InstanceMemberInferrer._inferAccessorOrField (cyclomatic 41) · ×1
  • InstanceMemberInferrer._inferAccessorOrField (cyclomatic 41) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:88 — InstanceMemberInferrer._inferAccessorOrField has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _IRInterpreter.run (cyclomatic 41) · ×1
  • _IRInterpreter.run (cyclomatic 41) pkg/analyzer/lib/src/wolf/ir/interpreter.dart:260 — _IRInterpreter.run has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DynamicCallSiteTypeInformation.handleIntrinsifiedSelector (cyclomatic 41) · ×1
  • DynamicCallSiteTypeInformation.handleIntrinsifiedSelector (cyclomatic 41) pkg/compiler/lib/src/inferrer/type_graph_nodes.dart:1321 — DynamicCallSiteTypeInformation.handleIntrinsifiedSelector has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramBuilder._buildClass (cyclomatic 41) · ×1
  • ProgramBuilder._buildClass (cyclomatic 41) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:657 — ProgramBuilder._buildClass has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitClassDeclaration (cyclomatic 41) · ×1
  • _Visitor.visitClassDeclaration (cyclomatic 41) pkg/linter/lib/src/rules/use_enums.dart:139 — _Visitor.visitClassDeclaration has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstanceViewElement._createMembers (cyclomatic 41) · ×1
  • InstanceViewElement._createMembers (cyclomatic 41) pkg/observatory/lib/src/elements/instance_view.dart:220 — InstanceViewElement._createMembers has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DispatchTable.build (cyclomatic 40) · ×1
  • DispatchTable.build (cyclomatic 40) pkg/dart2wasm/lib/dispatch_table.dart:505 — DispatchTable.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MixinFullResolution.transformClass (cyclomatic 40) · ×1
  • MixinFullResolution.transformClass (cyclomatic 40) pkg/vm/lib/modular/transformations/mixin_full_resolution.dart:78 — MixinFullResolution.transformClass has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TopMergeHelper.topMerge (cyclomatic 40) · ×1
  • TopMergeHelper.topMerge (cyclomatic 40) pkg/analyzer/lib/src/dart/element/top_merge.dart:22 — TopMergeHelper.topMerge has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NamedTypeResolver.resolveConstructorTypeReference (cyclomatic 40) · ×1
  • NamedTypeResolver.resolveConstructorTypeReference (cyclomatic 40) pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart:132 — NamedTypeResolver.resolveConstructorTypeReference has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NullSafetyDeadCodeVerifier.flowEnd (cyclomatic 40) · ×1
  • NullSafetyDeadCodeVerifier.flowEnd (cyclomatic 40) pkg/analyzer/lib/src/error/dead_code_verifier.dart:205 — NullSafetyDeadCodeVerifier.flowEnd has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResolutionEnqueuerListener._processClass (cyclomatic 40) · ×1
  • ResolutionEnqueuerListener._processClass (cyclomatic 40) pkg/compiler/lib/src/js_backend/resolution_listener.dart:387 — ResolutionEnqueuerListener._processClass has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClosureDataBuilder._updateScopeBasedOnRtiNeed (cyclomatic 40) · ×1
  • ClosureDataBuilder._updateScopeBasedOnRtiNeed (cyclomatic 40) pkg/compiler/lib/src/js_model/closure.dart:256 — ClosureDataBuilder._updateScopeBasedOnRtiNeed has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder (cyclomatic 40) · ×1
  • DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder (cyclomatic 40) pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:39 — DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Instance.toJson (cyclomatic 40) · ×1
  • Instance.toJson (cyclomatic 40) pkg/vm_service/lib/src/vm_service.dart:5796 — Instance.toJson has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Configuration.parse (cyclomatic 39) · ×1
  • Configuration.parse (cyclomatic 39) pkg/smith/lib/configuration.dart:107 — Configuration.parse has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Sort._dualPivotQuicksort (cyclomatic 39) · ×1
  • Sort._dualPivotQuicksort (cyclomatic 39) sdk/lib/internal/sort.dart:90 — Sort._dualPivotQuicksort has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComplexTypeInfo.computeRecordType (cyclomatic 39) · ×1
  • ComplexTypeInfo.computeRecordType (cyclomatic 39) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:759 — ComplexTypeInfo.computeRecordType has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · RenameRefactoring.getElementToRename (cyclomatic 39) · ×1
  • RenameRefactoring.getElementToRename (cyclomatic 39) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart:591 — RenameRefactoring.getElementToRename has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AstWriter._computeProperties (cyclomatic 39) · ×1
  • AstWriter._computeProperties (cyclomatic 39) pkg/analysis_server/lib/src/status/utilities/ast_writer.dart:30 — AstWriter._computeProperties has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeEmitter.prepareNativeClasses (cyclomatic 39) · ×1
  • NativeEmitter.prepareNativeClasses (cyclomatic 39) pkg/compiler/lib/src/js_emitter/native_emitter.dart:41 — NativeEmitter.prepareNativeClasses has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompileWasmCommand.run (cyclomatic 39) · ×1
  • CompileWasmCommand.run (cyclomatic 39) pkg/dartdev/lib/src/commands/compile.dart:949 — CompileWasmCommand.run has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DillLibraryBuilder.ensureLoaded (cyclomatic 39) · ×1
  • DillLibraryBuilder.ensureLoaded (cyclomatic 39) pkg/front_end/lib/src/dill/dill_library_builder.dart:182 — DillLibraryBuilder.ensureLoaded has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtensionTypeMembersNodeBuilder.build (cyclomatic 39) · ×1
  • ExtensionTypeMembersNodeBuilder.build (cyclomatic 39) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:35 — ExtensionTypeMembersNodeBuilder.build has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AsyncStateVisitor.visitBinaryExpression (cyclomatic 39) · ×1
  • AsyncStateVisitor.visitBinaryExpression (cyclomatic 39) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:187 — AsyncStateVisitor.visitBinaryExpression has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _WebSocketProtocolTransformer.add (cyclomatic 38) · ×1
  • _WebSocketProtocolTransformer.add (cyclomatic 38) sdk/lib/_http/websocket_impl.dart:313 — _WebSocketProtocolTransformer.add has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitBinaryIntOp (cyclomatic 38) · ×1
  • Arm64CodeGenerator.visitBinaryIntOp (cyclomatic 38) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2731 — Arm64CodeGenerator.visitBinaryIntOp has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Simplification.visitBinaryIntOp (cyclomatic 38) · ×1
  • Simplification.visitBinaryIntOp (cyclomatic 38) pkg/cfg/lib/passes/simplification.dart:379 — Simplification.visitBinaryIntOp has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · FunctionSerializationCluster.trace (cyclomatic 38) · ×1
  • FunctionSerializationCluster.trace (cyclomatic 38) pkg/native_compiler/lib/snapshot/snapshot.dart:1407 — FunctionSerializationCluster.trace has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SnapshotSerializer._createPredefinedCluster (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Parser.parseStatementX (cyclomatic 38) · ×1
  • Parser.parseStatementX (cyclomatic 38) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6728 — Parser.parseStatementX has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SharedInteropTransformer._createIsACheck (cyclomatic 38) · ×1
  • SharedInteropTransformer._createIsACheck (cyclomatic 38) pkg/_js_interop_checks/lib/src/transformations/shared_interop_transformer.dart:728 — SharedInteropTransformer._createIsACheck has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToSwitchExpression._getSupportedSwitchType (cyclomatic 38) · ×1
  • ConvertToSwitchExpression._getSupportedSwitchType (cyclomatic 38) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:386 — ConvertToSwitchExpression._getSupportedSwitchType has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypePropertyResolver.resolve (cyclomatic 38) · ×1
  • TypePropertyResolver.resolve (cyclomatic 38) pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart:101 — TypePropertyResolver.resolve has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementUsageDetector.checkUsage (cyclomatic 38) · ×1
  • ElementUsageDetector.checkUsage (cyclomatic 38) pkg/analyzer/lib/src/error/element_usage_detector.dart:73 — ElementUsageDetector.checkUsage has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkUseOfDefaultValuesInParameters (cyclomatic 38) · ×1
  • ErrorVerifier._checkUseOfDefaultValuesInParameters (cyclomatic 38) pkg/analyzer/lib/src/generated/error_verifier.dart:8327 — ErrorVerifier._checkUseOfDefaultValuesInParameters has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FuzzyMatcher.computeScore (cyclomatic 38) · ×1
  • FuzzyMatcher.computeScore (cyclomatic 38) pkg/analyzer/lib/src/utilities/fuzzy_matcher.dart:161 — FuzzyMatcher.computeScore has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaCodeGenerator.visitLoopInfo (cyclomatic 38) · ×1
  • SsaCodeGenerator.visitLoopInfo (cyclomatic 38) pkg/compiler/lib/src/ssa/codegen.dart:1046 — SsaCodeGenerator.visitLoopInfo has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PatternConverter.dispatchPattern (cyclomatic 38) · ×1
  • PatternConverter.dispatchPattern (cyclomatic 38) pkg/front_end/lib/src/kernel/exhaustiveness.dart:624 — PatternConverter.dispatchPattern has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JsInteropChecks.visitProcedure (cyclomatic 37) · ×1
  • JsInteropChecks.visitProcedure (cyclomatic 37) pkg/_js_interop_checks/lib/js_interop_checks.dart:312 — JsInteropChecks.visitProcedure has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionLogAnalyzer.processFile (cyclomatic 37) · ×1
  • SessionLogAnalyzer.processFile (cyclomatic 37) pkg/analysis_server/.agents/skills/improve-performance-with-session-log/scripts/analyze_session_log.dart:217 — SessionLogAnalyzer.processFile has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeEnvironment.computeTypeShapeCheckSufficiency (cyclomatic 37) · ×1
  • TypeEnvironment.computeTypeShapeCheckSufficiency (cyclomatic 37) pkg/kernel/lib/type_environment.dart:306 — TypeEnvironment.computeTypeShapeCheckSufficiency has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartUnitHoverComputer.compute (cyclomatic 37) · ×1
  • DartUnitHoverComputer.compute (cyclomatic 37) pkg/analysis_server/lib/src/computer/computer_hover.dart:31 — DartUnitHoverComputer.compute has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitArgumentList (cyclomatic 37) · ×1
  • InScopeCompletionPass.visitArgumentList (cyclomatic 37) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:293 — InScopeCompletionPass.visitArgumentList has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImportLibrary._importLibraryForElement (cyclomatic 37) · ×1
  • ImportLibrary._importLibraryForElement (cyclomatic 37) pkg/analysis_server/lib/src/services/correction/dart/import_library.dart:312 — ImportLibrary._importLibraryForElement has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogSanitizer._sanitizeResult (cyclomatic 37) · ×1
  • LogSanitizer._sanitizeResult (cyclomatic 37) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:919 — LogSanitizer._sanitizeResult has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._pushDynamicInvocation (cyclomatic 37) · ×1
  • KernelSsaGraphBuilder._pushDynamicInvocation (cyclomatic 37) pkg/compiler/lib/src/ssa/builder.dart:6830 — KernelSsaGraphBuilder._pushDynamicInvocation has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RunCommand._runLocal (cyclomatic 37) · ×1
  • RunCommand._runLocal (cyclomatic 37) pkg/dartdev/lib/src/commands/run.dart:537 — RunCommand._runLocal has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase._computeAssignabilityKind (cyclomatic 37) · ×1
  • InferenceVisitorBase._computeAssignabilityKind (cyclomatic 37) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:863 — InferenceVisitorBase._computeAssignabilityKind has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DartDocTest.compileAndRun (cyclomatic 36) · ×1
  • DartDocTest.compileAndRun (cyclomatic 36) pkg/front_end/tool/dart_doctest_impl.dart:123 — DartDocTest.compileAndRun has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KeywordHelper.addExpressionKeywords (cyclomatic 36) · ×1
  • KeywordHelper.addExpressionKeywords (cyclomatic 36) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:312 — KeywordHelper.addExpressionKeywords has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConvertToSuperParameters.compute (cyclomatic 36) · ×1
  • ConvertToSuperParameters.compute (cyclomatic 36) pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart:36 — ConvertToSuperParameters.compute has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpressionImpl.constantContext2 (cyclomatic 36) · ×1
  • ExpressionImpl.constantContext2 (cyclomatic 36) pkg/analyzer/lib/src/dart/ast/ast.dart:19653 — ExpressionImpl.constantContext2 has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PatternConverter.dispatchPattern (cyclomatic 36) · ×1
  • PatternConverter.dispatchPattern (cyclomatic 36) pkg/analyzer/lib/src/generated/exhaustiveness.dart:581 — PatternConverter.dispatchPattern has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompilerOptions.equivalent (cyclomatic 36) · ×1
  • CompilerOptions.equivalent (cyclomatic 36) pkg/front_end/lib/src/api_prototype/compiler_options.dart:257 — CompilerOptions.equivalent has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IncrementalCompiler._computeReusedLibraries (cyclomatic 36) · ×1
  • IncrementalCompiler._computeReusedLibraries (cyclomatic 36) pkg/front_end/lib/src/base/incremental_compiler.dart:2687 — IncrementalCompiler._computeReusedLibraries has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitInstantiation (cyclomatic 36) · ×1
  • InferenceVisitorImpl.visitInstantiation (cyclomatic 36) pkg/front_end/lib/src/type_inference/inference_visitor.dart:671 — InferenceVisitorImpl.visitInstantiation has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parse (cyclomatic 35) · ×1
  • _ChunkedJsonParser.parse (cyclomatic 35) sdk/lib/_internal/wasm/common/convert_patch.dart:897 — _ChunkedJsonParser.parse has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Uri.resolveUri (cyclomatic 35) · ×1
  • _Uri.resolveUri (cyclomatic 35) sdk/lib/core/uri.dart:3220 — _Uri.resolveUri has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiTransformer.convertNativeTypeToDartType (cyclomatic 35) · ×1
  • FfiTransformer.convertNativeTypeToDartType (cyclomatic 35) pkg/vm/lib/modular/transformations/ffi/common.dart:1088 — FfiTransformer.convertNativeTypeToDartType has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Parser.parseTopLevelDeclarationImpl (cyclomatic 35) · ×1
  • Parser.parseTopLevelDeclarationImpl (cyclomatic 35) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:554 — Parser.parseTopLevelDeclarationImpl has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LibrariesSpecification.parse (cyclomatic 35) · ×1
  • LibrariesSpecification.parse (cyclomatic 35) pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart:200 — LibrariesSpecification.parse has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementCompletionProcessor.compute (cyclomatic 35) · ×1
  • StatementCompletionProcessor.compute (cyclomatic 35) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:169 — StatementCompletionProcessor.compute has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveUnusedField.compute (cyclomatic 35) · ×1
  • RemoveUnusedField.compute (cyclomatic 35) pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart:120 — RemoveUnusedField.compute has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SignatureUpdater.updateDeclaration (cyclomatic 35) · ×1
  • _SignatureUpdater.updateDeclaration (cyclomatic 35) pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart:783 — _SignatureUpdater.updateDeclaration has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ClassVerifier._verifyMustBeOverridden (cyclomatic 35) · ×1
  • _ClassVerifier._verifyMustBeOverridden (cyclomatic 35) pkg/analyzer/lib/src/error/inheritance_override.dart:1060 — _ClassVerifier._verifyMustBeOverridden has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InterceptorStubGenerator._fastPathForOneShotInterceptor (cyclomatic 35) · ×1
  • InterceptorStubGenerator._fastPathForOneShotInterceptor (cyclomatic 35) pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart:317 — InterceptorStubGenerator._fastPathForOneShotInterceptor has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler._defineClass (cyclomatic 35) · ×1
  • ProgramCompiler._defineClass (cyclomatic 35) pkg/dev_compiler/lib/src/kernel/compiler.dart:1462 — ProgramCompiler._defineClass has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeCreator.generateComponent (cyclomatic 35) · ×1
  • NodeCreator.generateComponent (cyclomatic 35) pkg/kernel/lib/src/node_creator.dart:398 — NodeCreator.generateComponent has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: NodeCreator._createExpressionFromKind (cyclomatic 70) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StandardBounds._getFunctionStandardUpperBound (cyclomatic 35) · ×1
  • StandardBounds._getFunctionStandardUpperBound (cyclomatic 35) pkg/kernel/lib/src/standard_bounds.dart:1332 — StandardBounds._getFunctionStandardUpperBound has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: StandardBounds.morebottom (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SummaryCollector._visitCondition (cyclomatic 35) · ×1
  • SummaryCollector._visitCondition (cyclomatic 35) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1792 — SummaryCollector._visitCondition has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Application._printOutput (cyclomatic 34) · ×1
  • Application._printOutput (cyclomatic 34) pkg/front_end/tool/parser_direct_ast/console_helper.dart:108 — Application._printOutput has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _Cookie._parseSetCookieValue (cyclomatic 34) · ×1
  • _Cookie._parseSetCookieValue (cyclomatic 34) sdk/lib/_http/http_headers.dart:1100 — _Cookie._parseSetCookieValue has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Future._propagateToListeners (cyclomatic 34) · ×1
  • _Future._propagateToListeners (cyclomatic 34) sdk/lib/async/future_impl.dart:831 — _Future._propagateToListeners has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseTopLevelKeywordDeclaration (cyclomatic 34) · ×1
  • Parser.parseTopLevelKeywordDeclaration (cyclomatic 34) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:682 — Parser.parseTopLevelKeywordDeclaration has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ColorComputer._getDartUiColor (cyclomatic 34) · ×1
  • ColorComputer._getDartUiColor (cyclomatic 34) pkg/analysis_server/lib/src/computer/computer_color.dart:269 — ColorComputer._getDartUiColor has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtractLocalRefactoringImpl._checkSelection (cyclomatic 34) · ×1
  • ExtractLocalRefactoringImpl._checkSelection (cyclomatic 34) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart:269 — ExtractLocalRefactoringImpl._checkSelection has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InheritanceManager3._getInterfaceExtensionType (cyclomatic 34) · ×1
  • InheritanceManager3._getInterfaceExtensionType (cyclomatic 34) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:825 — InheritanceManager3._getInterfaceExtensionType has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodInvocationResolver.resolveUnqualified (cyclomatic 34) · ×1
  • MethodInvocationResolver.resolveUnqualified (cyclomatic 34) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:215 — MethodInvocationResolver.resolveUnqualified has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramBuilder._addJsInteropStubs (cyclomatic 34) · ×1
  • ProgramBuilder._addJsInteropStubs (cyclomatic 34) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:455 — ProgramBuilder._addJsInteropStubs has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FragmentEmitter.emitInstallTearOffs (cyclomatic 34) · ×1
  • FragmentEmitter.emitInstallTearOffs (cyclomatic 34) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1422 — FragmentEmitter.emitInstallTearOffs has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProtocolConverter.convertVmInstanceToVariablesList (cyclomatic 34) · ×1
  • ProtocolConverter.convertVmInstanceToVariablesList (cyclomatic 34) pkg/dap_adapters/lib/src/protocol_converter.dart:128 — ProtocolConverter.convertVmInstanceToVariablesList has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartScopeBuilder2._looksLikeLateLoweredField (cyclomatic 34) · ×1
  • DartScopeBuilder2._looksLikeLateLoweredField (cyclomatic 34) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:889 — DartScopeBuilder2._looksLikeLateLoweredField has cyclomatic complexity 34 (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.
D1 · Cyclomatic Complexity · OutlineBuilder.endPrimaryConstructor (cyclomatic 34) · ×1
  • OutlineBuilder.endPrimaryConstructor (cyclomatic 34) pkg/front_end/lib/src/source/outline_builder.dart:1801 — OutlineBuilder.endPrimaryConstructor has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AsyncStateVisitor._visitIfLike (cyclomatic 34) · ×1
  • AsyncStateVisitor._visitIfLike (cyclomatic 34) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:813 — AsyncStateVisitor._visitIfLike has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstanceRefElement._createValue (cyclomatic 34) · ×1
  • InstanceRefElement._createValue (cyclomatic 34) pkg/observatory/lib/src/elements/instance_ref.dart:278 — InstanceRefElement._createValue has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InstanceRefElement._createLink (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · bin_to_assembly.Main (cyclomatic 34) · ×1
  • bin_to_assembly.Main (cyclomatic 34) runtime/tools/bin_to_assembly.py:15 — bin_to_assembly.Main has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parse (cyclomatic 33) · ×1
  • _ChunkedJsonParser.parse (cyclomatic 33) sdk/lib/_internal/vm/lib/convert_patch.dart:819 — _ChunkedJsonParser.parse has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Utf8Decoder._convertChunkInternal (cyclomatic 33) · ×1
  • _Utf8Decoder._convertChunkInternal (cyclomatic 33) sdk/lib/_internal/wasm/common/convert_patch.dart:2415 — _Utf8Decoder._convertChunkInternal has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToInitializingFormal._computeChange (cyclomatic 33) · ×1
  • ConvertToInitializingFormal._computeChange (cyclomatic 33) pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart:187 — ConvertToInitializingFormal._computeChange has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlutterConvertToStatelessWidget.compute (cyclomatic 33) · ×1
  • FlutterConvertToStatelessWidget.compute (cyclomatic 33) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:32 — FlutterConvertToStatelessWidget.compute has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodInvocationResolver._resolveInstanceInvocation (cyclomatic 33) · ×1
  • MethodInvocationResolver._resolveInstanceInvocation (cyclomatic 33) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:578 — MethodInvocationResolver._resolveInstanceInvocation has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadPosition.of (cyclomatic 33) · ×1
  • ReadPosition.of (cyclomatic 33) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:591 — ReadPosition.of has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · KernelInfoCollector.visitFunction (cyclomatic 33) · ×1
  • KernelInfoCollector.visitFunction (cyclomatic 33) pkg/compiler/lib/src/dump_info.dart:1010 — KernelInfoCollector.visitFunction has cyclomatic complexity 33 (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.
D1 · Cyclomatic Complexity · ResolutionWorldBuilder.registerStaticUse (cyclomatic 33) · ×1
  • ResolutionWorldBuilder.registerStaticUse (cyclomatic 33) pkg/compiler/lib/src/universe/resolution_world_builder.dart:577 — ResolutionWorldBuilder.registerStaticUse has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ConstantEvaluator.handleConstructorInvocation (cyclomatic 33) · ×1
  • ConstantEvaluator.handleConstructorInvocation (cyclomatic 33) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3735 — ConstantEvaluator.handleConstructorInvocation has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase.inferMethodInvocation (cyclomatic 33) · ×1
  • InferenceVisitorBase.inferMethodInvocation (cyclomatic 33) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3621 — InferenceVisitorBase.inferMethodInvocation has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Pdb._readModule (cyclomatic 33) · ×1
  • Pdb._readModule (cyclomatic 33) pkg/native_stack_traces/lib/src/pdb.dart:997 — Pdb._readModule has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _TextFormatter.add (cyclomatic 32) · ×1
  • _TextFormatter.add (cyclomatic 32) pkg/analyzer_utilities/lib/text_formatter.dart:58 — _TextFormatter.add has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Translator.translateStorageType (cyclomatic 32) · ×1
  • Translator.translateStorageType (cyclomatic 32) pkg/dart2wasm/lib/translator.dart:1059 — Translator.translateStorageType has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ImportExportVerifierMixin._checkImportExportPragmas (cyclomatic 32) · ×1
  • _ImportExportVerifierMixin._checkImportExportPragmas (cyclomatic 32) pkg/dart2wasm/lib/wasm_library_checks.dart:518 — _ImportExportVerifierMixin._checkImportExportPragmas has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NoSuchMethodError.toString (cyclomatic 32) · ×1
  • NoSuchMethodError.toString (cyclomatic 32) sdk/lib/_internal/vm/lib/errors_patch.dart:233 — NoSuchMethodError.toString has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parse (cyclomatic 32) · ×1
  • _ChunkedJsonParser.parse (cyclomatic 32) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:772 — _ChunkedJsonParser.parse has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseFields (cyclomatic 32) · ×1
  • Parser.parseFields (cyclomatic 32) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4450 — Parser.parseFields has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addStaticMembers (cyclomatic 32) · ×1
  • DeclarationHelper._addStaticMembers (cyclomatic 32) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1638 — DeclarationHelper._addStaticMembers has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImportOrganizer._organizeDirectives (cyclomatic 32) · ×1
  • ImportOrganizer._organizeDirectives (cyclomatic 32) pkg/analysis_server/lib/src/services/correction/organize_imports.dart:85 — ImportOrganizer._organizeDirectives has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpressionImpl.constantContext (cyclomatic 32) · ×1
  • ExpressionImpl.constantContext (cyclomatic 32) pkg/analyzer/lib/src/dart/ast/ast.dart:19584 — ExpressionImpl.constantContext has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _TodoFinder._check (cyclomatic 32) · ×1
  • _TodoFinder._check (cyclomatic 32) pkg/analyzer/lib/src/error/todo_finder.dart:224 — _TodoFinder._check has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiVerifier._checkFfiNativeFunction (cyclomatic 32) · ×1
  • FfiVerifier._checkFfiNativeFunction (cyclomatic 32) pkg/analyzer/lib/src/generated/ffi_verifier.dart:811 — FfiVerifier._checkFfiNativeFunction has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver._analyzeAll (cyclomatic 32) · ×1
  • Driver._analyzeAll (cyclomatic 32) pkg/analyzer_cli/lib/src/driver.dart:145 — Driver._analyzeAll has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferrerEngine._runOverAllElements (cyclomatic 32) · ×1
  • InferrerEngine._runOverAllElements (cyclomatic 32) pkg/compiler/lib/src/inferrer/engine.dart:358 — InferrerEngine._runOverAllElements has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaSimplifyInterceptors.visitInterceptor (cyclomatic 32) · ×1
  • SsaSimplifyInterceptors.visitInterceptor (cyclomatic 32) pkg/compiler/lib/src/ssa/interceptor_simplifier.dart:235 — SsaSimplifyInterceptors.visitInterceptor has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuildCliSubcommand.doBuild (cyclomatic 32) · ×1
  • BuildCliSubcommand.doBuild (cyclomatic 32) pkg/dartdev/lib/src/commands/build.dart:339 — BuildCliSubcommand.doBuild has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstructorDeclarationMixin._finalizeSuperInitializingFormals (cyclomatic 32) · ×1
  • _ConstructorDeclarationMixin._finalizeSuperInitializingFormals (cyclomatic 32) pkg/front_end/lib/src/fragment/constructor/declaration.dart:292 — _ConstructorDeclarationMixin._finalizeSuperInitializingFormals has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitObjectPattern (cyclomatic 32) · ×1
  • InferenceVisitorImpl.visitObjectPattern (cyclomatic 32) pkg/front_end/lib/src/type_inference/inference_visitor.dart:12695 — InferenceVisitorImpl.visitObjectPattern has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BestEffortParserAstVisitor.accept (cyclomatic 32) · ×1
  • BestEffortParserAstVisitor.accept (cyclomatic 32) pkg/front_end/lib/src/util/parser_ast.dart:124 — BestEffortParserAstVisitor.accept has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor._check (cyclomatic 32) · ×1
  • _Visitor._check (cyclomatic 32) pkg/linter/lib/src/rules/prefer_is_empty.dart:66 — _Visitor._check has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Instance._update (cyclomatic 32) · ×1
  • Instance._update (cyclomatic 32) pkg/observatory/lib/src/service/object.dart:3023 — Instance._update has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ServiceObject._fromMap (cyclomatic 50) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ClassIdNumbering._number (cyclomatic 31) · ×1
  • ClassIdNumbering._number (cyclomatic 31) pkg/dart2wasm/lib/class_info.dart:819 — ClassIdNumbering._number has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserCreatorListener.endMethod (cyclomatic 31) · ×1
  • ParserCreatorListener.endMethod (cyclomatic 31) pkg/front_end/tool/parser_ast_helper_creator.dart:259 — ParserCreatorListener.endMethod has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scrape._processPath (cyclomatic 31) · ×1
  • Scrape._processPath (cyclomatic 31) pkg/scrape/lib/scrape.dart:233 — Scrape._processPath has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _BigIntImpl.modPow (cyclomatic 31) · ×1
  • _BigIntImpl.modPow (cyclomatic 31) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1939 — _BigIntImpl.modPow has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProdWasmInstructionLowerer.canHandle (cyclomatic 31) · ×1
  • ProdWasmInstructionLowerer.canHandle (cyclomatic 31) pkg/dart2wasm/lib/prod/cfg/to_wasm.dart:82 — ProdWasmInstructionLowerer.canHandle has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Evaluator._visitElements (cyclomatic 31) · ×1
  • Evaluator._visitElements (cyclomatic 31) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:443 — Evaluator._visitElements has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Evaluator._isNull (cyclomatic 34) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TypeConstraintGenerator.performSubtypeConstraintGenerationInternal (cyclomatic 31) · ×1
  • TypeConstraintGenerator.performSubtypeConstraintGenerationInternal (cyclomatic 31) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:2170 — TypeConstraintGenerator.performSubtypeConstraintGenerationInternal has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ColorComputer.getExpressionColorObject (cyclomatic 31) · ×1
  • ColorComputer.getExpressionColorObject (cyclomatic 31) pkg/analysis_server/lib/src/computer/computer_color.dart:115 — ColorComputer.getExpressionColorObject has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addLocalDeclarations (cyclomatic 31) · ×1
  • DeclarationHelper._addLocalDeclarations (cyclomatic 31) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1314 — DeclarationHelper._addLocalDeclarations has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitExpressionStatement (cyclomatic 31) · ×1
  • InScopeCompletionPass.visitExpressionStatement (cyclomatic 31) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1168 — InScopeCompletionPass.visitExpressionStatement has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToFunctionDeclaration.compute (cyclomatic 31) · ×1
  • ConvertToFunctionDeclaration.compute (cyclomatic 31) pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart:30 — ConvertToFunctionDeclaration.compute has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PropertyElementResolver.resolveCascadeIndex (cyclomatic 31) · ×1
  • PropertyElementResolver.resolveCascadeIndex (cyclomatic 31) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:53 — PropertyElementResolver.resolveCascadeIndex has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeBehavior.processSpecString (cyclomatic 31) · ×1
  • NativeBehavior.processSpecString (cyclomatic 31) pkg/compiler/lib/src/native/behavior.dart:221 — NativeBehavior.processSpecString has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder.build (cyclomatic 31) · ×1
  • KernelSsaGraphBuilder.build (cyclomatic 31) pkg/compiler/lib/src/ssa/builder.dart:461 — KernelSsaGraphBuilder.build has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaAssignmentChaining.tryChainAssignment (cyclomatic 31) · ×1
  • SsaAssignmentChaining.tryChainAssignment (cyclomatic 31) pkg/compiler/lib/src/ssa/codegen_helpers.dart:687 — SsaAssignmentChaining.tryChainAssignment has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassHierarchyImpl.commonSubclasses (cyclomatic 31) · ×1
  • ClassHierarchyImpl.commonSubclasses (cyclomatic 31) pkg/compiler/lib/src/universe/class_hierarchy.dart:449 — ClassHierarchyImpl.commonSubclasses has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaticUse.shortText (cyclomatic 31) · ×1
  • StaticUse.shortText (cyclomatic 31) pkg/compiler/lib/src/universe/use.dart:319 — StaticUse.shortText has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ProgramCompiler._emitClassSignature (cyclomatic 31) · ×1
  • ProgramCompiler._emitClassSignature (cyclomatic 31) pkg/dev_compiler/lib/src/kernel/compiler.dart:1816 — ProgramCompiler._emitClassSignature has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitClassSignature (cyclomatic 31) · ×1
  • LibraryCompiler._emitClassSignature (cyclomatic 31) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2113 — LibraryCompiler._emitClassSignature has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Modifiers.from (cyclomatic 31) · ×1
  • Modifiers.from (cyclomatic 31) pkg/front_end/lib/src/base/modifiers.dart:97 — Modifiers.from has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CfeTypeOperations.getPropertyTypes (cyclomatic 31) · ×1
  • CfeTypeOperations.getPropertyTypes (cyclomatic 31) pkg/front_end/lib/src/kernel/exhaustiveness.dart:126 — CfeTypeOperations.getPropertyTypes has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceClassBuilder.checkOverride (cyclomatic 31) · ×1
  • SourceClassBuilder.checkOverride (cyclomatic 31) pkg/front_end/lib/src/source/source_class_builder.dart:1438 — SourceClassBuilder.checkOverride has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase.inferLocalFunction (cyclomatic 31) · ×1
  • InferenceVisitorBase.inferLocalFunction (cyclomatic 31) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2225 — InferenceVisitorBase.inferLocalFunction has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.getInvalidJsInteropTypeTest (cyclomatic 31) · ×1
  • _Visitor.getInvalidJsInteropTypeTest (cyclomatic 31) pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:324 — _Visitor.getInvalidJsInteropTypeTest has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Event.toJson (cyclomatic 31) · ×1
  • Event.toJson (cyclomatic 31) pkg/vm_service/lib/src/vm_service.dart:4183 — Event.toJson has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Instructions.printTo (cyclomatic 31) · ×1
  • Instructions.printTo (cyclomatic 31) pkg/wasm_builder/lib/src/ir/instructions.dart:129 — Instructions.printTo has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HttpClientConnection.send (cyclomatic 30) · ×1
  • _HttpClientConnection.send (cyclomatic 30) sdk/lib/_http/http_impl.dart:2330 — _HttpClientConnection.send has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · IrToText._printInputs (cyclomatic 30) · ×1
  • IrToText._printInputs (cyclomatic 30) pkg/cfg/lib/ir/ir_to_text.dart:112 — IrToText._printInputs 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.
D1 · Cyclomatic Complexity · DeeplyImmutableValidator._validateDeeplyImmutable (cyclomatic 30) · ×1
  • DeeplyImmutableValidator._validateDeeplyImmutable (cyclomatic 30) pkg/vm/lib/modular/transformations/deeply_immutable.dart:129 — DeeplyImmutableValidator._validateDeeplyImmutable has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Evaluator._visitElement (cyclomatic 30) · ×1
  • Evaluator._visitElement (cyclomatic 30) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:552 — Evaluator._visitElement 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. This is NOT this file's highest cyclomatic complexity: Evaluator._isNull (cyclomatic 34) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ComplexTypeParamOrArgInfo.parseUnexpectedEnd (cyclomatic 30) · ×1
  • ComplexTypeParamOrArgInfo.parseUnexpectedEnd (cyclomatic 30) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1613 — ComplexTypeParamOrArgInfo.parseUnexpectedEnd has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractScanner._spacesAtStartOfLogicalLineOf (cyclomatic 30) · ×1
  • AbstractScanner._spacesAtStartOfLogicalLineOf (cyclomatic 30) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:403 — AbstractScanner._spacesAtStartOfLogicalLineOf has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _EnumDescription._validateFields (cyclomatic 30) · ×1
  • _EnumDescription._validateFields (cyclomatic 30) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:653 — _EnumDescription._validateFields has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtractMethodRefactoringImpl.buildChange (cyclomatic 30) · ×1
  • ExtractMethodRefactoringImpl.buildChange (cyclomatic 30) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:190 — ExtractMethodRefactoringImpl.buildChange has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemberDuplicateDefinitionVerifier._checkClassMembers (cyclomatic 30) · ×1
  • MemberDuplicateDefinitionVerifier._checkClassMembers (cyclomatic 30) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:48 — MemberDuplicateDefinitionVerifier._checkClassMembers has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeTypesSubstitutionsMixin._computeChecks (cyclomatic 30) · ×1
  • RuntimeTypesSubstitutionsMixin._computeChecks (cyclomatic 30) pkg/compiler/lib/src/js_backend/runtime_types.dart:120 — RuntimeTypesSubstitutionsMixin._computeChecks has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeTypesImpl.computeRequiredChecks (cyclomatic 30) · ×1
  • RuntimeTypesImpl.computeRequiredChecks (cyclomatic 30) pkg/compiler/lib/src/js_backend/runtime_types.dart:534 — RuntimeTypesImpl.computeRequiredChecks has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SsaConditionMerger.visitBasicBlock (cyclomatic 30) · ×1
  • SsaConditionMerger.visitBasicBlock (cyclomatic 30) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1303 — SsaConditionMerger.visitBasicBlock has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamedTypeBuilderImpl.findRawTypesWithInboundReferences (cyclomatic 30) · ×1
  • NamedTypeBuilderImpl.findRawTypesWithInboundReferences (cyclomatic 30) pkg/front_end/lib/src/builder/named_type_builder.dart:1156 — NamedTypeBuilderImpl.findRawTypesWithInboundReferences has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: NamedTypeBuilderImpl._checkDeferred (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitSpreadElement (cyclomatic 30) · ×1
  • InferenceVisitorImpl.visitSpreadElement (cyclomatic 30) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4552 — InferenceVisitorImpl.visitSpreadElement has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorImpl._computeIndexGet (cyclomatic 30) · ×1
  • InferenceVisitorImpl._computeIndexGet (cyclomatic 30) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8077 — InferenceVisitorImpl._computeIndexGet 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. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorBase.inferPropertySet (cyclomatic 30) · ×1
  • InferenceVisitorBase.inferPropertySet (cyclomatic 30) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:4594 — InferenceVisitorBase.inferPropertySet 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.
D1 · Cyclomatic Complexity · ParserASTListener.seen (cyclomatic 30) · ×1
  • ParserASTListener.seen (cyclomatic 30) pkg/front_end/lib/src/util/parser_ast.dart:1755 — ParserASTListener.seen has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _Transform.transformCall (cyclomatic 30) · ×1
  • _Transform.transformCall (cyclomatic 30) pkg/vm/lib/transformations/type_flow/signature_shaking.dart:608 — _Transform.transformCall has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.html.applySettings (cyclomatic 30) · ×1
  • index.html.applySettings (cyclomatic 30) pkg/vm_snapshot_analysis/lib/src/assets/index.html:258 — index.html.applySettings has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 5 function items inside it that branch (filter, a function literal at line 278, a function literal at line 290, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · FunctionDeclaration.toString (cyclomatic 29) · ×1
  • FunctionDeclaration.toString (cyclomatic 29) pkg/dart2bytecode/lib/declarations.dart:710 — FunctionDeclaration.toString has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DartdevRunner.runCommand (cyclomatic 29) · ×1
  • DartdevRunner.runCommand (cyclomatic 29) pkg/dartdev/lib/dartdev.dart:212 — DartdevRunner.runCommand has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WasmInstructionLowerer.visitComparison (cyclomatic 29) · ×1
  • WasmInstructionLowerer.visitComparison (cyclomatic 29) pkg/dart2wasm/lib/cfg/to_wasm.dart:310 — WasmInstructionLowerer.visitComparison has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModifierContext.parseFormalParameterModifiers (cyclomatic 29) · ×1
  • ModifierContext.parseFormalParameterModifiers (cyclomatic 29) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:205 — ModifierContext.parseFormalParameterModifiers has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parsePrimaryConstructorOpt (cyclomatic 29) · ×1
  • Parser.parsePrimaryConstructorOpt (cyclomatic 29) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3794 — Parser.parsePrimaryConstructorOpt has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FeaturesDataInterpreter.isAsExpected (cyclomatic 29) · ×1
  • FeaturesDataInterpreter.isAsExpected (cyclomatic 29) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:252 — FeaturesDataInterpreter.isAsExpected has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddMissingRequiredArgument.compute (cyclomatic 29) · ×1
  • AddMissingRequiredArgument.compute (cyclomatic 29) pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart:48 — AddMissingRequiredArgument.compute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveAsync.compute (cyclomatic 29) · ×1
  • RemoveAsync.compute (cyclomatic 29) pkg/analysis_server/lib/src/services/correction/dart/remove_async.dart:38 — RemoveAsync.compute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ParsedLinterData._parseLocalRules (cyclomatic 29) · ×1
  • _ParsedLinterData._parseLocalRules (cyclomatic 29) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1209 — _ParsedLinterData._parseLocalRules has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConstantEvaluationEngine.computeDependencies (cyclomatic 29) · ×1
  • ConstantEvaluationEngine.computeDependencies (cyclomatic 29) pkg/analyzer/lib/src/dart/constant/evaluation.dart:221 — ConstantEvaluationEngine.computeDependencies has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseOrFinalTypeVerifier._reportRestrictionError (cyclomatic 29) · ×1
  • BaseOrFinalTypeVerifier._reportRestrictionError (cyclomatic 29) pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart:174 — BaseOrFinalTypeVerifier._reportRestrictionError has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReturnTypeVerifier._checkReturnExpression (cyclomatic 29) · ×1
  • ReturnTypeVerifier._checkReturnExpression (cyclomatic 29) pkg/analyzer/lib/src/error/return_type_verifier.dart:122 — ReturnTypeVerifier._checkReturnExpression has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _TodoFinder.moveNext (cyclomatic 29) · ×1
  • _TodoFinder.moveNext (cyclomatic 29) pkg/analyzer/lib/src/error/todo_finder.dart:163 — _TodoFinder.moveNext has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OnlineJavaScriptTracer._handleNotifySteps (cyclomatic 29) · ×1
  • OnlineJavaScriptTracer._handleNotifySteps (cyclomatic 29) pkg/compiler/lib/src/io/position_information.dart:1644 — OnlineJavaScriptTracer._handleNotifySteps has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FormattingDiagnosticHandler.report (cyclomatic 29) · ×1
  • FormattingDiagnosticHandler.report (cyclomatic 29) pkg/compiler/lib/src/source_file_provider.dart:246 — FormattingDiagnosticHandler.report has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartDebugAdapter.evaluateRequest (cyclomatic 29) · ×1
  • DartDebugAdapter.evaluateRequest (cyclomatic 29) pkg/dap_adapters/lib/src/adapters/dart.dart:1052 — DartDebugAdapter.evaluateRequest has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SetupFlutterCommand.run (cyclomatic 29) · ×1
  • SetupFlutterCommand.run (cyclomatic 29) pkg/dartpad/lib/src/setup/flutter.dart:81 — SetupFlutterCommand.run has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler._computeExpressionCompilationScopeData (cyclomatic 29) · ×1
  • IncrementalCompiler._computeExpressionCompilationScopeData (cyclomatic 29) pkg/front_end/lib/src/base/incremental_compiler.dart:2503 — IncrementalCompiler._computeExpressionCompilationScopeData has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator.visitStaticInvocation (cyclomatic 29) · ×1
  • ConstantEvaluator.visitStaticInvocation (cyclomatic 29) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5181 — ConstantEvaluator.visitStaticInvocation has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuilderFactory._createDeclarationFromFragment (cyclomatic 29) · ×1
  • BuilderFactory._createDeclarationFromFragment (cyclomatic 29) pkg/front_end/lib/src/source/builder_factory.dart:577 — BuilderFactory._createDeclarationFromFragment has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · InferenceVisitorImpl._computeBinaryExpression (cyclomatic 29) · ×1
  • InferenceVisitorImpl._computeBinaryExpression (cyclomatic 29) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7682 — InferenceVisitorImpl._computeBinaryExpression has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ServiceEvent._update (cyclomatic 29) · ×1
  • ServiceEvent._update (cyclomatic 29) pkg/observatory/lib/src/service/object.dart:2342 — ServiceEvent._update has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ServiceObject._fromMap (cyclomatic 50) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AnnotateKernel._annotateCallSite (cyclomatic 29) · ×1
  • AnnotateKernel._annotateCallSite (cyclomatic 29) pkg/vm/lib/transformations/type_flow/transformer.dart:789 — AnnotateKernel._annotateCallSite has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · minimize.minimize (cyclomatic 29) · ×1
  • minimize.minimize (cyclomatic 29) runtime/tools/dartfuzz/minimize.py:198 — minimize.minimize has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogPlayer.play (cyclomatic 28) · ×1
  • LogPlayer.play (cyclomatic 28) pkg/analysis_server/tool/log_player/log_player.dart:63 — LogPlayer.play has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DevToolsServer._serveDevToolsWithArgs (cyclomatic 28) · ×1
  • DevToolsServer._serveDevToolsWithArgs (cyclomatic 28) pkg/dart_runtime_service_dds/lib/devtools_server.dart:547 — DevToolsServer._serveDevToolsWithArgs has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _TypeUniverse.isSubtype (cyclomatic 28) · ×1
  • _TypeUniverse.isSubtype (cyclomatic 28) sdk/lib/_internal/wasm/common/type.dart:1360 — _TypeUniverse.isSubtype has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantFolding.unaryDoubleOp (cyclomatic 28) · ×1
  • ConstantFolding.unaryDoubleOp (cyclomatic 28) pkg/cfg/lib/ir/constant_value.dart:199 — ConstantFolding.unaryDoubleOp has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StackChecker.checkStackStateForAssert (cyclomatic 28) · ×1
  • StackChecker.checkStackStateForAssert (cyclomatic 28) pkg/_fe_analyzer_shared/lib/src/util/stack_checker.dart:93 — StackChecker.checkStackStateForAssert has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddDiagnosticPropertyReference.compute (cyclomatic 28) · ×1
  • AddDiagnosticPropertyReference.compute (cyclomatic 28) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:37 — AddDiagnosticPropertyReference.compute has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _AddDigitSeparators.compute (cyclomatic 28) · ×1
  • _AddDigitSeparators.compute (cyclomatic 28) pkg/analysis_server/lib/src/services/correction/dart/add_digit_separators.dart:67 — _AddDigitSeparators.compute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Validator.run (cyclomatic 28) · ×1
  • _Validator.run (cyclomatic 28) pkg/analyzer/lib/src/wolf/ir/validator.dart:198 — _Validator.run has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LibraryCompiler._defineClass (cyclomatic 28) · ×1
  • LibraryCompiler._defineClass (cyclomatic 28) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1792 — LibraryCompiler._defineClass has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DillLibraryBuilder.finalizeExports (cyclomatic 28) · ×1
  • DillLibraryBuilder.finalizeExports (cyclomatic 28) pkg/front_end/lib/src/dill/dill_library_builder.dart:437 — DillLibraryBuilder.finalizeExports has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.endFormalParameter (cyclomatic 28) · ×1
  • BodyBuilderImpl.endFormalParameter (cyclomatic 28) pkg/front_end/lib/src/kernel/body_builder.dart:3754 — BodyBuilderImpl.endFormalParameter has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _PropertyPreBuilder.absorbFragment (cyclomatic 28) · ×1
  • _PropertyPreBuilder.absorbFragment (cyclomatic 28) pkg/front_end/lib/src/source/builder_factory.dart:2320 — _PropertyPreBuilder.absorbFragment has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceTypeAliasBuilder.buildTypedefTearOffs (cyclomatic 28) · ×1
  • SourceTypeAliasBuilder.buildTypedefTearOffs (cyclomatic 28) pkg/front_end/lib/src/source/source_type_alias_builder.dart:467 — SourceTypeAliasBuilder.buildTypedefTearOffs has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl._computeUnaryExpression (cyclomatic 28) · ×1
  • InferenceVisitorImpl._computeUnaryExpression (cyclomatic 28) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7899 — InferenceVisitorImpl._computeUnaryExpression has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitRecordLiteral (cyclomatic 28) · ×1
  • InferenceVisitorImpl.visitRecordLiteral (cyclomatic 28) pkg/front_end/lib/src/type_inference/inference_visitor.dart:11098 — InferenceVisitorImpl.visitRecordLiteral has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _ObjectAccessDescriptor._findNonExtensionTargetInternal (cyclomatic 28) · ×1
  • _ObjectAccessDescriptor._findNonExtensionTargetInternal (cyclomatic 28) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:6365 — _ObjectAccessDescriptor._findNonExtensionTargetInternal has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ObservatoryDebugger.onEvent (cyclomatic 28) · ×1
  • ObservatoryDebugger.onEvent (cyclomatic 28) pkg/observatory/lib/src/elements/debugger.dart:1740 — ObservatoryDebugger.onEvent has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PRESUBMIT._CheckPackagePublish (cyclomatic 28) · ×1
  • PRESUBMIT._CheckPackagePublish (cyclomatic 28) PRESUBMIT.py:693 — PRESUBMIT._CheckPackagePublish has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionLogAnalyzer.printReport (cyclomatic 27) · ×1
  • SessionLogAnalyzer.printReport (cyclomatic 27) pkg/analysis_server/.agents/skills/improve-performance-with-session-log/scripts/analyze_session_log.dart:116 — SessionLogAnalyzer.printReport has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartDevelopmentServiceLauncher.start (cyclomatic 27) · ×1
  • DartDevelopmentServiceLauncher.start (cyclomatic 27) pkg/dds/lib/dds_launcher.dart:52 — DartDevelopmentServiceLauncher.start has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Configuration.optionsEqual (cyclomatic 27) · ×1
  • Configuration.optionsEqual (cyclomatic 27) pkg/smith/lib/configuration.dart:562 — Configuration.optionsEqual has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · StatusFile._parse (cyclomatic 27) · ×1
  • StatusFile._parse (cyclomatic 27) pkg/status_file/lib/canonical_status_file.dart:93 — StatusFile._parse has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Utf8Decoder.convertChunked (cyclomatic 27) · ×1
  • _Utf8Decoder.convertChunked (cyclomatic 27) sdk/lib/_internal/vm/lib/convert_patch.dart:1869 — _Utf8Decoder.convertChunked has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitCompareAndBranch (cyclomatic 27) · ×1
  • Arm64CodeGenerator.visitCompareAndBranch (cyclomatic 27) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:374 — Arm64CodeGenerator.visitCompareAndBranch has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Arm64CodeGenerator.visitUnaryDoubleOp (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LinearScanRegisterAllocator.buildLiveRanges (cyclomatic 27) · ×1
  • LinearScanRegisterAllocator.buildLiveRanges (cyclomatic 27) pkg/native_compiler/lib/back_end/register_allocator.dart:190 — LinearScanRegisterAllocator.buildLiveRanges has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parsePrimaryPattern (cyclomatic 27) · ×1
  • Parser.parsePrimaryPattern (cyclomatic 27) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11675 — Parser.parsePrimaryPattern has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RenameHandler.handle (cyclomatic 27) · ×1
  • RenameHandler.handle (cyclomatic 27) pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:127 — RenameHandler.handle has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageScheduler.add (cyclomatic 27) · ×1
  • MessageScheduler.add (cyclomatic 27) pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:70 — MessageScheduler.add has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitClassDeclaration (cyclomatic 27) · ×1
  • InScopeCompletionPass.visitClassDeclaration (cyclomatic 27) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:652 — InScopeCompletionPass.visitClassDeclaration has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToFlutterStyleTodo.compute (cyclomatic 27) · ×1
  • ConvertToFlutterStyleTodo.compute (cyclomatic 27) pkg/analysis_server/lib/src/services/correction/dart/convert_to_flutter_style_todo.dart:26 — ConvertToFlutterStyleTodo.compute has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToInitializingFormal.compute (cyclomatic 27) · ×1
  • ConvertToInitializingFormal.compute (cyclomatic 27) pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart:40 — ConvertToInitializingFormal.compute has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MoveTopLevelToFile._membersToMove (cyclomatic 27) · ×1
  • MoveTopLevelToFile._membersToMove (cyclomatic 27) pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart:270 — MoveTopLevelToFile._membersToMove has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstLiteralVerifier.verify (cyclomatic 27) · ×1
  • _ConstLiteralVerifier.verify (cyclomatic 27) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1301 — _ConstLiteralVerifier.verify has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstructorInvocationEvaluator._checkInitializers (cyclomatic 27) · ×1
  • _ConstructorInvocationEvaluator._checkInitializers (cyclomatic 27) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3150 — _ConstructorInvocationEvaluator._checkInitializers has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer.resolveArgumentsToParameters (cyclomatic 27) · ×1
  • TypeAnalyzer.resolveArgumentsToParameters (cyclomatic 27) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5826 — TypeAnalyzer.resolveArgumentsToParameters has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary (cyclomatic 27) · ×1
  • ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary (cyclomatic 27) pkg/analyzer/lib/src/generated/error_verifier.dart:5598 — ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompletionTarget.computeReplacementRange (cyclomatic 27) · ×1
  • CompletionTarget.computeReplacementRange (cyclomatic 27) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:487 — CompletionTarget.computeReplacementRange has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodegenEnqueuerListener._processClass (cyclomatic 27) · ×1
  • CodegenEnqueuerListener._processClass (cyclomatic 27) pkg/compiler/lib/src/js_backend/codegen_listener.dart:333 — CodegenEnqueuerListener._processClass has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CodegenWorldBuilder.generateParameterStubs (cyclomatic 27) · ×1
  • CodegenWorldBuilder.generateParameterStubs (cyclomatic 27) pkg/compiler/lib/src/universe/codegen_world_builder.dart:674 — CodegenWorldBuilder.generateParameterStubs has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProtocolConverter.convertVmToDapStackFrame (cyclomatic 27) · ×1
  • ProtocolConverter.convertVmToDapStackFrame (cyclomatic 27) pkg/dap_adapters/lib/src/protocol_converter.dart:612 — ProtocolConverter.convertVmToDapStackFrame has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ExpressionCompiler.compileExpressionToJs (cyclomatic 27) · ×1
  • ExpressionCompiler.compileExpressionToJs (cyclomatic 27) pkg/dev_compiler/lib/src/kernel/expression_compiler.dart:68 — ExpressionCompiler.compileExpressionToJs has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.beginSwitchCase (cyclomatic 27) · ×1
  • BodyBuilderImpl.beginSwitchCase (cyclomatic 27) pkg/front_end/lib/src/kernel/body_builder.dart:957 — BodyBuilderImpl.beginSwitchCase has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.endSwitchCase (cyclomatic 27) · ×1
  • BodyBuilderImpl.endSwitchCase (cyclomatic 27) pkg/front_end/lib/src/kernel/body_builder.dart:5447 — BodyBuilderImpl.endSwitchCase has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _InitializerBuilder._createImplicitSuperInitializer (cyclomatic 27) · ×1
  • _InitializerBuilder._createImplicitSuperInitializer (cyclomatic 27) pkg/front_end/lib/src/kernel/resolver_helpers.dart:574 — _InitializerBuilder._createImplicitSuperInitializer has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl._checkElement (cyclomatic 27) · ×1
  • InferenceVisitorImpl._checkElement (cyclomatic 27) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4151 — InferenceVisitorImpl._checkElement has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · NodeCreator._generateBodies (cyclomatic 27) · ×1
  • NodeCreator._generateBodies (cyclomatic 27) pkg/kernel/lib/src/node_creator.dart:173 — NodeCreator._generateBodies has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: NodeCreator._createExpressionFromKind (cyclomatic 70) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _Visitor.visitNamedType (cyclomatic 27) · ×1
  • _Visitor.visitNamedType (cyclomatic 27) pkg/linter/lib/src/rules/prefer_void_to_null.dart:58 — _Visitor.visitNamedType has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HeapSnapshotElement._createReport (cyclomatic 27) · ×1
  • HeapSnapshotElement._createReport (cyclomatic 27) pkg/observatory/lib/src/elements/heap_snapshot.dart:670 — HeapSnapshotElement._createReport has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChainContext.run (cyclomatic 27) · ×1
  • ChainContext.run (cyclomatic 27) pkg/testing/lib/src/chain.dart:149 — ChainContext.run has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PragmaEntryPointsVisitor.visitProcedure (cyclomatic 27) · ×1
  • PragmaEntryPointsVisitor.visitProcedure (cyclomatic 27) pkg/vm/lib/transformations/type_flow/native_code.dart:146 — PragmaEntryPointsVisitor.visitProcedure has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._tryFixingMethodInvocation (cyclomatic 26) · ×1
  • _Visitor._tryFixingMethodInvocation (cyclomatic 26) pkg/analyzer_utilities/tool/messages/use_literate_api_in_analyzer.dart:211 — _Visitor._tryFixingMethodInvocation has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BytecodeGenerator._genPrologue (cyclomatic 26) · ×1
  • BytecodeGenerator._genPrologue (cyclomatic 26) pkg/dart2bytecode/lib/bytecode_generator.dart:2157 — BytecodeGenerator._genPrologue 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. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DynamicDispatchTable._lookupTarget (cyclomatic 26) · ×1
  • DynamicDispatchTable._lookupTarget (cyclomatic 26) pkg/dart2wasm/lib/dynamic_dispatch_table.dart:141 — DynamicDispatchTable._lookupTarget has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DevToolsServer._serveDevToolsWithArgs (cyclomatic 26) · ×1
  • DevToolsServer._serveDevToolsWithArgs (cyclomatic 26) pkg/dds/lib/devtools_server.dart:510 — DevToolsServer._serveDevToolsWithArgs has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClosedWorldClassHierarchy.applyTreeChanges (cyclomatic 26) · ×1
  • ClosedWorldClassHierarchy.applyTreeChanges (cyclomatic 26) pkg/kernel/lib/class_hierarchy.dart:1264 — ClosedWorldClassHierarchy.applyTreeChanges has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · int._parseRadix (cyclomatic 26) · ×1
  • int._parseRadix (cyclomatic 26) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:157 — int._parseRadix has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SimpleUri._simpleMerge (cyclomatic 26) · ×1
  • _SimpleUri._simpleMerge (cyclomatic 26) sdk/lib/core/uri.dart:4862 — _SimpleUri._simpleMerge has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpressionIdentifierContext.ensureIdentifier (cyclomatic 26) · ×1
  • ExpressionIdentifierContext.ensureIdentifier (cyclomatic 26) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:390 — ExpressionIdentifierContext.ensureIdentifier has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · Parser.parseTypedef (cyclomatic 26) · ×1
  • Parser.parseTypedef (cyclomatic 26) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:1449 — Parser.parseTypedef has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartCompletionRequest.targetPrefix (cyclomatic 26) · ×1
  • DartCompletionRequest.targetPrefix (cyclomatic 26) pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart:451 — DartCompletionRequest.targetPrefix has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addMembersOfEnclosingInstance (cyclomatic 26) · ×1
  • DeclarationHelper._addMembersOfEnclosingInstance (cyclomatic 26) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1463 — DeclarationHelper._addMembersOfEnclosingInstance has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitForStatement (cyclomatic 26) · ×1
  • InScopeCompletionPass.visitForStatement (cyclomatic 26) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1601 — InScopeCompletionPass.visitForStatement has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitSwitchPatternCase (cyclomatic 26) · ×1
  • InScopeCompletionPass.visitSwitchPatternCase (cyclomatic 26) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3154 — InScopeCompletionPass.visitSwitchPatternCase has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateExtensionMethod.compute (cyclomatic 26) · ×1
  • CreateExtensionMethod.compute (cyclomatic 26) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:169 — CreateExtensionMethod.compute has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateOperator.compute (cyclomatic 26) · ×1
  • CreateOperator.compute (cyclomatic 26) pkg/analysis_server/lib/src/services/correction/dart/create_operator.dart:33 — CreateOperator.compute has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InlineTypedef.compute (cyclomatic 26) · ×1
  • InlineTypedef.compute (cyclomatic 26) pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart:32 — InlineTypedef.compute has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveUnusedParameter.compute (cyclomatic 26) · ×1
  • RemoveUnusedParameter.compute (cyclomatic 26) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart:27 — RemoveUnusedParameter.compute has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantVisitor._buildListConstant (cyclomatic 26) · ×1
  • ConstantVisitor._buildListConstant (cyclomatic 26) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1370 — ConstantVisitor._buildListConstant 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. This shape REPEATS in the file: one other method here (ConstantVisitor._buildSetConstant) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ConstantVisitor._buildSetConstant (cyclomatic 26) · ×1
  • ConstantVisitor._buildSetConstant (cyclomatic 26) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1612 — ConstantVisitor._buildSetConstant 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. This shape REPEATS in the file: one other method here (ConstantVisitor._buildListConstant) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ConstantVisitor._getConstantValue (cyclomatic 26) · ×1
  • ConstantVisitor._getConstantValue (cyclomatic 26) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1882 — ConstantVisitor._getConstantValue has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartEditBuilderImpl._writeType (cyclomatic 26) · ×1
  • DartEditBuilderImpl._writeType (cyclomatic 26) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1598 — DartEditBuilderImpl._writeType has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._handleInvokeStaticForeign (cyclomatic 26) · ×1
  • KernelSsaGraphBuilder._handleInvokeStaticForeign (cyclomatic 26) pkg/compiler/lib/src/ssa/builder.dart:5464 — KernelSsaGraphBuilder._handleInvokeStaticForeign has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SsaInstructionSelection.visitFieldSet (cyclomatic 26) · ×1
  • SsaInstructionSelection.visitFieldSet (cyclomatic 26) pkg/compiler/lib/src/ssa/codegen_helpers.dart:351 — SsaInstructionSelection.visitFieldSet has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaPhiConditioning.handlePhi (cyclomatic 26) · ×1
  • SsaPhiConditioning.handlePhi (cyclomatic 26) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1485 — SsaPhiConditioning.handlePhi has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConditionTargets._step (cyclomatic 26) · ×1
  • ConditionTargets._step (cyclomatic 26) pkg/compiler/lib/src/ssa/optimize.dart:4264 — ConditionTargets._step has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MiniJsParser.parseStatement (cyclomatic 26) · ×1
  • MiniJsParser.parseStatement (cyclomatic 26) pkg/dev_compiler/lib/src/js_ast/builder.dart:1421 — MiniJsParser.parseStatement has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler._emitBinaryOperator (cyclomatic 26) · ×1
  • ProgramCompiler._emitBinaryOperator (cyclomatic 26) pkg/dev_compiler/lib/src/kernel/compiler.dart:6338 — ProgramCompiler._emitBinaryOperator has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitBinaryOperator (cyclomatic 26) · ×1
  • LibraryCompiler._emitBinaryOperator (cyclomatic 26) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7027 — LibraryCompiler._emitBinaryOperator has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FutureOrNormalizer.visitFutureOrType (cyclomatic 26) · ×1
  • FutureOrNormalizer.visitFutureOrType (cyclomatic 26) pkg/dev_compiler/lib/src/kernel/future_or_normalizer.dart:34 — FutureOrNormalizer.visitFutureOrType has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · JSTypeRep.typeFor (cyclomatic 26) · ×1
  • JSTypeRep.typeFor (cyclomatic 26) pkg/dev_compiler/lib/src/kernel/js_typerep.dart:34 — JSTypeRep.typeFor has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _LibraryVirtualFieldModel.build (cyclomatic 26) · ×1
  • _LibraryVirtualFieldModel.build (cyclomatic 26) pkg/dev_compiler/lib/src/kernel/property_model.dart:61 — _LibraryVirtualFieldModel.build has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl._validateTypeParameterUseInternal (cyclomatic 26) · ×1
  • BodyBuilderImpl._validateTypeParameterUseInternal (cyclomatic 26) pkg/front_end/lib/src/kernel/body_builder.dart:11424 — BodyBuilderImpl._validateTypeParameterUseInternal has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ConstantEvaluator.visitInstanceGet (cyclomatic 26) · ×1
  • ConstantEvaluator.visitInstanceGet (cyclomatic 26) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4730 — ConstantEvaluator.visitInstanceGet has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassMembersNodeBuilder.inferMethodType (cyclomatic 26) · ×1
  • ClassMembersNodeBuilder.inferMethodType (cyclomatic 26) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:131 — ClassMembersNodeBuilder.inferMethodType has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OutlineBuilder.endMethod (cyclomatic 26) · ×1
  • OutlineBuilder.endMethod (cyclomatic 26) pkg/front_end/lib/src/source/outline_builder.dart:2371 — OutlineBuilder.endMethod has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstMapLiteralBuilder.translate (cyclomatic 26) · ×1
  • _ConstMapLiteralBuilder.translate (cyclomatic 26) pkg/front_end/lib/src/type_inference/collection_encoding.dart:333 — _ConstMapLiteralBuilder.translate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StandardBounds._getFunctionStandardLowerBound (cyclomatic 26) · ×1
  • StandardBounds._getFunctionStandardLowerBound (cyclomatic 26) pkg/kernel/lib/src/standard_bounds.dart:1098 — StandardBounds._getFunctionStandardLowerBound 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. This is NOT this file's highest cyclomatic complexity: StandardBounds.morebottom (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _KernelFromParsedType.visitNamedType (cyclomatic 26) · ×1
  • _KernelFromParsedType.visitNamedType (cyclomatic 26) pkg/kernel/lib/testing/type_parser_environment.dart:360 — _KernelFromParsedType.visitNamedType has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstrumentationLog._parseLogContent (cyclomatic 25) · ×1
  • InstrumentationLog._parseLogContent (cyclomatic 25) pkg/analysis_server/tool/instrumentation/log/log.dart:285 — InstrumentationLog._parseLogContent 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.
D1 · Cyclomatic Complexity · AstNodeImplGenerator._generateConstructor (cyclomatic 25) · ×1
  • AstNodeImplGenerator._generateConstructor (cyclomatic 25) pkg/analyzer/tool/generators/ast_generator.dart:616 — AstNodeImplGenerator._generateConstructor 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.
D1 · Cyclomatic Complexity · BytecodeGenerator.getFieldDeclaration (cyclomatic 25) · ×1
  • BytecodeGenerator.getFieldDeclaration (cyclomatic 25) pkg/dart2bytecode/lib/bytecode_generator.dart:520 — BytecodeGenerator.getFieldDeclaration has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AstCodeGenerator.visitSwitchStatement (cyclomatic 25) · ×1
  • AstCodeGenerator.visitSwitchStatement (cyclomatic 25) pkg/dart2wasm/lib/code_generator.dart:1443 — AstCodeGenerator.visitSwitchStatement 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.
D1 · Cyclomatic Complexity · DevToolsServer.serveDevTools (cyclomatic 25) · ×1
  • DevToolsServer.serveDevTools (cyclomatic 25) pkg/dds/lib/devtools_server.dart:260 — DevToolsServer.serveDevTools 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.
D1 · Cyclomatic Complexity · JSNumber._binaryGcd (cyclomatic 25) · ×1
  • JSNumber._binaryGcd (cyclomatic 25) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:533 — JSNumber._binaryGcd 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.
D1 · Cyclomatic Complexity · Primitives._generalApplyFunction (cyclomatic 25) · ×1
  • Primitives._generalApplyFunction (cyclomatic 25) sdk/lib/_internal/js_runtime/lib/js_helper.dart:1097 — Primitives._generalApplyFunction 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.
D1 · Cyclomatic Complexity · JSInt._binaryGcd (cyclomatic 25) · ×1
  • JSInt._binaryGcd (cyclomatic 25) sdk/lib/_internal/js_runtime/lib/js_number.dart:624 — JSInt._binaryGcd 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.
D1 · Cyclomatic Complexity · _Parser.parse (cyclomatic 25) · ×1
  • _Parser.parse (cyclomatic 25) sdk/lib/_internal/js_shared/lib/rti.dart:3041 — _Parser.parse has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _IntegerImplementation._binaryGcd (cyclomatic 25) · ×1
  • _IntegerImplementation._binaryGcd (cyclomatic 25) sdk/lib/_internal/vm/lib/integers.dart:444 — _IntegerImplementation._binaryGcd 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.
D1 · Cyclomatic Complexity · BoxedInt._binaryGcd (cyclomatic 25) · ×1
  • BoxedInt._binaryGcd (cyclomatic 25) sdk/lib/_internal/wasm/common/boxed_int.dart:338 — BoxedInt._binaryGcd 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.
D1 · Cyclomatic Complexity · _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument (cyclomatic 25) · ×1
  • _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument (cyclomatic 25) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:2271 — _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument 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.
D1 · Cyclomatic Complexity · TypeConstraintGenerator._handleNonGenericFunctionTypes (cyclomatic 25) · ×1
  • TypeConstraintGenerator._handleNonGenericFunctionTypes (cyclomatic 25) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:2571 — TypeConstraintGenerator._handleNonGenericFunctionTypes 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.
D1 · Cyclomatic Complexity · DartUnitHighlightsComputer._isCallMethod (cyclomatic 25) · ×1
  • DartUnitHighlightsComputer._isCallMethod (cyclomatic 25) pkg/analysis_server/lib/src/computer/computer_highlights.dart:682 — DartUnitHighlightsComputer._isCallMethod has cyclomatic complexity 25 (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.
D1 · Cyclomatic Complexity · FlutterOutlineComputer._createOutline (cyclomatic 25) · ×1
  • FlutterOutlineComputer._createOutline (cyclomatic 25) pkg/analysis_server/lib/src/flutter/flutter_outline_computer.dart:137 — FlutterOutlineComputer._createOutline 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.
D1 · Cyclomatic Complexity · _MinimalEditComputer.computeMinimalEdits (cyclomatic 25) · ×1
  • _MinimalEditComputer.computeMinimalEdits (cyclomatic 25) pkg/analysis_server/lib/src/lsp/source_edits.dart:297 — _MinimalEditComputer.computeMinimalEdits 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.
D1 · Cyclomatic Complexity · AddExplicitCast._computeTargetAndTypes (cyclomatic 25) · ×1
  • AddExplicitCast._computeTargetAndTypes (cyclomatic 25) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:122 — AddExplicitCast._computeTargetAndTypes 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.
D1 · Cyclomatic Complexity · AddLate.compute (cyclomatic 25) · ×1
  • AddLate.compute (cyclomatic 25) pkg/analysis_server/lib/src/services/correction/dart/add_late.dart:35 — AddLate.compute 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.
D1 · Cyclomatic Complexity · ConvertToCascade.compute (cyclomatic 25) · ×1
  • ConvertToCascade.compute (cyclomatic 25) pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart:26 — ConvertToCascade.compute 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.
D1 · Cyclomatic Complexity · TemplateContext._getInvocation (cyclomatic 25) · ×1
  • TemplateContext._getInvocation (cyclomatic 25) pkg/analysis_server/lib/src/services/correction/fix/data_driven/code_template.dart:81 — TemplateContext._getInvocation 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.
D1 · Cyclomatic Complexity · PubspecFixGenerator._addMissingDependency (cyclomatic 25) · ×1
  • PubspecFixGenerator._addMissingDependency (cyclomatic 25) pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart:147 — PubspecFixGenerator._addMissingDependency 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.
D1 · Cyclomatic Complexity · _ParsedExpressionBuilder.build (cyclomatic 25) · ×1
  • _ParsedExpressionBuilder.build (cyclomatic 25) pkg/analyzer/lib/src/dart/ast/ast.dart:64690 — _ParsedExpressionBuilder.build 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. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ConstantVerifier._validateSwitchExhaustiveness (cyclomatic 25) · ×1
  • ConstantVerifier._validateSwitchExhaustiveness (cyclomatic 25) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1073 — ConstantVerifier._validateSwitchExhaustiveness 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.
D1 · Cyclomatic Complexity · ConstantVisitor._buildMapConstant (cyclomatic 25) · ×1
  • ConstantVisitor._buildMapConstant (cyclomatic 25) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1492 — ConstantVisitor._buildMapConstant 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.
D1 · Cyclomatic Complexity · InheritanceManager3._getInterfaceClass (cyclomatic 25) · ×1
  • InheritanceManager3._getInterfaceClass (cyclomatic 25) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:638 — InheritanceManager3._getInterfaceClass 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.
D1 · Cyclomatic Complexity · FunctionReferenceResolver.resolveInstantiation (cyclomatic 25) · ×1
  • FunctionReferenceResolver.resolveInstantiation (cyclomatic 25) pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart:31 — FunctionReferenceResolver.resolveInstantiation 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.
D1 · Cyclomatic Complexity · FullInvocationInferrer.resolveInvocation (cyclomatic 25) · ×1
  • FullInvocationInferrer.resolveInvocation (cyclomatic 25) pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart:267 — FullInvocationInferrer.resolveInvocation 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.
D1 · Cyclomatic Complexity · LibraryManifestBuilder._buildManifests (cyclomatic 25) · ×1
  • LibraryManifestBuilder._buildManifests (cyclomatic 25) pkg/analyzer/lib/src/fine/library_manifest.dart:874 — LibraryManifestBuilder._buildManifests 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.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForWrongNumberOfParametersForOperator (cyclomatic 25) · ×1
  • ErrorVerifier._checkForWrongNumberOfParametersForOperator (cyclomatic 25) pkg/analyzer/lib/src/generated/error_verifier.dart:7845 — ErrorVerifier._checkForWrongNumberOfParametersForOperator has cyclomatic complexity 25 (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.
D1 · Cyclomatic Complexity · _OpTypeAstVisitor.visitArgumentList (cyclomatic 25) · ×1
  • _OpTypeAstVisitor.visitArgumentList (cyclomatic 25) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:211 — _OpTypeAstVisitor.visitArgumentList 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.
D1 · Cyclomatic Complexity · _OpTypeAstVisitor.visitRegularFormalParameter (cyclomatic 25) · ×1
  • _OpTypeAstVisitor.visitRegularFormalParameter (cyclomatic 25) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1511 — _OpTypeAstVisitor.visitRegularFormalParameter has cyclomatic complexity 25 (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.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.handleInterceptedCall (cyclomatic 25) · ×1
  • SsaInstructionSimplifier.handleInterceptedCall (cyclomatic 25) pkg/compiler/lib/src/ssa/optimize.dart:851 — SsaInstructionSimplifier.handleInterceptedCall 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.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitInvokeStatic (cyclomatic 25) · ×1
  • SsaInstructionSimplifier.visitInvokeStatic (cyclomatic 25) pkg/compiler/lib/src/ssa/optimize.dart:2238 — SsaInstructionSimplifier.visitInvokeStatic 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.
D1 · Cyclomatic Complexity · FixCommand.run (cyclomatic 25) · ×1
  • FixCommand.run (cyclomatic 25) pkg/dartdev/lib/src/commands/fix.dart:97 — FixCommand.run has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProgramCompiler._emitClassMethods (cyclomatic 25) · ×1
  • ProgramCompiler._emitClassMethods (cyclomatic 25) pkg/dev_compiler/lib/src/kernel/compiler.dart:2480 — ProgramCompiler._emitClassMethods 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.
D1 · Cyclomatic Complexity · DillClassBuilder.DillClassBuilder (cyclomatic 25) · ×1
  • DillClassBuilder.DillClassBuilder (cyclomatic 25) pkg/front_end/lib/src/dill/dill_class_builder.dart:40 — DillClassBuilder.DillClassBuilder 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.
D1 · Cyclomatic Complexity · ConstantsTransformer.visitSwitchExpression (cyclomatic 25) · ×1
  • ConstantsTransformer.visitSwitchExpression (cyclomatic 25) pkg/front_end/lib/src/kernel/constant_evaluator.dart:2002 — ConstantsTransformer.visitSwitchExpression 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.
D1 · Cyclomatic Complexity · OutlineBuilder.endConstructor (cyclomatic 25) · ×1
  • OutlineBuilder.endConstructor (cyclomatic 25) pkg/front_end/lib/src/source/outline_builder.dart:2589 — OutlineBuilder.endConstructor has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SourceLoader.checkClassSupertypes (cyclomatic 25) · ×1
  • SourceLoader.checkClassSupertypes (cyclomatic 25) pkg/front_end/lib/src/source/source_loader.dart:2085 — SourceLoader.checkClassSupertypes 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.
D1 · Cyclomatic Complexity · ResidentFrontendServer._generateCompilerOptions (cyclomatic 25) · ×1
  • ResidentFrontendServer._generateCompilerOptions (cyclomatic 25) pkg/frontend_server/lib/src/resident_frontend_server.dart:512 — ResidentFrontendServer._generateCompilerOptions has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor.visitClassDeclaration (cyclomatic 25) · ×1
  • _Visitor.visitClassDeclaration (cyclomatic 25) pkg/linter/lib/src/rules/diagnostic_describe_all_properties.dart:75 — _Visitor.visitClassDeclaration 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.
D1 · Cyclomatic Complexity · _DeclarationGatherer._addMembers (cyclomatic 25) · ×1
  • _DeclarationGatherer._addMembers (cyclomatic 25) pkg/linter/lib/src/rules/unreachable_from_main.dart:97 — _DeclarationGatherer._addMembers 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.
D1 · Cyclomatic Complexity · JsInteropChecks.visitClass (cyclomatic 24) · ×1
  • JsInteropChecks.visitClass (cyclomatic 24) pkg/_js_interop_checks/lib/js_interop_checks.dart:174 — JsInteropChecks.visitClass 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.
D1 · Cyclomatic Complexity · CompletionResult.group (cyclomatic 24) · ×1
  • CompletionResult.group (cyclomatic 24) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1777 — CompletionResult.group 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.
D1 · Cyclomatic Complexity · _BuilderGenerator._generateFinish (cyclomatic 24) · ×1
  • _BuilderGenerator._generateFinish (cyclomatic 24) pkg/analyzer/tool/summary/generate.dart:283 — _BuilderGenerator._generateFinish 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.
D1 · Cyclomatic Complexity · DevToolsServer.serveDevTools (cyclomatic 24) · ×1
  • DevToolsServer.serveDevTools (cyclomatic 24) pkg/dart_runtime_service_dds/lib/devtools_server.dart:274 — DevToolsServer.serveDevTools 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.
D1 · Cyclomatic Complexity · DebugInfoWriter._flushPending (cyclomatic 24) · ×1
  • DebugInfoWriter._flushPending (cyclomatic 24) pkg/wasm_builder/lib/debug_info.dart:371 — DebugInfoWriter._flushPending 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.
D1 · Cyclomatic Complexity · HttpDate._parse (cyclomatic 24) · ×1
  • HttpDate._parse (cyclomatic 24) sdk/lib/_http/http_date.dart:129 — HttpDate._parse 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.
D1 · Cyclomatic Complexity · double._tryParseDouble (cyclomatic 24) · ×1
  • double._tryParseDouble (cyclomatic 24) sdk/lib/_internal/vm/lib/double_patch.dart:16 — double._tryParseDouble 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.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitTypeCast (cyclomatic 24) · ×1
  • Arm64CodeGenerator.visitTypeCast (cyclomatic 24) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1670 — Arm64CodeGenerator.visitTypeCast has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Arm64CodeGenerator.visitUnaryDoubleOp (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BinaryPrinter.writeConstantTableEntry (cyclomatic 24) · ×1
  • BinaryPrinter.writeConstantTableEntry (cyclomatic 24) pkg/kernel/lib/binary/ast_to_binary.dart:232 — BinaryPrinter.writeConstantTableEntry has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AstToIr._buildPrologue (cyclomatic 24) · ×1
  • AstToIr._buildPrologue (cyclomatic 24) pkg/cfg/lib/front_end/ast_to_ir.dart:143 — AstToIr._buildPrologue 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.
D1 · Cyclomatic Complexity · _RawSecureSocket._tryFilter (cyclomatic 24) · ×1
  • _RawSecureSocket._tryFilter (cyclomatic 24) sdk/lib/io/secure_socket.dart:1105 — _RawSecureSocket._tryFilter 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.
D1 · Cyclomatic Complexity · _FfiDefinitionTransformer._findFields (cyclomatic 24) · ×1
  • _FfiDefinitionTransformer._findFields (cyclomatic 24) pkg/vm/lib/modular/transformations/ffi/definitions.dart:705 — _FfiDefinitionTransformer._findFields 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.
D1 · Cyclomatic Complexity · AbstractScanner.tokenizeFractionPart (cyclomatic 24) · ×1
  • AbstractScanner.tokenizeFractionPart (cyclomatic 24) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1693 — AbstractScanner.tokenizeFractionPart 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.
D1 · Cyclomatic Complexity · Utf8BytesScanner.skipSpaces (cyclomatic 24) · ×1
  • Utf8BytesScanner.skipSpaces (cyclomatic 24) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:319 — Utf8BytesScanner.skipSpaces has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · ImportElementsComputer.createEdits (cyclomatic 24) · ×1
  • ImportElementsComputer.createEdits (cyclomatic 24) pkg/analysis_server/lib/src/computer/import_elements_computer.dart:31 — ImportElementsComputer.createEdits 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.
D1 · Cyclomatic Complexity · ResultMerger.mergeRefactoringFeedbacks (cyclomatic 24) · ×1
  • ResultMerger.mergeRefactoringFeedbacks (cyclomatic 24) pkg/analysis_server/lib/src/plugin/result_merger.dart:547 — ResultMerger.mergeRefactoringFeedbacks 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.
D1 · Cyclomatic Complexity · MessageScheduler._processDocumentChange (cyclomatic 24) · ×1
  • MessageScheduler._processDocumentChange (cyclomatic 24) pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:442 — MessageScheduler._processDocumentChange 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.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitMethodInvocation (cyclomatic 24) · ×1
  • InScopeCompletionPass.visitMethodInvocation (cyclomatic 24) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2120 — InScopeCompletionPass.visitMethodInvocation 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.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitPrimaryConstructorDeclaration (cyclomatic 24) · ×1
  • InScopeCompletionPass.visitPrimaryConstructorDeclaration (cyclomatic 24) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2576 — InScopeCompletionPass.visitPrimaryConstructorDeclaration 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.
D1 · Cyclomatic Complexity · AddExplicitCast.compute (cyclomatic 24) · ×1
  • AddExplicitCast.compute (cyclomatic 24) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:31 — AddExplicitCast.compute 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.
D1 · Cyclomatic Complexity · _EnumDescription.applyChanges (cyclomatic 24) · ×1
  • _EnumDescription.applyChanges (cyclomatic 24) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:193 — _EnumDescription.applyChanges 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.
D1 · Cyclomatic Complexity · CreateExtensionOperator.compute (cyclomatic 24) · ×1
  • CreateExtensionOperator.compute (cyclomatic 24) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:354 — CreateExtensionOperator.compute has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MakeFinal.compute (cyclomatic 24) · ×1
  • MakeFinal.compute (cyclomatic 24) pkg/analysis_server/lib/src/services/correction/dart/make_final.dart:26 — MakeFinal.compute 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.
D1 · Cyclomatic Complexity · RemoveLeadingUnderscore.compute (cyclomatic 24) · ×1
  • RemoveLeadingUnderscore.compute (cyclomatic 24) pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart:28 — RemoveLeadingUnderscore.compute 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.
D1 · Cyclomatic Complexity · ElementWriter._computeProperties (cyclomatic 24) · ×1
  • ElementWriter._computeProperties (cyclomatic 24) pkg/analysis_server/lib/src/status/utilities/element_writer.dart:35 — ElementWriter._computeProperties 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.
D1 · Cyclomatic Complexity · FixProcessor._addFromProducers (cyclomatic 24) · ×1
  • FixProcessor._addFromProducers (cyclomatic 24) pkg/analysis_server_plugin/lib/src/correction/fix_processor.dart:132 — FixProcessor._addFromProducers 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.
D1 · Cyclomatic Complexity · FileState.serializeAstUnlinked2 (cyclomatic 24) · ×1
  • FileState.serializeAstUnlinked2 (cyclomatic 24) pkg/analyzer/lib/src/dart/analysis/file_state.dart:971 — FileState.serializeAstUnlinked2 has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SubtypeHelper._isFunctionSubtypeOf (cyclomatic 24) · ×1
  • SubtypeHelper._isFunctionSubtypeOf (cyclomatic 24) pkg/analyzer/lib/src/dart/element/subtype.dart:85 — SubtypeHelper._isFunctionSubtypeOf 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.
D1 · Cyclomatic Complexity · PropertyElementResolver.resolveReceiverPropertyExtraction (cyclomatic 24) · ×1
  • PropertyElementResolver.resolveReceiverPropertyExtraction (cyclomatic 24) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:815 — PropertyElementResolver.resolveReceiverPropertyExtraction 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.
D1 · Cyclomatic Complexity · VariableDeclarationResolver.resolve (cyclomatic 24) · ×1
  • VariableDeclarationResolver.resolve (cyclomatic 24) pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart:24 — VariableDeclarationResolver.resolve has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _InvalidAccessVerifier._checkForOtherInvalidAccess (cyclomatic 24) · ×1
  • _InvalidAccessVerifier._checkForOtherInvalidAccess (cyclomatic 24) pkg/analyzer/lib/src/error/best_practices_verifier.dart:2081 — _InvalidAccessVerifier._checkForOtherInvalidAccess 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.
D1 · Cyclomatic Complexity · ErrorHandlerVerifier._verifyInvocation (cyclomatic 24) · ×1
  • ErrorHandlerVerifier._verifyInvocation (cyclomatic 24) pkg/analyzer/lib/src/error/error_handler_verifier.dart:287 — ErrorHandlerVerifier._verifyInvocation 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.
D1 · Cyclomatic Complexity · TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds (cyclomatic 24) · ×1
  • TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds (cyclomatic 24) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:336 — TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds 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.
D1 · Cyclomatic Complexity · _LibraryMatch.compareStructures (cyclomatic 24) · ×1
  • _LibraryMatch.compareStructures (cyclomatic 24) pkg/analyzer/lib/src/fine/library_manifest.dart:1814 — _LibraryMatch.compareStructures 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.
D1 · Cyclomatic Complexity · SizeEstimator.visitAssignment (cyclomatic 24) · ×1
  • SizeEstimator.visitAssignment (cyclomatic 24) pkg/compiler/lib/src/js/size_estimator.dart:566 — SizeEstimator.visitAssignment has cyclomatic complexity 24 (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. This is NOT this file's highest cyclomatic complexity: SizeEstimator.visitBinary (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SpecializedChecks.findIsTestSpecialization (cyclomatic 24) · ×1
  • SpecializedChecks.findIsTestSpecialization (cyclomatic 24) pkg/compiler/lib/src/js_backend/specialized_checks.dart:32 — SpecializedChecks.findIsTestSpecialization 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.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.simplifyExpressionPhi (cyclomatic 24) · ×1
  • SsaInstructionSimplifier.simplifyExpressionPhi (cyclomatic 24) pkg/compiler/lib/src/ssa/optimize.dart:525 — SsaInstructionSimplifier.simplifyExpressionPhi has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ResolutionWorldBuilder._getMemberUsage (cyclomatic 24) · ×1
  • ResolutionWorldBuilder._getMemberUsage (cyclomatic 24) pkg/compiler/lib/src/universe/resolution_world_builder.dart:799 — ResolutionWorldBuilder._getMemberUsage 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.
D1 · Cyclomatic Complexity · JsBuilder.escapedString (cyclomatic 24) · ×1
  • JsBuilder.escapedString (cyclomatic 24) pkg/dev_compiler/lib/src/js_ast/builder.dart:288 — JsBuilder.escapedString 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.
D1 · Cyclomatic Complexity · ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember (cyclomatic 24) · ×1
  • ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember (cyclomatic 24) pkg/front_end/lib/src/base/incremental_compiler.dart:3007 — ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember 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.
D1 · Cyclomatic Complexity · _InitializationFromExperimentalCache.loadLibrariesFromCache (cyclomatic 24) · ×1
  • _InitializationFromExperimentalCache.loadLibrariesFromCache (cyclomatic 24) pkg/front_end/lib/src/base/incremental_compiler.dart:3690 — _InitializationFromExperimentalCache.loadLibrariesFromCache 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.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitDotShorthandInvocation (cyclomatic 24) · ×1
  • InferenceVisitorImpl.visitDotShorthandInvocation (cyclomatic 24) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13849 — InferenceVisitorImpl.visitDotShorthandInvocation has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorBase._findExtensionMember (cyclomatic 24) · ×1
  • InferenceVisitorBase._findExtensionMember (cyclomatic 24) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1184 — InferenceVisitorBase._findExtensionMember 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.
D1 · Cyclomatic Complexity · FrontendServerClient._compile (cyclomatic 24) · ×1
  • FrontendServerClient._compile (cyclomatic 24) pkg/frontend_server_client/lib/src/frontend_server_client.dart:199 — FrontendServerClient._compile 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.
D1 · Cyclomatic Complexity · MiniJsParser.parseStatement (cyclomatic 24) · ×1
  • MiniJsParser.parseStatement (cyclomatic 24) pkg/js_ast/lib/src/builder.dart:1236 — MiniJsParser.parseStatement 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.
D1 · Cyclomatic Complexity · Printer.visitAssignment (cyclomatic 24) · ×1
  • Printer.visitAssignment (cyclomatic 24) pkg/js_ast/lib/src/printer.dart:922 — Printer.visitAssignment has cyclomatic complexity 24 (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. This is NOT this file's highest cyclomatic complexity: Printer.visitBinary (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · IntersectionType.nullability (cyclomatic 24) · ×1
  • IntersectionType.nullability (cyclomatic 24) pkg/kernel/lib/src/ast/types.dart:2223 — IntersectionType.nullability has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · VarianceChecker.check (cyclomatic 24) · ×1
  • VarianceChecker.check (cyclomatic 24) pkg/linter/lib/src/util/variance_checker.dart:37 — VarianceChecker.check 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.
D1 · Cyclomatic Complexity · Printer.visitProcedure (cyclomatic 24) · ×1
  • Printer.visitProcedure (cyclomatic 24) pkg/kernel/lib/text/ast_to_text.dart:1341 — Printer.visitProcedure has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · UnboxingInfoManager.analyzeComponent (cyclomatic 24) · ×1
  • UnboxingInfoManager.analyzeComponent (cyclomatic 24) pkg/vm/lib/transformations/type_flow/unboxing_info.dart:52 — UnboxingInfoManager.analyzeComponent has cyclomatic complexity 24 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · AbstractScanner.tokenizeFractionPart (cyclomatic 23) · ×1
  • AbstractScanner.tokenizeFractionPart (cyclomatic 23) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1095 — AbstractScanner.tokenizeFractionPart has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogPage._writeEntry (cyclomatic 23) · ×1
  • LogPage._writeEntry (cyclomatic 23) pkg/analysis_server/tool/instrumentation/page/log_page.dart:115 — LogPage._writeEntry has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WasmCompilerOptions._validatePhases (cyclomatic 23) · ×1
  • WasmCompilerOptions._validatePhases (cyclomatic 23) pkg/dart2wasm/lib/compiler_options.dart:184 — WasmCompilerOptions._validatePhases has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _VerifyingVisitor.visitProcedure (cyclomatic 23) · ×1
  • _VerifyingVisitor.visitProcedure (cyclomatic 23) pkg/kernel/lib/verifier.dart:896 — _VerifyingVisitor.visitProcedure 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.
D1 · Cyclomatic Complexity · NativeRuntime.streamTimelineTo (cyclomatic 23) · ×1
  • NativeRuntime.streamTimelineTo (cyclomatic 23) sdk/lib/_internal/vm/lib/developer.dart:234 — NativeRuntime.streamTimelineTo has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _JsonStringifier.writeStringContent (cyclomatic 23) · ×1
  • _JsonStringifier.writeStringContent (cyclomatic 23) sdk/lib/convert/json.dart:714 — _JsonStringifier.writeStringContent has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Uri._makeWindowsFileUrl (cyclomatic 23) · ×1
  • _Uri._makeWindowsFileUrl (cyclomatic 23) sdk/lib/core/uri.dart:2208 — _Uri._makeWindowsFileUrl has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SimpleUri.replace (cyclomatic 23) · ×1
  • _SimpleUri.replace (cyclomatic 23) sdk/lib/core/uri.dart:4746 — _SimpleUri.replace has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Algorithm._filterUserConstraints (cyclomatic 23) · ×1
  • _Algorithm._filterUserConstraints (cyclomatic 23) pkg/dart2wasm/lib/deferred_load/partition.dart:318 — _Algorithm._filterUserConstraints has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionRegistry.getFunction (cyclomatic 23) · ×1
  • FunctionRegistry.getFunction (cyclomatic 23) pkg/cfg/lib/ir/functions.dart:340 — FunctionRegistry.getFunction has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Simplification.visitComparison (cyclomatic 23) · ×1
  • Simplification.visitComparison (cyclomatic 23) pkg/cfg/lib/passes/simplification.dart:103 — Simplification.visitComparison has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SharedInteropTransformer.visitStaticInvocation (cyclomatic 23) · ×1
  • SharedInteropTransformer.visitStaticInvocation (cyclomatic 23) pkg/_js_interop_checks/lib/src/transformations/shared_interop_transformer.dart:211 — SharedInteropTransformer.visitStaticInvocation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartUnitHighlightsComputer._addIdentifierRegion_field (cyclomatic 23) · ×1
  • DartUnitHighlightsComputer._addIdentifierRegion_field (cyclomatic 23) pkg/analysis_server/lib/src/computer/computer_highlights.dart:262 — DartUnitHighlightsComputer._addIdentifierRegion_field has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartUnitHoverComputer._typeDisplayString (cyclomatic 23) · ×1
  • DartUnitHoverComputer._typeDisplayString (cyclomatic 23) pkg/analysis_server/lib/src/computer/computer_hover.dart:357 — DartUnitHoverComputer._typeDisplayString has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: DartUnitHoverComputer._locationEntity (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ResultMerger.mergeNavigation (cyclomatic 23) · ×1
  • ResultMerger.mergeNavigation (cyclomatic 23) pkg/analysis_server/lib/src/plugin/result_merger.dart:198 — ResultMerger.mergeNavigation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._visitPattern (cyclomatic 23) · ×1
  • DeclarationHelper._visitPattern (cyclomatic 23) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3076 — DeclarationHelper._visitPattern has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AddAsync.compute (cyclomatic 23) · ×1
  • AddAsync.compute (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/add_async.dart:35 — AddAsync.compute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CreateClass.compute (cyclomatic 23) · ×1
  • _CreateClass.compute (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:171 — _CreateClass.compute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CreateConstructor._computeWithoutSuperParameters (cyclomatic 23) · ×1
  • _CreateConstructor._computeWithoutSuperParameters (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:96 — _CreateConstructor._computeWithoutSuperParameters has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateExtensionGetter.compute (cyclomatic 23) · ×1
  • CreateExtensionGetter.compute (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:35 — CreateExtensionGetter.compute has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateSetter.compute (cyclomatic 23) · ×1
  • CreateSetter.compute (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart:32 — CreateSetter.compute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveTypeAnnotation._removeFromDeclarationList (cyclomatic 23) · ×1
  • RemoveTypeAnnotation._removeFromDeclarationList (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:72 — RemoveTypeAnnotation._removeFromDeclarationList has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReplaceWithDecoratedBox.compute (cyclomatic 23) · ×1
  • ReplaceWithDecoratedBox.compute (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/dart/replace_with_decorated_box.dart:28 — ReplaceWithDecoratedBox.compute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementMatcher.matches (cyclomatic 23) · ×1
  • ElementMatcher.matches (cyclomatic 23) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:53 — ElementMatcher.matches has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _EdgeInsetsProperty.changeValue (cyclomatic 23) · ×1
  • _EdgeInsetsProperty.changeValue (cyclomatic 23) pkg/analysis_server/lib/src/services/flutter/property.dart:514 — _EdgeInsetsProperty.changeValue has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RefactoringManager._createRefactoringFromKind (cyclomatic 23) · ×1
  • RefactoringManager._createRefactoringFromKind (cyclomatic 23) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_manager.dart:220 — RefactoringManager._createRefactoringFromKind has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogSanitizer.sanitizePath (cyclomatic 23) · ×1
  • LogSanitizer.sanitizePath (cyclomatic 23) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:370 — LogSanitizer.sanitizePath has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisOptionsImpl.signature (cyclomatic 23) · ×1
  • AnalysisOptionsImpl.signature (cyclomatic 23) pkg/analyzer/lib/src/analysis_options/analysis_options.dart:276 — AnalysisOptionsImpl.signature has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Search.references (cyclomatic 23) · ×1
  • Search.references (cyclomatic 23) pkg/analyzer/lib/src/dart/analysis/search.dart:573 — Search.references has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _ElementMapper.visitIdentifier (cyclomatic 23) · ×1
  • _ElementMapper.visitIdentifier (cyclomatic 23) pkg/analyzer/lib/src/dart/ast/element_locator.dart:108 — _ElementMapper.visitIdentifier has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantVisitor.visitBinaryOperatorInvocation (cyclomatic 23) · ×1
  • ConstantVisitor.visitBinaryOperatorInvocation (cyclomatic 23) pkg/analyzer/lib/src/dart/constant/evaluation.dart:667 — ConstantVisitor.visitBinaryOperatorInvocation has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LeastUpperBoundHelper._functionType (cyclomatic 23) · ×1
  • LeastUpperBoundHelper._functionType (cyclomatic 23) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:674 — LeastUpperBoundHelper._functionType has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeSystemImpl._refineNumericInvocationTypeNullSafe (cyclomatic 23) · ×1
  • TypeSystemImpl._refineNumericInvocationTypeNullSafe (cyclomatic 23) pkg/analyzer/lib/src/dart/element/type_system.dart:2050 — TypeSystemImpl._refineNumericInvocationTypeNullSafe has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodInvocationResolver._resolveQualifiedInvocation (cyclomatic 23) · ×1
  • MethodInvocationResolver._resolveQualifiedInvocation (cyclomatic 23) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:821 — MethodInvocationResolver._resolveQualifiedInvocation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget (cyclomatic 23) · ×1
  • PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget (cyclomatic 23) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1023 — PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForEachParts (cyclomatic 23) · ×1
  • ErrorVerifier._checkForEachParts (cyclomatic 23) pkg/analyzer/lib/src/generated/error_verifier.dart:4881 — ErrorVerifier._checkForEachParts has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SuperContext.of (cyclomatic 23) · ×1
  • SuperContext.of (cyclomatic 23) pkg/analyzer/lib/src/generated/super_context.dart:38 — SuperContext.of has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IgnoreInfo.isIgnoreForFileComment (cyclomatic 23) · ×1
  • IgnoreInfo.isIgnoreForFileComment (cyclomatic 23) pkg/analyzer/lib/src/ignore_comments/ignore_info.dart:246 — IgnoreInfo.isIgnoreForFileComment has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ManifestParser._parseAttribute (cyclomatic 23) · ×1
  • ManifestParser._parseAttribute (cyclomatic 23) pkg/analyzer/lib/src/manifest/manifest_validator.dart:145 — ManifestParser._parseAttribute has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManifestParser._parseNormalTag (cyclomatic 23) · ×1
  • ManifestParser._parseNormalTag (cyclomatic 23) pkg/analyzer/lib/src/manifest/manifest_validator.dart:287 — ManifestParser._parseNormalTag has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KFieldAnalysis.registerInstantiatedClass (cyclomatic 23) · ×1
  • KFieldAnalysis.registerInstantiatedClass (cyclomatic 23) pkg/compiler/lib/src/js_backend/field_analysis.dart:47 — KFieldAnalysis.registerInstantiatedClass has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSelection._followingSameFaultInstruction (cyclomatic 23) · ×1
  • SsaInstructionSelection._followingSameFaultInstruction (cyclomatic 23) pkg/compiler/lib/src/ssa/codegen_helpers.dart:106 — SsaInstructionSelection._followingSameFaultInstruction has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemorySet.intersectionFor (cyclomatic 23) · ×1
  • MemorySet.intersectionFor (cyclomatic 23) pkg/compiler/lib/src/ssa/optimize.dart:5093 — MemorySet.intersectionFor has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TestAdapter.sendTestTextOutput (cyclomatic 23) · ×1
  • TestAdapter.sendTestTextOutput (cyclomatic 23) pkg/dap_adapters/lib/src/adapters/mixins.dart:97 — TestAdapter.sendTestTextOutput has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecutableCompiler._compileToSnapshot (cyclomatic 23) · ×1
  • ExecutableCompiler._compileToSnapshot (cyclomatic 23) pkg/dartdev/lib/src/executable_compiler.dart:335 — ExecutableCompiler._compileToSnapshot has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassPropertyModel.build (cyclomatic 23) · ×1
  • ClassPropertyModel.build (cyclomatic 23) pkg/dev_compiler/lib/src/kernel/property_model.dart:224 — ClassPropertyModel.build has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler._computeTransitiveClosure (cyclomatic 23) · ×1
  • IncrementalCompiler._computeTransitiveClosure (cyclomatic 23) pkg/front_end/lib/src/base/incremental_compiler.dart:1800 — IncrementalCompiler._computeTransitiveClosure has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamedTypeBuilderImpl.buildSupertype (cyclomatic 23) · ×1
  • NamedTypeBuilderImpl.buildSupertype (cyclomatic 23) pkg/front_end/lib/src/builder/named_type_builder.dart:646 — NamedTypeBuilderImpl.buildSupertype 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 is NOT this file's highest cyclomatic complexity: NamedTypeBuilderImpl._checkDeferred (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RegularFieldDeclaration.createFieldEncoding (cyclomatic 23) · ×1
  • RegularFieldDeclaration.createFieldEncoding (cyclomatic 23) pkg/front_end/lib/src/fragment/field/declaration.dart:492 — RegularFieldDeclaration.createFieldEncoding has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartScopeBuilder2._looksLikePatternMatching (cyclomatic 23) · ×1
  • DartScopeBuilder2._looksLikePatternMatching (cyclomatic 23) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:946 — DartScopeBuilder2._looksLikePatternMatching has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _ConstListOrSetLiteralBuilder.translate (cyclomatic 23) · ×1
  • _ConstListOrSetLiteralBuilder.translate (cyclomatic 23) pkg/front_end/lib/src/type_inference/collection_encoding.dart:170 — _ConstListOrSetLiteralBuilder.translate has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.dispatchPatternSchema (cyclomatic 23) · ×1
  • InferenceVisitorImpl.dispatchPatternSchema (cyclomatic 23) pkg/front_end/lib/src/type_inference/inference_visitor.dart:11405 — InferenceVisitorImpl.dispatchPatternSchema has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StandardBounds._getLegacyLeastUpperBound (cyclomatic 23) · ×1
  • StandardBounds._getLegacyLeastUpperBound (cyclomatic 23) pkg/kernel/lib/src/standard_bounds.dart:978 — StandardBounds._getLegacyLeastUpperBound 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 is NOT this file's highest cyclomatic complexity: StandardBounds.morebottom (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _Visitor._visitInvocationExpression (cyclomatic 23) · ×1
  • _Visitor._visitInvocationExpression (cyclomatic 23) pkg/linter/lib/src/rules/unnecessary_lambdas.dart:228 — _Visitor._visitInvocationExpression has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pdb._decodeAnnotations (cyclomatic 23) · ×1
  • Pdb._decodeAnnotations (cyclomatic 23) pkg/native_stack_traces/lib/src/pdb.dart:1162 — Pdb._decodeAnnotations has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DFilterExpression.evaluate (cyclomatic 23) · ×1
  • DFilterExpression.evaluate (cyclomatic 23) runtime/tools/heapsnapshot/lib/src/expression.dart:53 — DFilterExpression.evaluate has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Join.simplify (cyclomatic 23) · ×1
  • Join.simplify (cyclomatic 23) pkg/vm/lib/transformations/type_flow/summary.dart:270 — Join.simplify has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeType.isSubtypeOfRuntimeType (cyclomatic 23) · ×1
  • RuntimeType.isSubtypeOfRuntimeType (cyclomatic 23) pkg/vm/lib/transformations/type_flow/types.dart:1928 — RuntimeType.isSubtypeOfRuntimeType has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · bin_to_coff.main (cyclomatic 23) · ×1
  • bin_to_coff.main (cyclomatic 23) runtime/tools/bin_to_coff.py:113 — bin_to_coff.main has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MutationRunner._runChain (cyclomatic 22) · ×1
  • MutationRunner._runChain (cyclomatic 22) pkg/analyzer/tool/fine/ab_mutate.dart:250 — MutationRunner._runChain 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.
D1 · Cyclomatic Complexity · _CodeGenerator.extractIdl (cyclomatic 22) · ×1
  • _CodeGenerator.extractIdl (cyclomatic 22) pkg/analyzer/tool/summary/generate.dart:583 — _CodeGenerator.extractIdl 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.
D1 · Cyclomatic Complexity · _ScopeBuilder._visitFunction (cyclomatic 22) · ×1
  • _ScopeBuilder._visitFunction (cyclomatic 22) pkg/dart2bytecode/lib/local_vars.dart:344 — _ScopeBuilder._visitFunction 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.
D1 · Cyclomatic Complexity · AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd (cyclomatic 22) · ×1
  • AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd (cyclomatic 22) pkg/front_end/tool/coverage_merger.dart:967 — AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _TraceReader.readTrace (cyclomatic 22) · ×1
  • _TraceReader.readTrace (cyclomatic 22) pkg/vm_snapshot_analysis/lib/precompiler_trace.dart:210 — _TraceReader.readTrace 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.
D1 · Cyclomatic Complexity · _HttpClientResponse._authenticate (cyclomatic 22) · ×1
  • _HttpClientResponse._authenticate (cyclomatic 22) sdk/lib/_http/http_impl.dart:805 — _HttpClientResponse._authenticate 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. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _WebSocketOutgoingTransformer.createFrame (cyclomatic 22) · ×1
  • _WebSocketOutgoingTransformer.createFrame (cyclomatic 22) sdk/lib/_http/websocket_impl.dart:1107 — _WebSocketOutgoingTransformer.createFrame 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.
D1 · Cyclomatic Complexity · FormatException.toString (cyclomatic 22) · ×1
  • FormatException.toString (cyclomatic 22) sdk/lib/core/exceptions.dart:75 — FormatException.toString 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.
D1 · Cyclomatic Complexity · Uri.parseIPv6Address (cyclomatic 22) · ×1
  • Uri.parseIPv6Address (cyclomatic 22) sdk/lib/core/uri.dart:1611 — Uri.parseIPv6Address 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.
D1 · Cyclomatic Complexity · Stdin.readLineSync (cyclomatic 22) · ×1
  • Stdin.readLineSync (cyclomatic 22) sdk/lib/io/stdio.dart:46 — Stdin.readLineSync 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.
D1 · Cyclomatic Complexity · PromotionModel._tryPromoteToTypeOfInterest (cyclomatic 22) · ×1
  • PromotionModel._tryPromoteToTypeOfInterest (cyclomatic 22) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:5029 — PromotionModel._tryPromoteToTypeOfInterest 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.
D1 · Cyclomatic Complexity · Parser.parseExtensionDeclaration (cyclomatic 22) · ×1
  • Parser.parseExtensionDeclaration (cyclomatic 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3653 — Parser.parseExtensionDeclaration 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.
D1 · Cyclomatic Complexity · Parser.parseFactoryMethod (cyclomatic 22) · ×1
  • Parser.parseFactoryMethod (cyclomatic 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6170 — Parser.parseFactoryMethod 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.
D1 · Cyclomatic Complexity · Parser.parseUnaryExpression (cyclomatic 22) · ×1
  • Parser.parseUnaryExpression (cyclomatic 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7889 — Parser.parseUnaryExpression 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.
D1 · Cyclomatic Complexity · ContextManagerImpl._createAnalysisContexts (cyclomatic 22) · ×1
  • ContextManagerImpl._createAnalysisContexts (cyclomatic 22) pkg/analysis_server/lib/src/context_manager.dart:691 — ContextManagerImpl._createAnalysisContexts 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.
D1 · Cyclomatic Complexity · TypeDefinitionHandler.handle (cyclomatic 22) · ×1
  • TypeDefinitionHandler.handle (cyclomatic 22) pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart:42 — TypeDefinitionHandler.handle has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _MinimalEditComputer._addEditFor (cyclomatic 22) · ×1
  • _MinimalEditComputer._addEditFor (cyclomatic 22) pkg/analysis_server/lib/src/lsp/source_edits.dart:465 — _MinimalEditComputer._addEditFor has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TypeHierarchyComputerHelper.findMemberElement (cyclomatic 22) · ×1
  • TypeHierarchyComputerHelper.findMemberElement (cyclomatic 22) pkg/analysis_server/lib/src/search/type_hierarchy.dart:194 — TypeHierarchyComputerHelper.findMemberElement 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.
D1 · Cyclomatic Complexity · DeclarationHelper._addMembersOfEnclosingNode (cyclomatic 22) · ×1
  • DeclarationHelper._addMembersOfEnclosingNode (cyclomatic 22) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1573 — DeclarationHelper._addMembersOfEnclosingNode 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.
D1 · Cyclomatic Complexity · DeclarationHelper._suggestMethod (cyclomatic 22) · ×1
  • DeclarationHelper._suggestMethod (cyclomatic 22) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2395 — DeclarationHelper._suggestMethod 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.
D1 · Cyclomatic Complexity · FeatureComputer.computeElementKind (cyclomatic 22) · ×1
  • FeatureComputer.computeElementKind (cyclomatic 22) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:193 — FeatureComputer.computeElementKind has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FeatureComputer.computeElementKind2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · FeatureComputer.computeElementKind2 (cyclomatic 22) · ×1
  • FeatureComputer.computeElementKind2 (cyclomatic 22) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:251 — FeatureComputer.computeElementKind2 has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FeatureComputer.computeElementKind) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitRegularFormalParameter (cyclomatic 22) · ×1
  • InScopeCompletionPass.visitRegularFormalParameter (cyclomatic 22) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2887 — InScopeCompletionPass.visitRegularFormalParameter 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.
D1 · Cyclomatic Complexity · BulkFixProcessor._fixErrorsInLibraryUnit (cyclomatic 22) · ×1
  • BulkFixProcessor._fixErrorsInLibraryUnit (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:612 — BulkFixProcessor._fixErrorsInLibraryUnit 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.
D1 · Cyclomatic Complexity · BindToField._replaceParameterWithThis (cyclomatic 22) · ×1
  • BindToField._replaceParameterWithThis (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/bind_to_field.dart:121 — BindToField._replaceParameterWithThis 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.
D1 · Cyclomatic Complexity · ConvertIntoFinalField.compute (cyclomatic 22) · ×1
  • ConvertIntoFinalField.compute (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart:26 — ConvertIntoFinalField.compute 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.
D1 · Cyclomatic Complexity · ConvertToDeclaringParameter._resolveParameterFromFieldNode (cyclomatic 22) · ×1
  • ConvertToDeclaringParameter._resolveParameterFromFieldNode (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:476 — ConvertToDeclaringParameter._resolveParameterFromFieldNode 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.
D1 · Cyclomatic Complexity · ConvertToNullAware.compute (cyclomatic 22) · ×1
  • ConvertToNullAware.compute (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart:32 — ConvertToNullAware.compute 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.
D1 · Cyclomatic Complexity · _RemoveConst.compute (cyclomatic 22) · ×1
  • _RemoveConst.compute (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart:164 — _RemoveConst.compute 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.
D1 · Cyclomatic Complexity · ReplaceWithIsEmpty._analyzeBinaryExpression (cyclomatic 22) · ×1
  • ReplaceWithIsEmpty._analyzeBinaryExpression (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart:94 — ReplaceWithIsEmpty._analyzeBinaryExpression 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.
D1 · Cyclomatic Complexity · _MatcherBuilder._buildFromSimpleIdentifier (cyclomatic 22) · ×1
  • _MatcherBuilder._buildFromSimpleIdentifier (cyclomatic 22) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:643 — _MatcherBuilder._buildFromSimpleIdentifier 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.
D1 · Cyclomatic Complexity · PluginsPage._emitIsolateInfo (cyclomatic 22) · ×1
  • PluginsPage._emitIsolateInfo (cyclomatic 22) pkg/analysis_server/lib/src/status/pages/plugins_page.dart:146 — PluginsPage._emitIsolateInfo 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.
D1 · Cyclomatic Complexity · AnalysisDriver.workPriority (cyclomatic 22) · ×1
  • AnalysisDriver.workPriority (cyclomatic 22) pkg/analyzer/lib/src/dart/analysis/driver.dart:483 — AnalysisDriver.workPriority has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _ConstructorInvocationEvaluator.evaluate (cyclomatic 22) · ×1
  • _ConstructorInvocationEvaluator.evaluate (cyclomatic 22) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3562 — _ConstructorInvocationEvaluator.evaluate 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.
D1 · Cyclomatic Complexity · TypeAnalyzer.visitAnonymousMethodInvocation (cyclomatic 22) · ×1
  • TypeAnalyzer.visitAnonymousMethodInvocation (cyclomatic 22) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:1913 — TypeAnalyzer.visitAnonymousMethodInvocation 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.
D1 · Cyclomatic Complexity · TypedLiteralResolver._inferSetOrMapLiteralType (cyclomatic 22) · ×1
  • TypedLiteralResolver._inferSetOrMapLiteralType (cyclomatic 22) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:553 — TypedLiteralResolver._inferSetOrMapLiteralType has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DartdocDirectiveInfo.extractTemplate (cyclomatic 22) · ×1
  • DartdocDirectiveInfo.extractTemplate (cyclomatic 22) pkg/analyzer/lib/src/dartdoc/dartdoc_directive_info.dart:48 — DartdocDirectiveInfo.extractTemplate 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.
D1 · Cyclomatic Complexity · AnnotationVerifier._checkVisibility (cyclomatic 22) · ×1
  • AnnotationVerifier._checkVisibility (cyclomatic 22) pkg/analyzer/lib/src/error/annotation_verifier.dart:554 — AnnotationVerifier._checkVisibility 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.
D1 · Cyclomatic Complexity · UnusedLocalElementsVerifier._isUsedElement (cyclomatic 22) · ×1
  • UnusedLocalElementsVerifier._isUsedElement (cyclomatic 22) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:1141 — UnusedLocalElementsVerifier._isUsedElement 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.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForConflictingClassMembers (cyclomatic 22) · ×1
  • ErrorVerifier._checkForConflictingClassMembers (cyclomatic 22) pkg/analyzer/lib/src/generated/error_verifier.dart:3858 — ErrorVerifier._checkForConflictingClassMembers 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.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForConflictingInitializerErrorCodes (cyclomatic 22) · ×1
  • ErrorVerifier._checkForConflictingInitializerErrorCodes (cyclomatic 22) pkg/analyzer/lib/src/generated/error_verifier.dart:4257 — ErrorVerifier._checkForConflictingInitializerErrorCodes 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.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes (cyclomatic 22) · ×1
  • ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes (cyclomatic 22) pkg/analyzer/lib/src/generated/error_verifier.dart:5350 — ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes 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.
D1 · Cyclomatic Complexity · FfiVerifier.visitClassDeclaration2 (cyclomatic 22) · ×1
  • FfiVerifier.visitClassDeclaration2 (cyclomatic 22) pkg/analyzer/lib/src/generated/ffi_verifier.dart:266 — FfiVerifier.visitClassDeclaration2 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.
D1 · Cyclomatic Complexity · LocalDeclarationVisitor._addVariables (cyclomatic 22) · ×1
  • LocalDeclarationVisitor._addVariables (cyclomatic 22) pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:310 — LocalDeclarationVisitor._addVariables 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.
D1 · Cyclomatic Complexity · SpecializedChecks._findAsCheck (cyclomatic 22) · ×1
  • SpecializedChecks._findAsCheck (cyclomatic 22) pkg/compiler/lib/src/js_backend/specialized_checks.dart:153 — SpecializedChecks._findAsCheck 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.
D1 · Cyclomatic Complexity · AsyncLowering._isDefinitelyNonFutureValue (cyclomatic 22) · ×1
  • AsyncLowering._isDefinitelyNonFutureValue (cyclomatic 22) pkg/compiler/lib/src/kernel/transformations/modular/async_lowering.dart:134 — AsyncLowering._isDefinitelyNonFutureValue has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._buildConstructor (cyclomatic 22) · ×1
  • KernelSsaGraphBuilder._buildConstructor (cyclomatic 22) pkg/compiler/lib/src/ssa/builder.dart:788 — KernelSsaGraphBuilder._buildConstructor 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.
D1 · Cyclomatic Complexity · BaseDebugAdapter.handleIncomingRequest (cyclomatic 22) · ×1
  • BaseDebugAdapter.handleIncomingRequest (cyclomatic 22) pkg/dap_adapters/lib/src/base_debug_adapter.dart:326 — BaseDebugAdapter.handleIncomingRequest has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProgramCompiler._emitFactoryInvocation (cyclomatic 22) · ×1
  • ProgramCompiler._emitFactoryInvocation (cyclomatic 22) pkg/dev_compiler/lib/src/kernel/compiler.dart:7458 — ProgramCompiler._emitFactoryInvocation 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.
D1 · Cyclomatic Complexity · LibraryCompiler._emitClassProperties (cyclomatic 22) · ×1
  • LibraryCompiler._emitClassProperties (cyclomatic 22) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2796 — LibraryCompiler._emitClassProperties 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.
D1 · Cyclomatic Complexity · LibraryCompiler._emitFactoryInvocation (cyclomatic 22) · ×1
  • LibraryCompiler._emitFactoryInvocation (cyclomatic 22) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8325 — LibraryCompiler._emitFactoryInvocation 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.
D1 · Cyclomatic Complexity · NamedTypeBuilderImpl.substituteRange (cyclomatic 22) · ×1
  • NamedTypeBuilderImpl.substituteRange (cyclomatic 22) pkg/front_end/lib/src/builder/named_type_builder.dart:998 — NamedTypeBuilderImpl.substituteRange 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. This is NOT this file's highest cyclomatic complexity: NamedTypeBuilderImpl._checkDeferred (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RecordTypeBuilderImpl.buildAliased (cyclomatic 22) · ×1
  • RecordTypeBuilderImpl.buildAliased (cyclomatic 22) pkg/front_end/lib/src/builder/record_type_builder.dart:118 — RecordTypeBuilderImpl.buildAliased 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.
D1 · Cyclomatic Complexity · ForwardingNode._createForwardingImplIfNeeded (cyclomatic 22) · ×1
  • ForwardingNode._createForwardingImplIfNeeded (cyclomatic 22) pkg/front_end/lib/src/kernel/forwarding_node.dart:299 — ForwardingNode._createForwardingImplIfNeeded 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.
D1 · Cyclomatic Complexity · SourceLibraryBuilder.computeFieldPromotability (cyclomatic 22) · ×1
  • SourceLibraryBuilder.computeFieldPromotability (cyclomatic 22) pkg/front_end/lib/src/source/source_library_builder.dart:826 — SourceLibraryBuilder.computeFieldPromotability 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. This is NOT this file's highest cyclomatic complexity: SourceLibraryBuilder.checkPendingBoundsChecks (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StringToSource.analyze (cyclomatic 22) · ×1
  • StringToSource.analyze (cyclomatic 22) pkg/js_ast/lib/src/strings.dart:26 — StringToSource.analyze has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IntersectionType.IntersectionType (cyclomatic 22) · ×1
  • IntersectionType.IntersectionType (cyclomatic 22) pkg/kernel/lib/src/ast/types.dart:2102 — IntersectionType.IntersectionType has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · InstructionsBuilder.forceBuild (cyclomatic 22) · ×1
  • InstructionsBuilder.forceBuild (cyclomatic 22) pkg/wasm_builder/lib/src/builder/instructions.dart:287 — InstructionsBuilder.forceBuild 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.
D1 · Cyclomatic Complexity · _RecGroupBuilder._assignBrandTypes (cyclomatic 22) · ×1
  • _RecGroupBuilder._assignBrandTypes (cyclomatic 22) pkg/wasm_builder/lib/src/builder/types.dart:124 — _RecGroupBuilder._assignBrandTypes 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.
D1 · Cyclomatic Complexity · PragmaEntryPointsVisitor.visitField (cyclomatic 22) · ×1
  • PragmaEntryPointsVisitor.visitField (cyclomatic 22) pkg/vm/lib/transformations/type_flow/native_code.dart:268 — PragmaEntryPointsVisitor.visitField 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.
D1 · Cyclomatic Complexity · _Transform.transformMemberSignature (cyclomatic 22) · ×1
  • _Transform.transformMemberSignature (cyclomatic 22) pkg/vm/lib/transformations/type_flow/signature_shaking.dart:405 — _Transform.transformMemberSignature 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.
D1 · Cyclomatic Complexity · _SummaryNormalizer._excludeRedundantJoinPathsInternal (cyclomatic 22) · ×1
  • _SummaryNormalizer._excludeRedundantJoinPathsInternal (cyclomatic 22) pkg/vm/lib/transformations/type_flow/summary_collector.dart:114 — _SummaryNormalizer._excludeRedundantJoinPathsInternal 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.
D1 · Cyclomatic Complexity · onRcpMessage (cyclomatic 22) · ×1
  • onRcpMessage (cyclomatic 22) REDACTED:76 — onRcpMessage 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.
D1 · Cyclomatic Complexity · ConfigurationFilesMixin.writePackageConfig2 (cyclomatic 21) · ×1
  • ConfigurationFilesMixin.writePackageConfig2 (cyclomatic 21) pkg/analyzer_testing/lib/configuration_files_mixin.dart:54 — ConfigurationFilesMixin.writePackageConfig2 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.
D1 · Cyclomatic Complexity · Utils.formatDuration (cyclomatic 21) · ×1
  • Utils.formatDuration (cyclomatic 21) pkg/observatory/lib/utils.dart:150 — Utils.formatDuration 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.
D1 · Cyclomatic Complexity · DartFuzz.pickScalarVar (cyclomatic 21) · ×1
  • DartFuzz.pickScalarVar (cyclomatic 21) runtime/tools/dartfuzz/dartfuzz.dart:2128 — DartFuzz.pickScalarVar 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.
D1 · Cyclomatic Complexity · _HttpClientResponse.redirect (cyclomatic 21) · ×1
  • _HttpClientResponse.redirect (cyclomatic 21) sdk/lib/_http/http_impl.dart:660 — _HttpClientResponse.redirect has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Future.wait (cyclomatic 21) · ×1
  • Future.wait (cyclomatic 21) sdk/lib/async/future.dart:475 — Future.wait 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.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitTypeTest (cyclomatic 21) · ×1
  • Arm64CodeGenerator.visitTypeTest (cyclomatic 21) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1805 — Arm64CodeGenerator.visitTypeTest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Arm64CodeGenerator.visitUnaryDoubleOp (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Base64Codec.normalize (cyclomatic 21) · ×1
  • Base64Codec.normalize (cyclomatic 21) sdk/lib/convert/base64.dart:85 — Base64Codec.normalize 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.
D1 · Cyclomatic Complexity · _Utf8Decoder.decodeGeneral (cyclomatic 21) · ×1
  • _Utf8Decoder.decodeGeneral (cyclomatic 21) sdk/lib/convert/utf.dart:575 — _Utf8Decoder.decodeGeneral 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.
D1 · Cyclomatic Complexity · _Uri._normalizeRegName (cyclomatic 21) · ×1
  • _Uri._normalizeRegName (cyclomatic 21) sdk/lib/core/uri.dart:2550 — _Uri._normalizeRegName 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.
D1 · Cyclomatic Complexity · UriData._parse (cyclomatic 21) · ×1
  • UriData._parse (cyclomatic 21) sdk/lib/core/uri.dart:4254 — UriData._parse has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FfiUseSiteTransformer._verifyAndReplaceNativeCallable (cyclomatic 21) · ×1
  • _FfiUseSiteTransformer._verifyAndReplaceNativeCallable (cyclomatic 21) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:1316 — _FfiUseSiteTransformer._verifyAndReplaceNativeCallable 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.
D1 · Cyclomatic Complexity · Unboxing.hasUnboxedInput (cyclomatic 21) · ×1
  • Unboxing.hasUnboxedInput (cyclomatic 21) pkg/native_compiler/lib/passes/unboxing.dart:46 — Unboxing.hasUnboxedInput has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Parser.parseArgumentOrIndexStar (cyclomatic 21) · ×1
  • Parser.parseArgumentOrIndexStar (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8012 — Parser.parseArgumentOrIndexStar 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.
D1 · Cyclomatic Complexity · Parser.parseArgumentsRest (cyclomatic 21) · ×1
  • Parser.parseArgumentsRest (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9538 — Parser.parseArgumentsRest 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.
D1 · Cyclomatic Complexity · Parser.parseVariablePattern (cyclomatic 21) · ×1
  • Parser.parseVariablePattern (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11907 — Parser.parseVariablePattern 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.
D1 · Cyclomatic Complexity · ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered (cyclomatic 21) · ×1
  • ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:882 — ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered 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.
D1 · Cyclomatic Complexity · ComplexTypeParamOrArgInfo.compute (cyclomatic 21) · ×1
  • ComplexTypeParamOrArgInfo.compute (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1345 — ComplexTypeParamOrArgInfo.compute 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.
D1 · Cyclomatic Complexity · Features.fromText (cyclomatic 21) · ×1
  • Features.fromText (cyclomatic 21) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:155 — Features.fromText 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.
D1 · Cyclomatic Complexity · ExportChecker.visitClass (cyclomatic 21) · ×1
  • ExportChecker.visitClass (cyclomatic 21) pkg/_js_interop_checks/lib/src/transformations/export_checker.dart:95 — ExportChecker.visitClass 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.
D1 · Cyclomatic Complexity · CompletionResolveHandler.resolveDartCompletion (cyclomatic 21) · ×1
  • CompletionResolveHandler.resolveDartCompletion (cyclomatic 21) pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart:59 — CompletionResolveHandler.resolveDartCompletion 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.
D1 · Cyclomatic Complexity · PluginWatcher._addPlugins (cyclomatic 21) · ×1
  • PluginWatcher._addPlugins (cyclomatic 21) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:180 — PluginWatcher._addPlugins has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · TokenData.fromSelection (cyclomatic 21) · ×1
  • TokenData.fromSelection (cyclomatic 21) pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart:548 — TokenData.fromSelection 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.
D1 · Cyclomatic Complexity · UriHelper._addFileSuggestions (cyclomatic 21) · ×1
  • UriHelper._addFileSuggestions (cyclomatic 21) pkg/analysis_server/lib/src/services/completion/dart/uri_helper.dart:82 — UriHelper._addFileSuggestions 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.
D1 · Cyclomatic Complexity · YamlCompletionGenerator._siblingsOnPath (cyclomatic 21) · ×1
  • YamlCompletionGenerator._siblingsOnPath (cyclomatic 21) pkg/analysis_server/lib/src/services/completion/yaml/yaml_completion_generator.dart:220 — YamlCompletionGenerator._siblingsOnPath 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.
D1 · Cyclomatic Complexity · AddSuperParameter._addToConstructor (cyclomatic 21) · ×1
  • AddSuperParameter._addToConstructor (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/dart/add_super_parameter.dart:62 — AddSuperParameter._addToConstructor 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.
D1 · Cyclomatic Complexity · ConvertNullCheckToNullAwareElementOrEntry.compute (cyclomatic 21) · ×1
  • ConvertNullCheckToNullAwareElementOrEntry.compute (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/dart/convert_null_check_to_null_aware_element_or_entry.dart:29 — ConvertNullCheckToNullAwareElementOrEntry.compute 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.
D1 · Cyclomatic Complexity · ConvertToNamedArguments.compute (cyclomatic 21) · ×1
  • ConvertToNamedArguments.compute (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart:25 — ConvertToNamedArguments.compute 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.
D1 · Cyclomatic Complexity · RemoveThisAlias.compute (cyclomatic 21) · ×1
  • RemoveThisAlias.compute (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/dart/remove_this_alias.dart:33 — RemoveThisAlias.compute 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.
D1 · Cyclomatic Complexity · _CodeFragmentScanner.scan (cyclomatic 21) · ×1
  • _CodeFragmentScanner.scan (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/fix/data_driven/code_fragment_parser.dart:387 — _CodeFragmentScanner.scan 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.
D1 · Cyclomatic Complexity · _MatcherBuilder.buildMatchersForNode (cyclomatic 21) · ×1
  • _MatcherBuilder.buildMatchersForNode (cyclomatic 21) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:201 — _MatcherBuilder.buildMatchersForNode has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ContextsPage.generateContent (cyclomatic 21) · ×1
  • ContextsPage.generateContent (cyclomatic 21) pkg/analysis_server/lib/src/status/pages/contexts_page.dart:37 — ContextsPage.generateContent 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.
D1 · Cyclomatic Complexity · GenericInferrer.tryChooseFinalTypes (cyclomatic 21) · ×1
  • GenericInferrer.tryChooseFinalTypes (cyclomatic 21) pkg/analyzer/lib/src/dart/element/generic_inferrer.dart:300 — GenericInferrer.tryChooseFinalTypes 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.
D1 · Cyclomatic Complexity · GreatestLowerBoundHelper._functionType (cyclomatic 21) · ×1
  • GreatestLowerBoundHelper._functionType (cyclomatic 21) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:251 — GreatestLowerBoundHelper._functionType 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.
D1 · Cyclomatic Complexity · AssignmentExpressionResolver.resolveDirect (cyclomatic 21) · ×1
  • AssignmentExpressionResolver.resolveDirect (cyclomatic 21) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:194 — AssignmentExpressionResolver.resolveDirect 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.
D1 · Cyclomatic Complexity · BestPracticesVerifier._visitMethodDeclaration (cyclomatic 21) · ×1
  • BestPracticesVerifier._visitMethodDeclaration (cyclomatic 21) pkg/analyzer/lib/src/error/best_practices_verifier.dart:1695 — BestPracticesVerifier._visitMethodDeclaration 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.
D1 · Cyclomatic Complexity · ImportsVerifier._findAncestorDuplicate (cyclomatic 21) · ×1
  • ImportsVerifier._findAncestorDuplicate (cyclomatic 21) pkg/analyzer/lib/src/error/imports_verifier.dart:491 — ImportsVerifier._findAncestorDuplicate 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.
D1 · Cyclomatic Complexity · AstBuilder.endFormalParameter (cyclomatic 21) · ×1
  • AstBuilder.endFormalParameter (cyclomatic 21) pkg/analyzer/lib/src/fasta/ast_builder.dart:1865 — AstBuilder.endFormalParameter 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.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForAllMixinErrorCodes (cyclomatic 21) · ×1
  • ErrorVerifier._checkForAllMixinErrorCodes (cyclomatic 21) pkg/analyzer/lib/src/generated/error_verifier.dart:2852 — ErrorVerifier._checkForAllMixinErrorCodes 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.
D1 · Cyclomatic Complexity · FfiVerifier._isValidFfiNativeType (cyclomatic 21) · ×1
  • FfiVerifier._isValidFfiNativeType (cyclomatic 21) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1089 — FfiVerifier._isValidFfiNativeType 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.
D1 · Cyclomatic Complexity · FfiVerifier._validateCompatibleNativeType (cyclomatic 21) · ×1
  • FfiVerifier._validateCompatibleNativeType (cyclomatic 21) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1579 — FfiVerifier._validateCompatibleNativeType has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FfiVerifier._validateNativeCallable (cyclomatic 21) · ×1
  • FfiVerifier._validateNativeCallable (cyclomatic 21) pkg/analyzer/lib/src/generated/ffi_verifier.dart:2098 — FfiVerifier._validateNativeCallable 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.
D1 · Cyclomatic Complexity · MissingDependencyValidator.validate (cyclomatic 21) · ×1
  • MissingDependencyValidator.validate (cyclomatic 21) pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart:60 — MissingDependencyValidator.validate 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.
D1 · Cyclomatic Complexity · _Finder._visit (cyclomatic 21) · ×1
  • _Finder._visit (cyclomatic 21) pkg/analyzer/lib/src/summary2/type_alias.dart:83 — _Finder._visit 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.
D1 · Cyclomatic Complexity · DartEditBuilderImpl._canWriteType (cyclomatic 21) · ×1
  • DartEditBuilderImpl._canWriteType (cyclomatic 21) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1189 — DartEditBuilderImpl._canWriteType has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InferrerEngine._isFieldInitializerPotentiallyNull (cyclomatic 21) · ×1
  • InferrerEngine._isFieldInitializerPotentiallyNull (cyclomatic 21) pkg/compiler/lib/src/inferrer/engine.dart:769 — InferrerEngine._isFieldInitializerPotentiallyNull has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · ListTracerVisitor.visitDynamicCallSiteTypeInformation (cyclomatic 21) · ×1
  • ListTracerVisitor.visitDynamicCallSiteTypeInformation (cyclomatic 21) pkg/compiler/lib/src/inferrer/list_tracer.dart:175 — ListTracerVisitor.visitDynamicCallSiteTypeInformation 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.
D1 · Cyclomatic Complexity · KClassEnv._ensureMaps (cyclomatic 21) · ×1
  • KClassEnv._ensureMaps (cyclomatic 21) pkg/compiler/lib/src/kernel/env.dart:243 — KClassEnv._ensureMaps 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.
D1 · Cyclomatic Complexity · NativeEnqueuer._processNativeBehavior (cyclomatic 21) · ×1
  • NativeEnqueuer._processNativeBehavior (cyclomatic 21) pkg/compiler/lib/src/native/enqueue.dart:81 — NativeEnqueuer._processNativeBehavior 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.
D1 · Cyclomatic Complexity · ResolutionEnqueuer.processTypeUse (cyclomatic 21) · ×1
  • ResolutionEnqueuer.processTypeUse (cyclomatic 21) pkg/compiler/lib/src/resolution/enqueuer.dart:208 — ResolutionEnqueuer.processTypeUse has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ResolutionEnqueuer.processStaticUse (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DartCliDebugAdapter.launchAndRespond (cyclomatic 21) · ×1
  • DartCliDebugAdapter.launchAndRespond (cyclomatic 21) pkg/dap_adapters/lib/src/adapters/dart_cli_adapter.dart:73 — DartCliDebugAdapter.launchAndRespond has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProtocolConverter.convertVmInstanceRefToDisplayString (cyclomatic 21) · ×1
  • ProtocolConverter.convertVmInstanceRefToDisplayString (cyclomatic 21) pkg/dap_adapters/lib/src/protocol_converter.dart:45 — ProtocolConverter.convertVmInstanceRefToDisplayString 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.
D1 · Cyclomatic Complexity · MigrateCommand.run (cyclomatic 21) · ×1
  • MigrateCommand.run (cyclomatic 21) pkg/dartdev/lib/src/commands/migrate.dart:65 — MigrateCommand.run 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.
D1 · Cyclomatic Complexity · MiniJsParser.parsePrimary (cyclomatic 21) · ×1
  • MiniJsParser.parsePrimary (cyclomatic 21) pkg/dev_compiler/lib/src/js_ast/builder.dart:866 — MiniJsParser.parsePrimary has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MiniJsParser.categoryToString (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ProgramCompiler._emitCovarianceCheckStub (cyclomatic 21) · ×1
  • ProgramCompiler._emitCovarianceCheckStub (cyclomatic 21) pkg/dev_compiler/lib/src/kernel/compiler.dart:2690 — ProgramCompiler._emitCovarianceCheckStub 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.
D1 · Cyclomatic Complexity · LibraryCompiler._emitCovarianceCheckStub (cyclomatic 21) · ×1
  • LibraryCompiler._emitCovarianceCheckStub (cyclomatic 21) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3000 — LibraryCompiler._emitCovarianceCheckStub 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.
D1 · Cyclomatic Complexity · DillExtensionBuilder.DillExtensionBuilder (cyclomatic 21) · ×1
  • DillExtensionBuilder.DillExtensionBuilder (cyclomatic 21) pkg/front_end/lib/src/dill/dill_extension_builder.dart:35 — DillExtensionBuilder.DillExtensionBuilder 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.
D1 · Cyclomatic Complexity · ConstantEvaluator._evaluateSubexpression (cyclomatic 21) · ×1
  • ConstantEvaluator._evaluateSubexpression (cyclomatic 21) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3113 — ConstantEvaluator._evaluateSubexpression 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.
D1 · Cyclomatic Complexity · DynamicInterfaceSpecification.findNodes (cyclomatic 21) · ×1
  • DynamicInterfaceSpecification.findNodes (cyclomatic 21) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:216 — DynamicInterfaceSpecification.findNodes 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.
D1 · Cyclomatic Complexity · SourceExtensionTypeDeclarationBuilder.build (cyclomatic 21) · ×1
  • SourceExtensionTypeDeclarationBuilder.build (cyclomatic 21) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:256 — SourceExtensionTypeDeclarationBuilder.build has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceExtensionTypeDeclarationBuilder.addMemberInternal (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · InferenceVisitorBase._finishFieldGetterInvocation (cyclomatic 21) · ×1
  • InferenceVisitorBase._finishFieldGetterInvocation (cyclomatic 21) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3282 — InferenceVisitorBase._finishFieldGetterInvocation has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: InferenceVisitorBase._tearOffCall (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _Visitor.visitCompilationUnit (cyclomatic 21) · ×1
  • _Visitor.visitCompilationUnit (cyclomatic 21) pkg/linter/lib/src/rules/unreachable_from_main.dart:503 — _Visitor.visitCompilationUnit 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.
D1 · Cyclomatic Complexity · LineNumberProgram._readOpcodes (cyclomatic 21) · ×1
  • LineNumberProgram._readOpcodes (cyclomatic 21) pkg/native_stack_traces/lib/src/dwarf.dart:1560 — LineNumberProgram._readOpcodes has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: _AttributeForm.read (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Pdb._read (cyclomatic 21) · ×1
  • Pdb._read (cyclomatic 21) pkg/native_stack_traces/lib/src/pdb.dart:812 — Pdb._read 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.
D1 · Cyclomatic Complexity · InspectPage._visitObject (cyclomatic 21) · ×1
  • InspectPage._visitObject (cyclomatic 21) pkg/observatory/lib/src/app/page.dart:249 — InspectPage._visitObject has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Instruction.deserializeConst (cyclomatic 21) · ×1
  • Instruction.deserializeConst (cyclomatic 21) pkg/wasm_builder/lib/src/ir/instruction.dart:41 — Instruction.deserializeConst has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AnnotateKernel._convertType (cyclomatic 21) · ×1
  • AnnotateKernel._convertType (cyclomatic 21) pkg/vm/lib/transformations/type_flow/transformer.dart:498 — AnnotateKernel._convertType 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.
D1 · Cyclomatic Complexity · graphexplorer.Graph.loadDartHeapSnapshot (cyclomatic 21) · ×1
  • graphexplorer.Graph.loadDartHeapSnapshot (cyclomatic 21) runtime/tools/graphexplorer/graphexplorer.js:155 — graphexplorer.Graph.loadDartHeapSnapshot has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ConstantCreator._makeWasmArrayLiteral (cyclomatic 20) · ×1
  • ConstantCreator._makeWasmArrayLiteral (cyclomatic 20) pkg/dart2wasm/lib/constants.dart:1010 — ConstantCreator._makeWasmArrayLiteral has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Constants._lowerTypeConstantImpl (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Expect._deepEquals (cyclomatic 20) · ×1
  • Expect._deepEquals (cyclomatic 20) pkg/expect/lib/expect.dart:729 — Expect._deepEquals has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Analysis.reverseTransitiveGraph (cyclomatic 20) · ×1
  • Analysis.reverseTransitiveGraph (cyclomatic 20) pkg/heap_snapshot/lib/analysis.dart:335 — Analysis.reverseTransitiveGraph has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HttpClient._findProxyFromEnvironment (cyclomatic 20) · ×1
  • _HttpClient._findProxyFromEnvironment (cyclomatic 20) sdk/lib/_http/http_impl.dart:3307 — _HttpClient._findProxyFromEnvironment has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _HttpParser._headersEnd (cyclomatic 20) · ×1
  • _HttpParser._headersEnd (cyclomatic 20) sdk/lib/_http/http_parser.dart:388 — _HttpParser._headersEnd has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _WebSocketImpl.connect (cyclomatic 20) · ×1
  • _WebSocketImpl.connect (cyclomatic 20) sdk/lib/_http/websocket_impl.dart:1374 — _WebSocketImpl.connect has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Utf8Decoder._decodeGeneral (cyclomatic 20) · ×1
  • _Utf8Decoder._decodeGeneral (cyclomatic 20) sdk/lib/_internal/wasm/common/convert_patch.dart:2742 — _Utf8Decoder._decodeGeneral has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeReferenceIdentifierContext.ensureIdentifier (cyclomatic 20) · ×1
  • TypeReferenceIdentifierContext.ensureIdentifier (cyclomatic 20) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1495 — TypeReferenceIdentifierContext.ensureIdentifier has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Parser.parseDeclarationHeaderRecoveryInternal (cyclomatic 20) · ×1
  • Parser.parseDeclarationHeaderRecoveryInternal (cyclomatic 20) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3184 — Parser.parseDeclarationHeaderRecoveryInternal has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser._attemptPrecedenceLevelRecovery (cyclomatic 20) · ×1
  • Parser._attemptPrecedenceLevelRecovery (cyclomatic 20) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7631 — Parser._attemptPrecedenceLevelRecovery has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Parser.looksLikeExpressionAfterAwaitOrYield (cyclomatic 20) · ×1
  • Parser.looksLikeExpressionAfterAwaitOrYield (cyclomatic 20) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:10571 — Parser.looksLikeExpressionAfterAwaitOrYield has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComplexTypeInfo.parseType (cyclomatic 20) · ×1
  • ComplexTypeInfo.parseType (cyclomatic 20) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:618 — ComplexTypeInfo.parseType has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._suggestProperty (cyclomatic 20) · ×1
  • DeclarationHelper._suggestProperty (cyclomatic 20) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2556 — DeclarationHelper._suggestProperty has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddMissingClosureParameters._writeAdditions (cyclomatic 20) · ×1
  • AddMissingClosureParameters._writeAdditions (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/add_closure.dart:518 — AddMissingClosureParameters._writeAdditions has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AddConst.compute (cyclomatic 20) · ×1
  • AddConst.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/add_const.dart:32 — AddConst.compute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddNullCheck._computeTargetAndNullAwareToken (cyclomatic 20) · ×1
  • AddNullCheck._computeTargetAndNullAwareToken (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart:227 — AddNullCheck._computeTargetAndNullAwareToken has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConvertIntoGetter.compute (cyclomatic 20) · ×1
  • ConvertIntoGetter.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart:41 — ConvertIntoGetter.compute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToDeclaringParameter._getRefactorData (cyclomatic 20) · ×1
  • ConvertToDeclaringParameter._getRefactorData (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:388 — ConvertToDeclaringParameter._getRefactorData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateField._proposeFromIdentifier (cyclomatic 20) · ×1
  • CreateField._proposeFromIdentifier (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/create_field.dart:148 — CreateField._proposeFromIdentifier has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateGetter.compute (cyclomatic 20) · ×1
  • CreateGetter.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart:131 — CreateGetter.compute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateParameter.compute (cyclomatic 20) · ×1
  • CreateParameter.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/create_parameter.dart:30 — CreateParameter.compute has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RemoveDeadCode._handleDeadAtStartOfNode (cyclomatic 20) · ×1
  • RemoveDeadCode._handleDeadAtStartOfNode (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart:126 — RemoveDeadCode._handleDeadAtStartOfNode has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveIfNullOperator.compute (cyclomatic 20) · ×1
  • RemoveIfNullOperator.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart:26 — RemoveIfNullOperator.compute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtractMethodRefactoringImpl._checkSelection (cyclomatic 20) · ×1
  • ExtractMethodRefactoringImpl._checkSelection (cyclomatic 20) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:488 — ExtractMethodRefactoringImpl._checkSelection has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtractWidgetRefactoringImpl._initializeParameters (cyclomatic 20) · ×1
  • ExtractWidgetRefactoringImpl._initializeParameters (cyclomatic 20) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:276 — ExtractWidgetRefactoringImpl._initializeParameters has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MoveTopLevelToFile.compute (cyclomatic 20) · ×1
  • MoveTopLevelToFile.compute (cyclomatic 20) pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart:84 — MoveTopLevelToFile.compute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SymlinksPerformanceComponent.render (cyclomatic 20) · ×1
  • _SymlinksPerformanceComponent.render (cyclomatic 20) pkg/analysis_server/lib/src/status/pages/performance_page.dart:592 — _SymlinksPerformanceComponent.render has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtensionMemberResolver._isValidContext (cyclomatic 20) · ×1
  • ExtensionMemberResolver._isValidContext (cyclomatic 20) pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart:566 — ExtensionMemberResolver._isValidContext has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _ErrorHelper.reportNullOrNonTypeElement (cyclomatic 20) · ×1
  • _ErrorHelper.reportNullOrNonTypeElement (cyclomatic 20) pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart:705 — _ErrorHelper.reportNullOrNonTypeElement has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DocCommentBuilder._parseOneCommentReference (cyclomatic 20) · ×1
  • DocCommentBuilder._parseOneCommentReference (cyclomatic 20) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:605 — DocCommentBuilder._parseOneCommentReference has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForMixinClassErrorCodes (cyclomatic 20) · ×1
  • ErrorVerifier._checkForMixinClassErrorCodes (cyclomatic 20) pkg/analyzer/lib/src/generated/error_verifier.dart:6335 — ErrorVerifier._checkForMixinClassErrorCodes has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForMixinWithConflictingPrivateMember (cyclomatic 20) · ×1
  • ErrorVerifier._checkForMixinWithConflictingPrivateMember (cyclomatic 20) pkg/analyzer/lib/src/generated/error_verifier.dart:6575 — ErrorVerifier._checkForMixinWithConflictingPrivateMember has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiVerifier._validateFieldsInCompound (cyclomatic 20) · ×1
  • FfiVerifier._validateFieldsInCompound (cyclomatic 20) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1729 — FfiVerifier._validateFieldsInCompound has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiVerifier._validateNativeAddressOf (cyclomatic 20) · ×1
  • FfiVerifier._validateNativeAddressOf (cyclomatic 20) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1972 — FfiVerifier._validateNativeAddressOf has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiVerifier._validateSizeOfAnnotation (cyclomatic 20) · ×1
  • FfiVerifier._validateSizeOfAnnotation (cyclomatic 20) pkg/analyzer/lib/src/generated/ffi_verifier.dart:2313 — FfiVerifier._validateSizeOfAnnotation has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementBuilder._buildInstanceElementMembers (cyclomatic 20) · ×1
  • ElementBuilder._buildInstanceElementMembers (cyclomatic 20) pkg/analyzer/lib/src/summary2/element_builder.dart:95 — ElementBuilder._buildInstanceElementMembers has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _InfoBuilder.build (cyclomatic 20) · ×1
  • _InfoBuilder.build (cyclomatic 20) pkg/analyzer/lib/src/summary2/informative_data.dart:571 — _InfoBuilder.build has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypesBuilder._declaration (cyclomatic 20) · ×1
  • TypesBuilder._declaration (cyclomatic 20) pkg/analyzer/lib/src/summary2/types_builder.dart:152 — TypesBuilder._declaration has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DartEditBuilderImpl.writeOverride (cyclomatic 20) · ×1
  • DartEditBuilderImpl.writeOverride (cyclomatic 20) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:663 — DartEditBuilderImpl.writeOverride has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisOptionLinkComputer.findLinks (cyclomatic 20) · ×1
  • AnalysisOptionLinkComputer.findLinks (cyclomatic 20) pkg/analyzer_plugin/lib/src/utilities/navigation/document_links.dart:26 — AnalysisOptionLinkComputer.findLinks has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _Builder.build (cyclomatic 20) · ×1
  • _Builder.build (cyclomatic 20) pkg/compiler/lib/src/deferred_load/program_split_constraints/builder.dart:79 — _Builder.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodegenEnqueuer.processTypeUse (cyclomatic 20) · ×1
  • CodegenEnqueuer.processTypeUse (cyclomatic 20) pkg/compiler/lib/src/js_backend/enqueuer.dart:194 — CodegenEnqueuer.processTypeUse has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: CodegenEnqueuer.processStaticUse (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · JsKernelToElementMap.readFromDataSource (cyclomatic 20) · ×1
  • JsKernelToElementMap.readFromDataSource (cyclomatic 20) pkg/compiler/lib/src/js_model/element_map_impl.dart:275 — JsKernelToElementMap.readFromDataSource has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SsaCodeGenerator.visitInvokeExternal (cyclomatic 20) · ×1
  • SsaCodeGenerator.visitInvokeExternal (cyclomatic 20) pkg/compiler/lib/src/ssa/codegen.dart:2901 — SsaCodeGenerator.visitInvokeExternal has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaLoadElimination.visitBasicBlock (cyclomatic 20) · ×1
  • SsaLoadElimination.visitBasicBlock (cyclomatic 20) pkg/compiler/lib/src/ssa/optimize.dart:4435 — SsaLoadElimination.visitBasicBlock has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodegenWorldBuilder._getMemberUsage (cyclomatic 20) · ×1
  • CodegenWorldBuilder._getMemberUsage (cyclomatic 20) pkg/compiler/lib/src/universe/codegen_world_builder.dart:495 — CodegenWorldBuilder._getMemberUsage has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CodegenWorldBuilder.registerStaticUse (cyclomatic 24) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ResolutionWorldBuilder._processMemberInUsedClass (cyclomatic 20) · ×1
  • ResolutionWorldBuilder._processMemberInUsedClass (cyclomatic 20) pkg/compiler/lib/src/universe/resolution_world_builder.dart:886 — ResolutionWorldBuilder._processMemberInUsedClass has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartRuntimeServiceDdsBackend.initialize (cyclomatic 20) · ×1
  • DartRuntimeServiceDdsBackend.initialize (cyclomatic 20) pkg/dart_runtime_service_dds/lib/src/dds_backend.dart:169 — DartRuntimeServiceDdsBackend.initialize has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompileNativeCommand.run (cyclomatic 20) · ×1
  • CompileNativeCommand.run (cyclomatic 20) pkg/dartdev/lib/src/commands/compile.dart:638 — CompileNativeCommand.run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecutableCompiler.isSnapshotFresh (cyclomatic 20) · ×1
  • ExecutableCompiler.isSnapshotFresh (cyclomatic 20) pkg/dartdev/lib/src/executable_compiler.dart:131 — ExecutableCompiler.isSnapshotFresh has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler._emitImports (cyclomatic 20) · ×1
  • ProgramCompiler._emitImports (cyclomatic 20) pkg/dev_compiler/lib/src/kernel/compiler.dart:8913 — ProgramCompiler._emitImports has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitClassDeclaration (cyclomatic 20) · ×1
  • LibraryCompiler._emitClassDeclaration (cyclomatic 20) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1463 — LibraryCompiler._emitClassDeclaration has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitLibraryMembers (cyclomatic 20) · ×1
  • LibraryCompiler._emitLibraryMembers (cyclomatic 20) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4051 — LibraryCompiler._emitLibraryMembers has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler.updateNeededDillLibrariesWithHierarchy (cyclomatic 20) · ×1
  • IncrementalCompiler.updateNeededDillLibrariesWithHierarchy (cyclomatic 20) pkg/front_end/lib/src/base/incremental_compiler.dart:1632 — IncrementalCompiler.updateNeededDillLibrariesWithHierarchy has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FactoryEncoding.inferRedirectionTarget (cyclomatic 20) · ×1
  • FactoryEncoding.inferRedirectionTarget (cyclomatic 20) pkg/front_end/lib/src/fragment/factory/encoding.dart:223 — FactoryEncoding.inferRedirectionTarget has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FactoryEncoding.resolveRedirectingFactory (cyclomatic 20) · ×1
  • FactoryEncoding.resolveRedirectingFactory (cyclomatic 20) pkg/front_end/lib/src/fragment/factory/encoding.dart:368 — FactoryEncoding.resolveRedirectingFactory has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.endFormalParameters (cyclomatic 20) · ×1
  • BodyBuilderImpl.endFormalParameters (cyclomatic 20) pkg/front_end/lib/src/kernel/body_builder.dart:3951 — BodyBuilderImpl.endFormalParameters has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _InitializerBuilder.processInitializers (cyclomatic 20) · ×1
  • _InitializerBuilder.processInitializers (cyclomatic 20) pkg/front_end/lib/src/kernel/resolver_helpers.dart:230 — _InitializerBuilder.processInitializers has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceClassBuilder.checkMethodOverride (cyclomatic 20) · ×1
  • SourceClassBuilder.checkMethodOverride (cyclomatic 20) pkg/front_end/lib/src/source/source_class_builder.dart:1835 — SourceClassBuilder.checkMethodOverride has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceLoader._createSourceCompilationUnit (cyclomatic 20) · ×1
  • SourceLoader._createSourceCompilationUnit (cyclomatic 20) pkg/front_end/lib/src/source/source_loader.dart:487 — SourceLoader._createSourceCompilationUnit has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FrontendServerClient.start (cyclomatic 20) · ×1
  • FrontendServerClient.start (cyclomatic 20) pkg/frontend_server_client/lib/src/frontend_server_client.dart:36 — FrontendServerClient.start has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MiniJsParser.getString (cyclomatic 20) · ×1
  • MiniJsParser.getString (cyclomatic 20) pkg/js_ast/lib/src/builder.dart:579 — MiniJsParser.getString has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartTypeEquivalence.visitFunctionType (cyclomatic 20) · ×1
  • DartTypeEquivalence.visitFunctionType (cyclomatic 20) pkg/kernel/lib/src/dart_type_equivalence.dart:43 — DartTypeEquivalence.visitFunctionType has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._checkTopLevelFragment (cyclomatic 20) · ×1
  • _Visitor._checkTopLevelFragment (cyclomatic 20) pkg/linter/lib/src/rules/analyzer_public_api.dart:162 — _Visitor._checkTopLevelFragment has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _Visitor.visitSwitchCase (cyclomatic 20) · ×1
  • _Visitor.visitSwitchCase (cyclomatic 20) pkg/linter/lib/src/rules/invalid_case_patterns.dart:49 — _Visitor.visitSwitchCase has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitInstanceCreationExpression (cyclomatic 20) · ×1
  • _Visitor.visitInstanceCreationExpression (cyclomatic 20) pkg/linter/lib/src/rules/prefer_collection_literals.dart:40 — _Visitor.visitInstanceCreationExpression has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._visitVariableDeclarationList (cyclomatic 20) · ×1
  • _Visitor._visitVariableDeclarationList (cyclomatic 20) pkg/linter/lib/src/rules/specify_nonobvious_property_types.dart:59 — _Visitor._visitVariableDeclarationList has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _LineNumberContentType.validate (cyclomatic 20) · ×1
  • _LineNumberContentType.validate (cyclomatic 20) pkg/native_stack_traces/lib/src/dwarf.dart:1071 — _LineNumberContentType.validate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: _AttributeForm.read (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TreeMap._createTreemapTile (cyclomatic 20) · ×1
  • TreeMap._createTreemapTile (cyclomatic 20) pkg/observatory/lib/src/elements/tree_map.dart:32 — TreeMap._createTreemapTile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NameSection.deserialize (cyclomatic 20) · ×1
  • NameSection.deserialize (cyclomatic 20) pkg/wasm_builder/lib/src/serialize/sections.dart:1044 — NameSection.deserialize has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · WidgetCreatorTracker._resolveWellKnownClasses (cyclomatic 20) · ×1
  • WidgetCreatorTracker._resolveWellKnownClasses (cyclomatic 20) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:397 — WidgetCreatorTracker._resolveWellKnownClasses has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Summary.apply (cyclomatic 20) · ×1
  • Summary.apply (cyclomatic 20) pkg/vm/lib/transformations/type_flow/summary.dart:1222 — Summary.apply has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _TreeShakerPass2.defaultMember (cyclomatic 20) · ×1
  • _TreeShakerPass2.defaultMember (cyclomatic 20) pkg/vm/lib/transformations/type_flow/transformer.dart:2539 — _TreeShakerPass2.defaultMember has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · graphexplorer.createTreemapTile (cyclomatic 20) · ×1
  • graphexplorer.createTreemapTile (cyclomatic 20) runtime/tools/graphexplorer/graphexplorer.js:1279 — graphexplorer.createTreemapTile has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ImplGenerator.generate (cyclomatic 19) · ×1
  • _ImplGenerator.generate (cyclomatic 19) pkg/analyzer/tool/summary/generate.dart:953 — _ImplGenerator.generate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GraphIsomorphizer.generateRootImport (cyclomatic 19) · ×1
  • GraphIsomorphizer.generateRootImport (cyclomatic 19) pkg/compiler/tool/graph_isomorphizer.dart:189 — GraphIsomorphizer.generateRootImport has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Component.write (cyclomatic 19) · ×1
  • Component.write (cyclomatic 19) pkg/dart2bytecode/lib/declarations.dart:1437 — Component.write has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _ConstObjectHandle.== (cyclomatic 19) · ×1
  • _ConstObjectHandle.== (cyclomatic 19) pkg/dart2bytecode/lib/object_table.dart:1497 — _ConstObjectHandle.== has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ObjectHandle._empty (cyclomatic 24) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AstCodeGenerator._setupLocalParameters (cyclomatic 19) · ×1
  • AstCodeGenerator._setupLocalParameters (cyclomatic 19) pkg/dart2wasm/lib/code_generator.dart:248 — AstCodeGenerator._setupLocalParameters has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstructorInitializerCodeGenerator.generateInitializerList (cyclomatic 19) · ×1
  • ConstructorInitializerCodeGenerator.generateInitializerList (cyclomatic 19) pkg/dart2wasm/lib/code_generator.dart:4376 — ConstructorInitializerCodeGenerator.generateInitializerList has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · FunctionCollector.getFunction (cyclomatic 19) · ×1
  • FunctionCollector.getFunction (cyclomatic 19) pkg/dart2wasm/lib/functions.dart:102 — FunctionCollector.getFunction has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Types.isTypeConstant (cyclomatic 19) · ×1
  • Types.isTypeConstant (cyclomatic 19) pkg/dart2wasm/lib/types.dart:121 — Types.isTypeConstant has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · C.m (cyclomatic 19) · ×1
  • C.m (cyclomatic 19) pkg/front_end/testcases/general/for_in_without_declaration.dart:21 — C.m has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Analysis.transitiveGraph (cyclomatic 19) · ×1
  • Analysis.transitiveGraph (cyclomatic 19) pkg/heap_snapshot/lib/analysis.dart:259 — Analysis.transitiveGraph has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HttpOutgoing.addStream (cyclomatic 19) · ×1
  • _HttpOutgoing.addStream (cyclomatic 19) sdk/lib/_http/http_impl.dart:1884 — _HttpOutgoing.addStream has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _StringBase.createFromCharCodes (cyclomatic 19) · ×1
  • _StringBase.createFromCharCodes (cyclomatic 19) sdk/lib/_internal/vm/lib/string_patch.dart:115 — _StringBase.createFromCharCodes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _BigIntImpl._divRem (cyclomatic 19) · ×1
  • _BigIntImpl._divRem (cyclomatic 19) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1477 — _BigIntImpl._divRem has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _TypeUniverse.substituteTypeArgument (cyclomatic 19) · ×1
  • _TypeUniverse.substituteTypeArgument (cyclomatic 19) sdk/lib/_internal/wasm/common/type.dart:808 — _TypeUniverse.substituteTypeArgument has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _TypeUniverse.isFunctionSubtype (cyclomatic 19) · ×1
  • _TypeUniverse.isFunctionSubtype (cyclomatic 19) sdk/lib/_internal/wasm/common/type.dart:1221 — _TypeUniverse.isFunctionSubtype has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitSimdOp (cyclomatic 19) · ×1
  • Arm64CodeGenerator.visitSimdOp (cyclomatic 19) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2649 — Arm64CodeGenerator.visitSimdOp has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Arm64CodeGenerator.visitUnaryDoubleOp (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LinearScanRegisterAllocator.allocateBlockedRegister (cyclomatic 19) · ×1
  • LinearScanRegisterAllocator.allocateBlockedRegister (cyclomatic 19) pkg/native_compiler/lib/back_end/register_allocator.dart:755 — LinearScanRegisterAllocator.allocateBlockedRegister has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MultiBinaryLoader.load (cyclomatic 19) · ×1
  • MultiBinaryLoader.load (cyclomatic 19) pkg/kernel/lib/binary/multi_binary_loader.dart:53 — MultiBinaryLoader.load has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Object.hash (cyclomatic 19) · ×1
  • Object.hash (cyclomatic 19) sdk/lib/core/object.dart:152 — Object.hash has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Uri._makeHttpUri (cyclomatic 19) · ×1
  • _Uri._makeHttpUri (cyclomatic 19) sdk/lib/core/uri.dart:2053 — _Uri._makeHttpUri has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Uri.replace (cyclomatic 19) · ×1
  • _Uri.replace (cyclomatic 19) sdk/lib/core/uri.dart:2282 — _Uri.replace has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConstantFolding.binaryIntOp (cyclomatic 19) · ×1
  • ConstantFolding.binaryIntOp (cyclomatic 19) pkg/cfg/lib/ir/constant_value.dart:125 — ConstantFolding.binaryIntOp has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Parser.parseImportRecovery (cyclomatic 19) · ×1
  • Parser.parseImportRecovery (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:994 — Parser.parseImportRecovery has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseRecordType (cyclomatic 19) · ×1
  • Parser.parseRecordType (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:1738 — Parser.parseRecordType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseParenthesizedExpressionOrRecordLiteral (cyclomatic 19) · ×1
  • Parser.parseParenthesizedExpressionOrRecordLiteral (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8312 — Parser.parseParenthesizedExpressionOrRecordLiteral has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseLiteralSetOrMapSuffix (cyclomatic 19) · ×1
  • Parser.parseLiteralSetOrMapSuffix (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8574 — Parser.parseLiteralSetOrMapSuffix has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseConstExpression (cyclomatic 19) · ×1
  • Parser.parseConstExpression (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9042 — Parser.parseConstExpression has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.parseSend (cyclomatic 19) · ×1
  • Parser.parseSend (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9364 — Parser.parseSend has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser.computeTypeAfterIsOrAs (cyclomatic 19) · ×1
  • Parser.computeTypeAfterIsOrAs (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9674 — Parser.computeTypeAfterIsOrAs has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Parser.parseTryStatement (cyclomatic 19) · ×1
  • Parser.parseTryStatement (cyclomatic 19) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:10729 — Parser.parseTryStatement has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember (cyclomatic 19) · ×1
  • JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember (cyclomatic 19) pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart:301 — JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DartUnitHighlightsComputerVisitor._findEscapes (cyclomatic 19) · ×1
  • _DartUnitHighlightsComputerVisitor._findEscapes (cyclomatic 19) pkg/analysis_server/lib/src/computer/computer_highlights.dart:2102 — _DartUnitHighlightsComputerVisitor._findEscapes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextManagerImpl._handleWatchEvent (cyclomatic 19) · ×1
  • ContextManagerImpl._handleWatchEvent (cyclomatic 19) pkg/analysis_server/lib/src/context_manager.dart:968 — ContextManagerImpl._handleWatchEvent has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EditArgumentHandler._writeNewArgument (cyclomatic 19) · ×1
  • EditArgumentHandler._writeNewArgument (cyclomatic 19) pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_edit_argument.dart:372 — EditArgumentHandler._writeNewArgument has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SummaryWriter.summarize (cyclomatic 19) · ×1
  • SummaryWriter.summarize (cyclomatic 19) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:70 — SummaryWriter.summarize has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DevAnalysisServer.processDirectories (cyclomatic 19) · ×1
  • DevAnalysisServer.processDirectories (cyclomatic 19) pkg/analysis_server/lib/src/server/dev_server.dart:37 — DevAnalysisServer.processDirectories has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeclarationHelper.addLexicalDeclarations (cyclomatic 19) · ×1
  • DeclarationHelper.addLexicalDeclarations (cyclomatic 19) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:441 — DeclarationHelper.addLexicalDeclarations has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeclarationHelper._addInheritedMembers (cyclomatic 19) · ×1
  • DeclarationHelper._addInheritedMembers (cyclomatic 19) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1124 — DeclarationHelper._addInheritedMembers has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · KeywordHelper.addFieldDeclarationKeywords (cyclomatic 19) · ×1
  • KeywordHelper.addFieldDeclarationKeywords (cyclomatic 19) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:444 — KeywordHelper.addFieldDeclarationKeywords has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementCompletionProcessor._complete_tryStatement (cyclomatic 19) · ×1
  • StatementCompletionProcessor._complete_tryStatement (cyclomatic 19) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:1029 — StatementCompletionProcessor._complete_tryStatement has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddAwait.compute (cyclomatic 19) · ×1
  • AddAwait.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/add_await.dart:47 — AddAwait.compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddKeyToConstructors._updateSuper (cyclomatic 19) · ×1
  • AddKeyToConstructors._updateSuper (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart:254 — AddKeyToConstructors._updateSuper has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddMissingEnumCaseClauses.compute (cyclomatic 19) · ×1
  • AddMissingEnumCaseClauses.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:26 — AddMissingEnumCaseClauses.compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChangeTo._proposeGetterOrSetter (cyclomatic 19) · ×1
  • ChangeTo._proposeGetterOrSetter (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:337 — ChangeTo._proposeGetterOrSetter has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _EnumDescription._removeUnnamedConstructor (cyclomatic 19) · ×1
  • _EnumDescription._removeUnnamedConstructor (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:369 — _EnumDescription._removeUnnamedConstructor has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertForEachToForLoop.compute (cyclomatic 19) · ×1
  • ConvertForEachToForLoop.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:28 — ConvertForEachToForLoop.compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToWildcardVariable.compute (cyclomatic 19) · ×1
  • ConvertToWildcardVariable.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/convert_to_wildcard_variable.dart:37 — ConvertToWildcardVariable.compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateExtensionSetter.compute (cyclomatic 19) · ×1
  • CreateExtensionSetter.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:513 — CreateExtensionSetter.compute has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateMethod._createMethodFromMethodInvocation (cyclomatic 19) · ×1
  • CreateMethod._createMethodFromMethodInvocation (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/create_method.dart:127 — CreateMethod._createMethodFromMethodInvocation has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CreateMixin.compute (cyclomatic 19) · ×1
  • _CreateMixin.compute (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:134 — _CreateMixin.compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PubspecFixGenerator.computeFixes (cyclomatic 19) · ×1
  • PubspecFixGenerator.computeFixes (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart:75 — PubspecFixGenerator.computeFixes has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PubspecFixProcessor._fixFile (cyclomatic 19) · ×1
  • PubspecFixProcessor._fixFile (cyclomatic 19) pkg/analysis_server/lib/src/services/correction/fix/pubspec/pubspec_fix_processor.dart:132 — PubspecFixProcessor._fixFile has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstNodeImpl._lexicallyFirst (cyclomatic 19) · ×1
  • AstNodeImpl._lexicallyFirst (cyclomatic 19) pkg/analyzer/lib/src/dart/ast/ast.dart:3461 — AstNodeImpl._lexicallyFirst has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _ConstLiteralVerifier._validateMapLiteralEntry (cyclomatic 19) · ×1
  • _ConstLiteralVerifier._validateMapLiteralEntry (cyclomatic 19) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1530 — _ConstLiteralVerifier._validateMapLiteralEntry has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantVisitor._getDeferredLibraryError (cyclomatic 19) · ×1
  • ConstantVisitor._getDeferredLibraryError (cyclomatic 19) pkg/analyzer/lib/src/dart/constant/evaluation.dart:2067 — ConstantVisitor._getDeferredLibraryError has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypeSystemImpl.isMoreBottom (cyclomatic 19) · ×1
  • TypeSystemImpl.isMoreBottom (cyclomatic 19) pkg/analyzer/lib/src/dart/element/type_system.dart:1066 — TypeSystemImpl.isMoreBottom has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypeSystemImpl.isMoreTop (cyclomatic 19) · ×1
  • TypeSystemImpl.isMoreTop (cyclomatic 19) pkg/analyzer/lib/src/dart/element/type_system.dart:1150 — TypeSystemImpl.isMoreTop has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypeSystemImpl._refineNumericInvocationContextNullSafe (cyclomatic 19) · ×1
  • TypeSystemImpl._refineNumericInvocationContextNullSafe (cyclomatic 19) pkg/analyzer/lib/src/dart/element/type_system.dart:1947 — TypeSystemImpl._refineNumericInvocationContextNullSafe has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BinaryExpressionResolver._resolveEqual (cyclomatic 19) · ×1
  • BinaryExpressionResolver._resolveEqual (cyclomatic 19) pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart:165 — BinaryExpressionResolver._resolveEqual has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PropertyElementResolver.resolveIndexReadWriteAssignmentTarget (cyclomatic 19) · ×1
  • PropertyElementResolver.resolveIndexReadWriteAssignmentTarget (cyclomatic 19) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:493 — PropertyElementResolver.resolveIndexReadWriteAssignmentTarget has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScopeAnalyzer._resolveType (cyclomatic 19) · ×1
  • ScopeAnalyzer._resolveType (cyclomatic 19) pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:1651 — ScopeAnalyzer._resolveType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer.checkForBodyMayCompleteNormally (cyclomatic 19) · ×1
  • TypeAnalyzer.checkForBodyMayCompleteNormally (cyclomatic 19) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:640 — TypeAnalyzer.checkForBodyMayCompleteNormally has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer.prepareForResolving (cyclomatic 19) · ×1
  • TypeAnalyzer.prepareForResolving (cyclomatic 19) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:1482 — TypeAnalyzer.prepareForResolving has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BestPracticesVerifier._getSubExpressionsMarkedDoNotStore (cyclomatic 19) · ×1
  • BestPracticesVerifier._getSubExpressionsMarkedDoNotStore (cyclomatic 19) pkg/analyzer/lib/src/error/best_practices_verifier.dart:1613 — BestPracticesVerifier._getSubExpressionsMarkedDoNotStore has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConstArgumentsVerifier._isConst (cyclomatic 19) · ×1
  • ConstArgumentsVerifier._isConst (cyclomatic 19) pkg/analyzer/lib/src/error/const_argument_verifier.dart:192 — ConstArgumentsVerifier._isConst has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · IgnoreValidator.reportErrors (cyclomatic 19) · ×1
  • IgnoreValidator.reportErrors (cyclomatic 19) pkg/analyzer/lib/src/error/ignore_validator.dart:72 — IgnoreValidator.reportErrors has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiteralElementVerifier._verifyElement (cyclomatic 19) · ×1
  • LiteralElementVerifier._verifyElement (cyclomatic 19) pkg/analyzer/lib/src/error/literal_element_verifier.dart:88 — LiteralElementVerifier._verifyElement has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForFunctionBodyCompleteness (cyclomatic 19) · ×1
  • ErrorVerifier._checkForFunctionBodyCompleteness (cyclomatic 19) pkg/analyzer/lib/src/generated/error_verifier.dart:5704 — ErrorVerifier._checkForFunctionBodyCompleteness has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · FuzzyMatcher.fuzzyMap (cyclomatic 19) · ×1
  • FuzzyMatcher.fuzzyMap (cyclomatic 19) pkg/analyzer/lib/src/utilities/fuzzy_matcher.dart:298 — FuzzyMatcher.fuzzyMap has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartEditBuilderImpl.writeComment (cyclomatic 19) · ×1
  • DartEditBuilderImpl.writeComment (cyclomatic 19) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:169 — DartEditBuilderImpl.writeComment has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment (cyclomatic 19) · ×1
  • DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment (cyclomatic 19) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3183 — DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeferredLoadTask.dump (cyclomatic 19) · ×1
  • DeferredLoadTask.dump (cyclomatic 19) pkg/compiler/lib/src/deferred_load/deferred_load.dart:585 — DeferredLoadTask.dump has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferrerEngine.analyze (cyclomatic 19) · ×1
  • InferrerEngine.analyze (cyclomatic 19) pkg/compiler/lib/src/inferrer/engine.dart:676 — InferrerEngine.analyze has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DynamicCallSiteTypeInformation.computeType (cyclomatic 19) · ×1
  • DynamicCallSiteTypeInformation.computeType (cyclomatic 19) pkg/compiler/lib/src/inferrer/type_graph_nodes.dart:1431 — DynamicCallSiteTypeInformation.computeType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommonMasks._createFromStaticType (cyclomatic 19) · ×1
  • CommonMasks._createFromStaticType (cyclomatic 19) pkg/compiler/lib/src/inferrer/typemasks/masks.dart:332 — CommonMasks._createFromStaticType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramBuilder._buildMethod (cyclomatic 19) · ×1
  • ProgramBuilder._buildMethod (cyclomatic 19) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:965 — ProgramBuilder._buildMethod has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeBehavior.processEffects (cyclomatic 19) · ×1
  • NativeBehavior.processEffects (cyclomatic 19) pkg/compiler/lib/src/native/behavior.dart:503 — NativeBehavior.processEffects has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CompilerOptions.deriveOptions (cyclomatic 19) · ×1
  • CompilerOptions.deriveOptions (cyclomatic 19) pkg/compiler/lib/src/options.dart:1096 — CompilerOptions.deriveOptions has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DominatedUses._compute (cyclomatic 19) · ×1
  • DominatedUses._compute (cyclomatic 19) pkg/compiler/lib/src/ssa/nodes.dart:1655 — DominatedUses._compute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitParameterValue (cyclomatic 19) · ×1
  • SsaInstructionSimplifier.visitParameterValue (cyclomatic 19) pkg/compiler/lib/src/ssa/optimize.dart:676 — SsaInstructionSimplifier.visitParameterValue has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartDebugAdapter._buildOutputEventsWithSourceReferences (cyclomatic 19) · ×1
  • DartDebugAdapter._buildOutputEventsWithSourceReferences (cyclomatic 19) pkg/dap_adapters/lib/src/adapters/dart.dart:3027 — DartDebugAdapter._buildOutputEventsWithSourceReferences has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DDSRunner.start (cyclomatic 19) · ×1
  • DDSRunner.start (cyclomatic 19) pkg/dartdev/lib/src/dds_runner.dart:17 — DDSRunner.start has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Debugger._pauseHandler (cyclomatic 19) · ×1
  • Debugger._pauseHandler (cyclomatic 19) pkg/dwds/lib/src/debugging/debugger.dart:544 — Debugger._pauseHandler has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler._computeDelta (cyclomatic 19) · ×1
  • IncrementalCompiler._computeDelta (cyclomatic 19) pkg/front_end/lib/src/base/incremental_compiler.dart:352 — IncrementalCompiler._computeDelta has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IncrementalCompiler.compileExpression (cyclomatic 19) · ×1
  • IncrementalCompiler.compileExpression (cyclomatic 19) pkg/front_end/lib/src/base/incremental_compiler.dart:2027 — IncrementalCompiler.compileExpression has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _InitializationFromUri._initializeFromDill (cyclomatic 19) · ×1
  • _InitializationFromUri._initializeFromDill (cyclomatic 19) pkg/front_end/lib/src/base/incremental_compiler.dart:3508 — _InitializationFromUri._initializeFromDill has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamedTypeBuilderImpl.computeTypeParameterBuilderVariance (cyclomatic 19) · ×1
  • NamedTypeBuilderImpl.computeTypeParameterBuilderVariance (cyclomatic 19) pkg/front_end/lib/src/builder/named_type_builder.dart:847 — NamedTypeBuilderImpl.computeTypeParameterBuilderVariance has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: NamedTypeBuilderImpl._checkDeferred (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · KernelTarget.installForwardingConstructors (cyclomatic 19) · ×1
  • KernelTarget.installForwardingConstructors (cyclomatic 19) pkg/front_end/lib/src/kernel/kernel_target.dart:932 — KernelTarget.installForwardingConstructors has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceLibraryBuilder._buildOutlineNodes (cyclomatic 19) · ×1
  • SourceLibraryBuilder._buildOutlineNodes (cyclomatic 19) pkg/front_end/lib/src/source/source_library_builder.dart:1064 — SourceLibraryBuilder._buildOutlineNodes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceLibraryBuilder.checkPendingBoundsChecks (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · VerifyingAnalysis.run (cyclomatic 19) · ×1
  • VerifyingAnalysis.run (cyclomatic 19) pkg/front_end/lib/src/testing/verifying_analysis.dart:29 — VerifyingAnalysis.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorBase._inferInstanceMethodInvocation (cyclomatic 19) · ×1
  • InferenceVisitorBase._inferInstanceMethodInvocation (cyclomatic 19) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3036 — InferenceVisitorBase._inferInstanceMethodInvocation has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: InferenceVisitorBase._tearOffCall (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · IncrementalJavaScriptBundler.compile (cyclomatic 19) · ×1
  • IncrementalJavaScriptBundler.compile (cyclomatic 19) pkg/frontend_server/lib/src/javascript_bundle.dart:252 — IncrementalJavaScriptBundler.compile has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MiniJsParser.parsePrimary (cyclomatic 19) · ×1
  • MiniJsParser.parsePrimary (cyclomatic 19) pkg/js_ast/lib/src/builder.dart:790 — MiniJsParser.parsePrimary has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionType.equals (cyclomatic 19) · ×1
  • FunctionType.equals (cyclomatic 19) pkg/kernel/lib/src/ast/types.dart:1466 — FunctionType.equals has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._problemsForAnalyzerPublicApi (cyclomatic 19) · ×1
  • _Visitor._problemsForAnalyzerPublicApi (cyclomatic 19) pkg/linter/lib/src/rules/analyzer_public_api.dart:362 — _Visitor._problemsForAnalyzerPublicApi has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _Visitor._nestedTypePairs (cyclomatic 19) · ×1
  • _Visitor._nestedTypePairs (cyclomatic 19) pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:744 — _Visitor._nestedTypePairs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileInfo.fromReaderDwarf5 (cyclomatic 19) · ×1
  • FileInfo.fromReaderDwarf5 (cyclomatic 19) pkg/native_stack_traces/lib/src/dwarf.dart:1154 — FileInfo.fromReaderDwarf5 has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _AttributeForm.read (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · VirtualCollectionElement.render (cyclomatic 19) · ×1
  • VirtualCollectionElement.render (cyclomatic 19) pkg/observatory/lib/src/elements/containers/virtual_collection.dart:142 — VirtualCollectionElement.render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NameSection.serializeContents (cyclomatic 19) · ×1
  • NameSection.serializeContents (cyclomatic 19) pkg/wasm_builder/lib/src/serialize/sections.dart:910 — NameSection.serializeContents has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MoveFieldInitializers.transformClass (cyclomatic 19) · ×1
  • MoveFieldInitializers.transformClass (cyclomatic 19) pkg/vm/lib/transformations/type_flow/transformer.dart:221 — MoveFieldInitializers.transformClass has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · graphexplorer.Graph.rewriteEdgesForOwners (cyclomatic 19) · ×1
  • graphexplorer.Graph.rewriteEdgesForOwners (cyclomatic 19) runtime/tools/graphexplorer/graphexplorer.js:381 — graphexplorer.Graph.rewriteEdgesForOwners has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hotRestart (cyclomatic 19) · ×1
  • hotRestart (cyclomatic 19) REDACTED:481 — hotRestart has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsInteropChecks._checkDisallowedTearoff (cyclomatic 18) · ×1
  • JsInteropChecks._checkDisallowedTearoff (cyclomatic 18) pkg/_js_interop_checks/lib/js_interop_checks.dart:685 — JsInteropChecks._checkDisallowedTearoff has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartLanguageServerBenchmark._launch (cyclomatic 18) · ×1
  • DartLanguageServerBenchmark._launch (cyclomatic 18) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:256 — DartLanguageServerBenchmark._launch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogEntry.from (cyclomatic 18) · ×1
  • LogEntry.from (cyclomatic 18) pkg/analysis_server/tool/instrumentation/log/log.dart:573 — LogEntry.from has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AstNodeImplGenerator._buildImplClass (cyclomatic 18) · ×1
  • AstNodeImplGenerator._buildImplClass (cyclomatic 18) pkg/analyzer/tool/generators/ast_generator.dart:67 — AstNodeImplGenerator._buildImplClass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstNodeImplGenerator._generateBeginToken (cyclomatic 18) · ×1
  • AstNodeImplGenerator._generateBeginToken (cyclomatic 18) pkg/analyzer/tool/generators/ast_generator.dart:315 — AstNodeImplGenerator._generateBeginToken has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ErrorCodeDocumentationParser.processCodeBlock (cyclomatic 18) · ×1
  • _ErrorCodeDocumentationParser.processCodeBlock (cyclomatic 18) pkg/analyzer/tool/messages/error_code_documentation_info.dart:173 — _ErrorCodeDocumentationParser.processCodeBlock has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BytecodeGenerator.getClassDeclaration (cyclomatic 18) · ×1
  • BytecodeGenerator.getClassDeclaration (cyclomatic 18) pkg/dart2bytecode/lib/bytecode_generator.dart:313 — BytecodeGenerator.getClassDeclaration has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BytecodeGenerator.getClosureDeclaration (cyclomatic 18) · ×1
  • BytecodeGenerator.getClosureDeclaration (cyclomatic 18) pkg/dart2bytecode/lib/bytecode_generator.dart:2689 — BytecodeGenerator.getClosureDeclaration has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FieldDeclaration.toString (cyclomatic 18) · ×1
  • FieldDeclaration.toString (cyclomatic 18) pkg/dart2bytecode/lib/declarations.dart:492 — FieldDeclaration.toString has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClassInfoCollector._createStructForClass (cyclomatic 18) · ×1
  • ClassInfoCollector._createStructForClass (cyclomatic 18) pkg/dart2wasm/lib/class_info.dart:381 — ClassInfoCollector._createStructForClass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StateMachineCodeGenerator.visitSwitchStatement (cyclomatic 18) · ×1
  • StateMachineCodeGenerator.visitSwitchStatement (cyclomatic 18) pkg/dart2wasm/lib/state_machine.dart:970 — StateMachineCodeGenerator.visitSwitchStatement has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Expect.stringEquals (cyclomatic 18) · ×1
  • Expect.stringEquals (cyclomatic 18) pkg/expect/lib/expect.dart:490 — Expect.stringEquals has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClosedWorldClassHierarchy._buildDeclaredMembers (cyclomatic 18) · ×1
  • ClosedWorldClassHierarchy._buildDeclaredMembers (cyclomatic 18) pkg/kernel/lib/class_hierarchy.dart:1636 — ClosedWorldClassHierarchy._buildDeclaredMembers has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NaiveTypeChecker._checkFunctionOverride (cyclomatic 18) · ×1
  • NaiveTypeChecker._checkFunctionOverride (cyclomatic 18) pkg/kernel/lib/naive_type_checker.dart:163 — NaiveTypeChecker._checkFunctionOverride has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SnapshotGraph._readObjects (cyclomatic 18) · ×1
  • _SnapshotGraph._readObjects (cyclomatic 18) pkg/observatory/lib/object_graph.dart:969 — _SnapshotGraph._readObjects has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _Recorder.record (cyclomatic 18) · ×1
  • _Recorder.record (cyclomatic 18) pkg/perf_witness/lib/recorder.dart:117 — _Recorder.record has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Configuration.toString (cyclomatic 18) · ×1
  • Configuration.toString (cyclomatic 18) pkg/smith/lib/configuration.dart:646 — Configuration.toString has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Architecture._computeHost (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BoxedDouble.computeRemainder (cyclomatic 18) · ×1
  • BoxedDouble.computeRemainder (cyclomatic 18) sdk/lib/_internal/wasm/common/boxed_double.dart:92 — BoxedDouble.computeRemainder has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Arm64CodeGenerator.visitAllocateArray (cyclomatic 18) · ×1
  • Arm64CodeGenerator.visitAllocateArray (cyclomatic 18) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2167 — Arm64CodeGenerator.visitAllocateArray has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Arm64CodeGenerator.visitUnaryDoubleOp (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _Uri._normalizeZoneID (cyclomatic 18) · ×1
  • _Uri._normalizeZoneID (cyclomatic 18) sdk/lib/core/uri.dart:2468 — _Uri._normalizeZoneID has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CorrectionUtils._invertCondition0 (cyclomatic 18) · ×1
  • CorrectionUtils._invertCondition0 (cyclomatic 18) pkg/analysis_server_plugin/lib/edit/correction_utils.dart:346 — CorrectionUtils._invertCondition0 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _StructuredClone.walk (cyclomatic 18) · ×1
  • _StructuredClone.walk (cyclomatic 18) sdk/lib/html/html_common/conversions.dart:87 — _StructuredClone.walk has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeTypeCfe.NativeTypeCfe (cyclomatic 18) · ×1
  • NativeTypeCfe.NativeTypeCfe (cyclomatic 18) pkg/vm/lib/modular/transformations/ffi/native_type_cfe.dart:19 — NativeTypeCfe.NativeTypeCfe has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser._computePrecedence (cyclomatic 18) · ×1
  • Parser._computePrecedence (cyclomatic 18) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7743 — Parser._computePrecedence has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Utf8BytesScanner._decodeUtf8CodePoint (cyclomatic 18) · ×1
  • Utf8BytesScanner._decodeUtf8CodePoint (cyclomatic 18) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:398 — Utf8BytesScanner._decodeUtf8CodePoint has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IdValue.decode (cyclomatic 18) · ×1
  • IdValue.decode (cyclomatic 18) pkg/_fe_analyzer_shared/lib/src/testing/id.dart:129 — IdValue.decode has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Writer._typeAnnotationToText (cyclomatic 18) · ×1
  • Writer._typeAnnotationToText (cyclomatic 18) pkg/_fe_analyzer_shared/lib/src/testing/metadata_helper.dart:364 — Writer._typeAnnotationToText has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Writer._expressionToText (cyclomatic 37) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ParsedOptions.parse (cyclomatic 18) · ×1
  • ParsedOptions.parse (cyclomatic 18) pkg/_fe_analyzer_shared/lib/src/util/options.dart:39 — ParsedOptions.parse has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartUnitSignatureComputer.compute (cyclomatic 18) · ×1
  • DartUnitSignatureComputer.compute (cyclomatic 18) pkg/analysis_server/lib/src/computer/computer_signature.dart:27 — DartUnitSignatureComputer.compute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeActionComputer._computeActions (cyclomatic 18) · ×1
  • CodeActionComputer._computeActions (cyclomatic 18) pkg/analysis_server/lib/src/lsp/handlers/code_actions/code_action_computer.dart:210 — CodeActionComputer._computeActions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractNotificationManager.setSubscriptions (cyclomatic 18) · ×1
  • AbstractNotificationManager.setSubscriptions (cyclomatic 18) pkg/analysis_server/lib/src/plugin/notification_manager.dart:302 — AbstractNotificationManager.setSubscriptions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addExtensionMembers (cyclomatic 18) · ×1
  • DeclarationHelper._addExtensionMembers (cyclomatic 18) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:858 — DeclarationHelper._addExtensionMembers has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addExternalTopLevelDeclarations (cyclomatic 18) · ×1
  • DeclarationHelper._addExternalTopLevelDeclarations (cyclomatic 18) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:935 — DeclarationHelper._addExternalTopLevelDeclarations has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._suggestStaticField (cyclomatic 18) · ×1
  • DeclarationHelper._suggestStaticField (cyclomatic 18) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2734 — DeclarationHelper._suggestStaticField has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementCompletionProcessor._complete_forStatement (cyclomatic 18) · ×1
  • StatementCompletionProcessor._complete_forStatement (cyclomatic 18) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:626 — StatementCompletionProcessor._complete_forStatement has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddMissingClosureParameters._addToExistingClosure (cyclomatic 18) · ×1
  • AddMissingClosureParameters._addToExistingClosure (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/add_closure.dart:175 — AddMissingClosureParameters._addToExistingClosure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddDiagnosticPropertyReference._getPropertyInfo (cyclomatic 18) · ×1
  • AddDiagnosticPropertyReference._getPropertyInfo (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:345 — AddDiagnosticPropertyReference._getPropertyInfo has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConvertToBooleanExpression.compute (cyclomatic 18) · ×1
  • ConvertToBooleanExpression.compute (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/convert_to_boolean_expression.dart:28 — ConvertToBooleanExpression.compute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody (cyclomatic 18) · ×1
  • ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:101 — ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateEnumConstant.compute (cyclomatic 18) · ×1
  • CreateEnumConstant.compute (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/create_enum_constant.dart:33 — CreateEnumConstant.compute has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MakeFieldPublic.compute (cyclomatic 18) · ×1
  • MakeFieldPublic.compute (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart:33 — MakeFieldPublic.compute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RemoveUnexpectedUnderscores.compute (cyclomatic 18) · ×1
  • RemoveUnexpectedUnderscores.compute (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/remove_unexpected_underscores.dart:26 — RemoveUnexpectedUnderscores.compute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimplifyDirectivePath.compute (cyclomatic 18) · ×1
  • SimplifyDirectivePath.compute (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/dart/simplify_directive_path.dart:26 — SimplifyDirectivePath.compute has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImportOrganizer._organizeDocImportsInBlockComment (cyclomatic 18) · ×1
  • ImportOrganizer._organizeDocImportsInBlockComment (cyclomatic 18) pkg/analysis_server/lib/src/services/correction/organize_imports.dart:344 — ImportOrganizer._organizeDocImportsInBlockComment has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ReferenceProcessor._process (cyclomatic 18) · ×1
  • _ReferenceProcessor._process (cyclomatic 18) pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart:980 — _ReferenceProcessor._process has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _IndexContributor.recordRelationOffset (cyclomatic 18) · ×1
  • _IndexContributor.recordRelationOffset (cyclomatic 18) pkg/analyzer/lib/src/dart/analysis/index.dart:556 — _IndexContributor.recordRelationOffset has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ExpressionImpl.correspondingParameter (cyclomatic 18) · ×1
  • ExpressionImpl.correspondingParameter (cyclomatic 18) pkg/analyzer/lib/src/dart/ast/ast.dart:19381 — ExpressionImpl.correspondingParameter has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _AnnotationV1Children._tokenElement (cyclomatic 18) · ×1
  • _AnnotationV1Children._tokenElement (cyclomatic 18) pkg/analyzer/lib/src/dart/ast/ast.dart:64492 — _AnnotationV1Children._tokenElement has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ConstantEvaluationEngine.computeConstantValue (cyclomatic 18) · ×1
  • ConstantEvaluationEngine.computeConstantValue (cyclomatic 18) pkg/analyzer/lib/src/dart/constant/evaluation.dart:82 — ConstantEvaluationEngine.computeConstantValue has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstructorTearOffResolver.resolve (cyclomatic 18) · ×1
  • ConstructorTearOffResolver.resolve (cyclomatic 18) pkg/analyzer/lib/src/dart/resolver/constructor_tear_off_resolver.dart:23 — ConstructorTearOffResolver.resolve has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer._reportNotEnoughPositionalArguments (cyclomatic 18) · ×1
  • TypeAnalyzer._reportNotEnoughPositionalArguments (cyclomatic 18) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5982 — TypeAnalyzer._reportNotEnoughPositionalArguments has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypedLiteralResolver._inferCollectionElementType (cyclomatic 18) · ×1
  • TypedLiteralResolver._inferCollectionElementType (cyclomatic 18) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:366 — TypedLiteralResolver._inferCollectionElementType has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstBuilder.buildInitializer (cyclomatic 18) · ×1
  • AstBuilder.buildInitializer (cyclomatic 18) pkg/analyzer/lib/src/fasta/ast_builder.dart:635 — AstBuilder.buildInitializer has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstBuilder.doDotExpression (cyclomatic 18) · ×1
  • AstBuilder.doDotExpression (cyclomatic 18) pkg/analyzer/lib/src/fasta/ast_builder.dart:853 — AstBuilder.doDotExpression has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FragmentBuilder.visitPrimaryConstructorDeclaration (cyclomatic 18) · ×1
  • FragmentBuilder.visitPrimaryConstructorDeclaration (cyclomatic 18) pkg/analyzer/lib/src/summary2/element_builder.dart:1952 — FragmentBuilder.visitPrimaryConstructorDeclaration has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Linker._buildExportScopes (cyclomatic 18) · ×1
  • Linker._buildExportScopes (cyclomatic 18) pkg/analyzer/lib/src/summary2/link.dart:161 — Linker._buildExportScopes has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · DartEditBuilderImpl.writeFormalParameters (cyclomatic 18) · ×1
  • DartEditBuilderImpl.writeFormalParameters (cyclomatic 18) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:405 — DartEditBuilderImpl.writeFormalParameters has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompletionTarget.forOffset (cyclomatic 18) · ×1
  • CompletionTarget.forOffset (cyclomatic 18) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:140 — CompletionTarget.forOffset has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _OpTypeAstVisitor._argumentListContext (cyclomatic 18) · ×1
  • _OpTypeAstVisitor._argumentListContext (cyclomatic 18) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1853 — _OpTypeAstVisitor._argumentListContext has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ElementInfoCollector.visitClass (cyclomatic 18) · ×1
  • ElementInfoCollector.visitClass (cyclomatic 18) pkg/compiler/lib/src/dump_info.dart:561 — ElementInfoCollector.visitClass has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DumpInfoAnnotator.visitClass (cyclomatic 18) · ×1
  • DumpInfoAnnotator.visitClass (cyclomatic 18) pkg/compiler/lib/src/dump_info.dart:1348 — DumpInfoAnnotator.visitClass has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ResolutionEnqueuerListener.registerUsedElement (cyclomatic 18) · ×1
  • ResolutionEnqueuerListener.registerUsedElement (cyclomatic 18) pkg/compiler/lib/src/js_backend/resolution_listener.dart:293 — ResolutionEnqueuerListener.registerUsedElement has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._buildParameterStub (cyclomatic 18) · ×1
  • KernelSsaGraphBuilder._buildParameterStub (cyclomatic 18) pkg/compiler/lib/src/ssa/builder.dart:1383 — KernelSsaGraphBuilder._buildParameterStub has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InlineData.cannotBeInlinedReductiveReason (cyclomatic 18) · ×1
  • InlineData.cannotBeInlinedReductiveReason (cyclomatic 18) pkg/compiler/lib/src/ssa/builder.dart:9044 — InlineData.cannotBeInlinedReductiveReason has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BuildCliSubcommand.run (cyclomatic 18) · ×1
  • BuildCliSubcommand.run (cyclomatic 18) pkg/dartdev/lib/src/commands/build.dart:204 — BuildCliSubcommand.run has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProgramCompiler.emitModule (cyclomatic 18) · ×1
  • ProgramCompiler.emitModule (cyclomatic 18) pkg/dev_compiler/lib/src/kernel/compiler.dart:651 — ProgramCompiler.emitModule has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProgramCompiler._emitClassDeclaration (cyclomatic 18) · ×1
  • ProgramCompiler._emitClassDeclaration (cyclomatic 18) pkg/dev_compiler/lib/src/kernel/compiler.dart:1170 — ProgramCompiler._emitClassDeclaration has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IncrementalCompiler._computeExpressionCompilationExtensionData (cyclomatic 18) · ×1
  • IncrementalCompiler._computeExpressionCompilationExtensionData (cyclomatic 18) pkg/front_end/lib/src/base/incremental_compiler.dart:2420 — IncrementalCompiler._computeExpressionCompilationExtensionData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.createFieldInitializer (cyclomatic 18) · ×1
  • BodyBuilderImpl.createFieldInitializer (cyclomatic 18) pkg/front_end/lib/src/kernel/body_builder.dart:2235 — BodyBuilderImpl.createFieldInitializer has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator.visitConstructorInvocation (cyclomatic 18) · ×1
  • ConstantEvaluator.visitConstructorInvocation (cyclomatic 18) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3536 — ConstantEvaluator.visitConstructorInvocation has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClassHierarchyNodeBuilder.build (cyclomatic 18) · ×1
  • ClassHierarchyNodeBuilder.build (cyclomatic 18) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:121 — ClassHierarchyNodeBuilder.build has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Covariance.== (cyclomatic 18) · ×1
  • Covariance.== (cyclomatic 18) pkg/front_end/lib/src/kernel/member_covariance.dart:366 — Covariance.== has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._checkConstant (cyclomatic 18) · ×1
  • _Visitor._checkConstant (cyclomatic 18) pkg/linter/lib/src/rules/prefer_contains.dart:73 — _Visitor._checkConstant has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitBinaryExpression (cyclomatic 18) · ×1
  • _Visitor.visitBinaryExpression (cyclomatic 18) pkg/linter/lib/src/rules/use_is_even_rather_than_modulo.dart:37 — _Visitor.visitBinaryExpression has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor._checkForConvertiblePositionalParams (cyclomatic 18) · ×1
  • _Visitor._checkForConvertiblePositionalParams (cyclomatic 18) pkg/linter/lib/src/rules/use_super_parameters.dart:157 — _Visitor._checkForConvertiblePositionalParams has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DebuggerInputElement._onKeyDown (cyclomatic 18) · ×1
  • DebuggerInputElement._onKeyDown (cyclomatic 18) pkg/observatory/lib/src/elements/debugger.dart:3258 — DebuggerInputElement._onKeyDown has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ScriptInsetElement._refreshSourceReport (cyclomatic 18) · ×1
  • ScriptInsetElement._refreshSourceReport (cyclomatic 18) pkg/observatory/lib/src/elements/script_inset.dart:227 — ScriptInsetElement._refreshSourceReport has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstanceRef.toJson (cyclomatic 18) · ×1
  • InstanceRef.toJson (cyclomatic 18) pkg/vm_service/lib/src/vm_service.dart:5211 — InstanceRef.toJson has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WidgetCreatorTracker._transformWidgetConstructors (cyclomatic 18) · ×1
  • WidgetCreatorTracker._transformWidgetConstructors (cyclomatic 18) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:779 — WidgetCreatorTracker._transformWidgetConstructors has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DirectInvocation._processField (cyclomatic 18) · ×1
  • _DirectInvocation._processField (cyclomatic 18) pkg/vm/lib/transformations/type_flow/analysis.dart:301 — _DirectInvocation._processField has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DirectInvocation._processFunction (cyclomatic 18) · ×1
  • _DirectInvocation._processFunction (cyclomatic 18) pkg/vm/lib/transformations/type_flow/analysis.dart:372 — _DirectInvocation._processFunction has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DispatchableInvocation.process (cyclomatic 18) · ×1
  • _DispatchableInvocation.process (cyclomatic 18) pkg/vm/lib/transformations/type_flow/analysis.dart:518 — _DispatchableInvocation.process has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Narrow.simplify (cyclomatic 18) · ×1
  • Narrow.simplify (cyclomatic 18) pkg/vm/lib/transformations/type_flow/summary.dart:149 — Narrow.simplify has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnaryOperation.simplify (cyclomatic 18) · ×1
  • UnaryOperation.simplify (cyclomatic 18) pkg/vm/lib/transformations/type_flow/summary.dart:908 — UnaryOperation.simplify has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableSelectorAssigner._memberIdsForClass (cyclomatic 18) · ×1
  • TableSelectorAssigner._memberIdsForClass (cyclomatic 18) pkg/vm/lib/transformations/type_flow/table_selector_assigner.dart:45 — TableSelectorAssigner._memberIdsForClass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnotateKernel._annotateMember (cyclomatic 18) · ×1
  • AnnotateKernel._annotateMember (cyclomatic 18) pkg/vm/lib/transformations/type_flow/transformer.dart:876 — AnnotateKernel._annotateMember has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryLoader.load (cyclomatic 18) · ×1
  • LibraryLoader.load (cyclomatic 18) REDACTED:214 — LibraryLoader.load has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · D3SymbolTreeMap.D3SymbolTreeMap._handleInodes (cyclomatic 18) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._handleInodes (cyclomatic 18) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:382 — D3SymbolTreeMap.D3SymbolTreeMap._handleInodes has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 429, 464, 533, …). 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.
D1 · Cyclomatic Complexity · RemoveLastFormalParameterMutation._deletionForLast (cyclomatic 17) · ×1
  • RemoveLastFormalParameterMutation._deletionForLast (cyclomatic 17) pkg/analyzer/tool/fine/ab_mutate/mutations/impl/remove_last_formal_parameter.dart:46 — RemoveLastFormalParameterMutation._deletionForLast has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstNodeImplGenerator._generateFields (cyclomatic 17) · ×1
  • AstNodeImplGenerator._generateFields (cyclomatic 17) pkg/analyzer/tool/generators/ast_generator.dart:777 — AstNodeImplGenerator._generateFields has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SelectorInfo._computeSignature (cyclomatic 17) · ×1
  • SelectorInfo._computeSignature (cyclomatic 17) pkg/dart2wasm/lib/dispatch_table.dart:111 — SelectorInfo._computeSignature has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Intrinsifier.generateStaticGetterIntrinsic (cyclomatic 17) · ×1
  • Intrinsifier.generateStaticGetterIntrinsic (cyclomatic 17) pkg/dart2wasm/lib/intrinsics.dart:1189 — Intrinsifier.generateStaticGetterIntrinsic has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Translator.getClosure (cyclomatic 17) · ×1
  • Translator.getClosure (cyclomatic 17) pkg/dart2wasm/lib/translator.dart:1361 — Translator.getClosure has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Translator.toMostSpecificInterfaceType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · AstCompilationTask.run (cyclomatic 17) · ×1
  • AstCompilationTask.run (cyclomatic 17) pkg/dart2wasm/lib/translator.dart:2842 — AstCompilationTask.run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Translator.toMostSpecificInterfaceType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal (cyclomatic 17) · ×1
  • ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal (cyclomatic 17) pkg/kernel/lib/class_hierarchy.dart:961 — ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeCheckingVisitor.getReceiverType (cyclomatic 17) · ×1
  • TypeCheckingVisitor.getReceiverType (cyclomatic 17) pkg/kernel/lib/type_checker.dart:319 — TypeCheckingVisitor.getReceiverType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HttpOutgoing.writeHeaders (cyclomatic 17) · ×1
  • _HttpOutgoing.writeHeaders (cyclomatic 17) sdk/lib/_http/http_impl.dart:1833 — _HttpOutgoing.writeHeaders has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Primitives.applyFunction (cyclomatic 17) · ×1
  • Primitives.applyFunction (cyclomatic 17) sdk/lib/_internal/js_runtime/lib/js_helper.dart:980 — Primitives.applyFunction has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser._parseStringInternal (cyclomatic 17) · ×1
  • _ChunkedJsonParser._parseStringInternal (cyclomatic 17) sdk/lib/_internal/wasm/common/convert_patch.dart:1155 — _ChunkedJsonParser._parseStringInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parseStringToBuffer (cyclomatic 17) · ×1
  • _ChunkedJsonParser.parseStringToBuffer (cyclomatic 17) sdk/lib/_internal/wasm/common/convert_patch.dart:1291 — _ChunkedJsonParser.parseStringToBuffer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · int._parseRadix (cyclomatic 17) · ×1
  • int._parseRadix (cyclomatic 17) sdk/lib/_internal/wasm/common/int_patch.dart:112 — int._parseRadix has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LinearScanRegisterAllocator.allocate (cyclomatic 17) · ×1
  • LinearScanRegisterAllocator.allocate (cyclomatic 17) pkg/native_compiler/lib/back_end/register_allocator.dart:518 — LinearScanRegisterAllocator.allocate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Base64Decoder.decodeChunk (cyclomatic 17) · ×1
  • _Base64Decoder.decodeChunk (cyclomatic 17) sdk/lib/convert/base64.dart:693 — _Base64Decoder.decodeChunk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HtmlEscape._convert (cyclomatic 17) · ×1
  • HtmlEscape._convert (cyclomatic 17) sdk/lib/convert/html_escape.dart:241 — HtmlEscape._convert has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AstToIr._translateConditionForValue (cyclomatic 17) · ×1
  • AstToIr._translateConditionForValue (cyclomatic 17) pkg/cfg/lib/front_end/ast_to_ir.dart:2124 — AstToIr._translateConditionForValue has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _NetworkProfiling._serviceExtensionHandler (cyclomatic 17) · ×1
  • _NetworkProfiling._serviceExtensionHandler (cyclomatic 17) sdk/lib/io/network_profiling.dart:132 — _NetworkProfiling._serviceExtensionHandler has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Lowering.visitComparison (cyclomatic 17) · ×1
  • Lowering.visitComparison (cyclomatic 17) pkg/native_compiler/lib/passes/lowering.dart:95 — Lowering.visitComparison has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FlowAnalysisImpl._getNonPromotionReasons (cyclomatic 17) · ×1
  • _FlowAnalysisImpl._getNonPromotionReasons (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:8852 — _FlowAnalysisImpl._getNonPromotionReasons has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RecordFieldDeclarationIdentifierContext.ensureIdentifier (cyclomatic 17) · ×1
  • RecordFieldDeclarationIdentifierContext.ensureIdentifier (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:623 — RecordFieldDeclarationIdentifierContext.ensureIdentifier has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Parser.parseEnum (cyclomatic 17) · ×1
  • Parser.parseEnum (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:2605 — Parser.parseEnum has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Parser.parseInitializer (cyclomatic 17) · ×1
  • Parser.parseInitializer (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4817 — Parser.parseInitializer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Parser.parseFunctionBody (cyclomatic 17) · ×1
  • Parser.parseFunctionBody (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6539 — Parser.parseFunctionBody has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Parser.parseNewExpression (cyclomatic 17) · ×1
  • Parser.parseNewExpression (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8923 — Parser.parseNewExpression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Parser.parseParenthesizedPatternOrRecordPattern (cyclomatic 17) · ×1
  • Parser.parseParenthesizedPatternOrRecordPattern (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:12181 — Parser.parseParenthesizedPatternOrRecordPattern has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ComplexTypeParamOrArgInfo.parseVariables (cyclomatic 17) · ×1
  • ComplexTypeParamOrArgInfo.parseVariables (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1481 — ComplexTypeParamOrArgInfo.parseVariables has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Features.getText (cyclomatic 17) · ×1
  • Features.getText (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:80 — Features.getText has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer._finishJoinedPatternVariables (cyclomatic 17) · ×1
  • TypeAnalyzer._finishJoinedPatternVariables (cyclomatic 17) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:3220 — TypeAnalyzer._finishJoinedPatternVariables has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaticInteropMockValidator.validateCreateStaticInteropMock (cyclomatic 17) · ×1
  • StaticInteropMockValidator.validateCreateStaticInteropMock (cyclomatic 17) pkg/_js_interop_checks/lib/src/transformations/static_interop_mock_validator.dart:100 — StaticInteropMockValidator.validateCreateStaticInteropMock has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisServer.reportAnalysisAnalytics (cyclomatic 17) · ×1
  • AnalysisServer.reportAnalysisAnalytics (cyclomatic 17) pkg/analysis_server/lib/src/analysis_server.dart:1222 — AnalysisServer.reportAnalysisAnalytics has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckNameResponse.computeRenameRanges2 (cyclomatic 17) · ×1
  • CheckNameResponse.computeRenameRanges2 (cyclomatic 17) pkg/analysis_server/lib/src/cider/rename.dart:125 — CheckNameResponse.computeRenameRanges2 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EditableArgumentsMixin.getInvocationInfo (cyclomatic 17) · ×1
  • EditableArgumentsMixin.getInvocationInfo (cyclomatic 17) pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/editable_arguments_mixin.dart:71 — EditableArgumentsMixin.getInvocationInfo has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Driver.start (cyclomatic 17) · ×1
  • Driver.start (cyclomatic 17) pkg/analysis_server/lib/src/server/driver.dart:189 — Driver.start has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DeclarationHelper._addInstanceMembers (cyclomatic 17) · ×1
  • DeclarationHelper._addInstanceMembers (cyclomatic 17) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1207 — DeclarationHelper._addInstanceMembers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._addTopLevelDeclarations (cyclomatic 17) · ×1
  • DeclarationHelper._addTopLevelDeclarations (cyclomatic 17) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1715 — DeclarationHelper._addTopLevelDeclarations has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitIfStatement (cyclomatic 17) · ×1
  • InScopeCompletionPass.visitIfStatement (cyclomatic 17) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1815 — InScopeCompletionPass.visitIfStatement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementCompletionProcessor._complete_doStatement (cyclomatic 17) · ×1
  • StatementCompletionProcessor._complete_doStatement (cyclomatic 17) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:462 — StatementCompletionProcessor._complete_doStatement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences (cyclomatic 17) · ×1
  • AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences (cyclomatic 17) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:209 — AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertClassToMixin.compute (cyclomatic 17) · ×1
  • ConvertClassToMixin.compute (cyclomatic 17) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart:26 — ConvertClassToMixin.compute has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EncapsulateField._updateReferencesInConstructor (cyclomatic 17) · ×1
  • EncapsulateField._updateReferencesInConstructor (cyclomatic 17) pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart:299 — EncapsulateField._updateReferencesInConstructor has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemberSorter._sortUnitMembers (cyclomatic 17) · ×1
  • MemberSorter._sortUnitMembers (cyclomatic 17) pkg/analysis_server/lib/src/services/correction/sort_members.dart:170 — MemberSorter._sortUnitMembers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _PreviewVisitor.visitAnnotation (cyclomatic 17) · ×1
  • _PreviewVisitor.visitAnnotation (cyclomatic 17) pkg/analysis_server/lib/src/services/flutter/widget_previews.dart:271 — _PreviewVisitor.visitAnnotation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RenameRefactoring.create (cyclomatic 17) · ×1
  • RenameRefactoring.create (cyclomatic 17) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart:467 — RenameRefactoring.create has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _FindLibraryDeclarations._addDeclaration (cyclomatic 17) · ×1
  • _FindLibraryDeclarations._addDeclaration (cyclomatic 17) pkg/analyzer/lib/src/dart/analysis/search.dart:1539 — _FindLibraryDeclarations._addDeclaration has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConstantVerifier._checkForConstWithTypeParameters (cyclomatic 17) · ×1
  • ConstantVerifier._checkForConstWithTypeParameters (cyclomatic 17) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:613 — ConstantVerifier._checkForConstWithTypeParameters has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall (cyclomatic 17) · ×1
  • _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall (cyclomatic 17) pkg/analyzer/lib/src/dart/constant/evaluation.dart:2921 — _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementDirectiveImpl.areIdenticalExceptUri (cyclomatic 17) · ×1
  • ElementDirectiveImpl.areIdenticalExceptUri (cyclomatic 17) pkg/analyzer/lib/src/dart/element/element.dart:2116 — ElementDirectiveImpl.areIdenticalExceptUri has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject (cyclomatic 17) · ×1
  • InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject (cyclomatic 17) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:199 — InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LeastUpperBoundHelper._futureOr (cyclomatic 17) · ×1
  • LeastUpperBoundHelper._futureOr (cyclomatic 17) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:796 — LeastUpperBoundHelper._futureOr has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReplacementVisitor.visitFunctionType (cyclomatic 17) · ×1
  • ReplacementVisitor.visitFunctionType (cyclomatic 17) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:164 — ReplacementVisitor.visitFunctionType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnknownInferredType.isUnknown (cyclomatic 17) · ×1
  • UnknownInferredType.isUnknown (cyclomatic 17) pkg/analyzer/lib/src/dart/element/type_schema.dart:84 — UnknownInferredType.isUnknown has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeSystemImpl.isAlwaysExhaustive (cyclomatic 17) · ×1
  • TypeSystemImpl.isAlwaysExhaustive (cyclomatic 17) pkg/analyzer/lib/src/dart/element/type_system.dart:871 — TypeSystemImpl.isAlwaysExhaustive has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssignmentExpressionResolver.resolveReadWriteTarget (cyclomatic 17) · ×1
  • AssignmentExpressionResolver.resolveReadWriteTarget (cyclomatic 17) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:496 — AssignmentExpressionResolver.resolveReadWriteTarget has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AnnotationVerifier._checkAwaitNotRequired (cyclomatic 17) · ×1
  • AnnotationVerifier._checkAwaitNotRequired (cyclomatic 17) pkg/analyzer/lib/src/error/annotation_verifier.dart:73 — AnnotationVerifier._checkAwaitNotRequired has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnnotationVerifier._checkReopen (cyclomatic 17) · ×1
  • AnnotationVerifier._checkReopen (cyclomatic 17) pkg/analyzer/lib/src/error/annotation_verifier.dart:458 — AnnotationVerifier._checkReopen has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ElementUsageDetectorV2.checkUsage (cyclomatic 17) · ×1
  • ElementUsageDetectorV2.checkUsage (cyclomatic 17) pkg/analyzer/lib/src/error/element_usage_detector.dart:540 — ElementUsageDetectorV2.checkUsage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GatherUsedLocalElementsVisitor._useNamedReadResolution (cyclomatic 17) · ×1
  • GatherUsedLocalElementsVisitor._useNamedReadResolution (cyclomatic 17) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:513 — GatherUsedLocalElementsVisitor._useNamedReadResolution has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryManifestBuilder._fillInterfaceElementInterface (cyclomatic 17) · ×1
  • LibraryManifestBuilder._fillInterfaceElementInterface (cyclomatic 17) pkg/analyzer/lib/src/fine/library_manifest.dart:1326 — LibraryManifestBuilder._fillInterfaceElementInterface has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier.visitTopLevelVariablesDeclaration (cyclomatic 17) · ×1
  • ErrorVerifier.visitTopLevelVariablesDeclaration (cyclomatic 17) pkg/analyzer/lib/src/generated/error_verifier.dart:2428 — ErrorVerifier.visitTopLevelVariablesDeclaration has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorVerifier._validateConstructorBodyAllowed (cyclomatic 17) · ×1
  • ErrorVerifier._validateConstructorBodyAllowed (cyclomatic 17) pkg/analyzer/lib/src/generated/error_verifier.dart:8529 — ErrorVerifier._validateConstructorBodyAllowed has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FfiVerifier.visitCascadeMethodInvocation (cyclomatic 17) · ×1
  • FfiVerifier.visitCascadeMethodInvocation (cyclomatic 17) pkg/analyzer/lib/src/generated/ffi_verifier.dart:166 — FfiVerifier.visitCascadeMethodInvocation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstanceMemberInferrer._inferExecutable (cyclomatic 17) · ×1
  • InstanceMemberInferrer._inferExecutable (cyclomatic 17) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:410 — InstanceMemberInferrer._inferExecutable has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstanceMemberInferrer._setInducedModifier (cyclomatic 17) · ×1
  • InstanceMemberInferrer._setInducedModifier (cyclomatic 17) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:641 — InstanceMemberInferrer._setInducedModifier has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartEditBuilderImpl._getBaseNameFromUnwrappedExpression (cyclomatic 17) · ×1
  • DartEditBuilderImpl._getBaseNameFromUnwrappedExpression (cyclomatic 17) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1324 — DartEditBuilderImpl._getBaseNameFromUnwrappedExpression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective (cyclomatic 17) · ×1
  • DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective (cyclomatic 17) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3299 — DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSourceInformationBuilder._buildMemberBody (cyclomatic 17) · ×1
  • KernelSourceInformationBuilder._buildMemberBody (cyclomatic 17) pkg/compiler/lib/src/io/kernel_source_information.dart:261 — KernelSourceInformationBuilder._buildMemberBody has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CallPosition.getSemanticPositionForCall (cyclomatic 17) · ×1
  • CallPosition.getSemanticPositionForCall (cyclomatic 17) pkg/compiler/lib/src/io/position_information.dart:720 — CallPosition.getSemanticPositionForCall has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PositionTraceListener.onStep (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ConstantEmitter.visitMap (cyclomatic 17) · ×1
  • ConstantEmitter.visitMap (cyclomatic 17) pkg/compiler/lib/src/js_backend/constant_emitter.dart:319 — ConstantEmitter.visitMap has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JsKernelToElementMap.JsKernelToElementMap (cyclomatic 17) · ×1
  • JsKernelToElementMap.JsKernelToElementMap (cyclomatic 17) pkg/compiler/lib/src/js_model/element_map_impl.dart:117 — JsKernelToElementMap.JsKernelToElementMap has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._handleCreateInvocationMirror (cyclomatic 17) · ×1
  • KernelSsaGraphBuilder._handleCreateInvocationMirror (cyclomatic 17) pkg/compiler/lib/src/ssa/builder.dart:5579 — KernelSsaGraphBuilder._handleCreateInvocationMirror has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaCodeGenerator.generateExpressionAssignment (cyclomatic 17) · ×1
  • SsaCodeGenerator.generateExpressionAssignment (cyclomatic 17) pkg/compiler/lib/src/ssa/codegen.dart:698 — SsaCodeGenerator.generateExpressionAssignment has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSelection._computeBitWidth (cyclomatic 17) · ×1
  • SsaInstructionSelection._computeBitWidth (cyclomatic 17) pkg/compiler/lib/src/ssa/codegen_helpers.dart:284 — SsaInstructionSelection._computeBitWidth has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock (cyclomatic 17) · ×1
  • SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock (cyclomatic 17) pkg/compiler/lib/src/ssa/optimize.dart:3751 — SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaCodeMotion.visitBasicBlock (cyclomatic 17) · ×1
  • SsaCodeMotion.visitBasicBlock (cyclomatic 17) pkg/compiler/lib/src/ssa/optimize.dart:3984 — SsaCodeMotion.visitBasicBlock has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemberUsage.dataEquals (cyclomatic 17) · ×1
  • MemberUsage.dataEquals (cyclomatic 17) pkg/compiler/lib/src/universe/member_usage.dart:251 — MemberUsage.dataEquals has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · EvalPackageResolver.resolvePackageConfig (cyclomatic 17) · ×1
  • EvalPackageResolver.resolvePackageConfig (cyclomatic 17) pkg/dartdev/lib/src/eval_packages.dart:72 — EvalPackageResolver.resolvePackageConfig has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartDevelopmentServiceImpl._startDDSServer (cyclomatic 17) · ×1
  • DartDevelopmentServiceImpl._startDDSServer (cyclomatic 17) pkg/dds/lib/src/dds_impl.dart:168 — DartDevelopmentServiceImpl._startDDSServer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamManager.streamListen (cyclomatic 17) · ×1
  • StreamManager.streamListen (cyclomatic 17) pkg/dds/lib/src/stream_manager.dart:189 — StreamManager.streamListen has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler._is31BitUnsigned (cyclomatic 17) · ×1
  • ProgramCompiler._is31BitUnsigned (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:6280 — ProgramCompiler._is31BitUnsigned has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProgramCompiler._emitSuperTarget (cyclomatic 17) · ×1
  • ProgramCompiler._emitSuperTarget (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:6576 — ProgramCompiler._emitSuperTarget has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LibraryCompiler.emitLibrary (cyclomatic 17) · ×1
  • LibraryCompiler.emitLibrary (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:905 — LibraryCompiler.emitLibrary has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LibraryCompiler._is31BitUnsigned (cyclomatic 17) · ×1
  • LibraryCompiler._is31BitUnsigned (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6969 — LibraryCompiler._is31BitUnsigned has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitSuperTarget (cyclomatic 17) · ×1
  • LibraryCompiler._emitSuperTarget (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7265 — LibraryCompiler._emitSuperTarget has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ExpressionCompiler._findScopeAt (cyclomatic 17) · ×1
  • ExpressionCompiler._findScopeAt (cyclomatic 17) pkg/dev_compiler/lib/src/kernel/expression_compiler.dart:328 — ExpressionCompiler._findScopeAt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeLabeler.visitFunctionType (cyclomatic 17) · ×1
  • TypeLabeler.visitFunctionType (cyclomatic 17) pkg/front_end/lib/src/codes/type_labeler.dart:214 — TypeLabeler.visitFunctionType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FactoryEncoding._isCyclicRedirectingFactory (cyclomatic 17) · ×1
  • FactoryEncoding._isCyclicRedirectingFactory (cyclomatic 17) pkg/front_end/lib/src/fragment/factory/encoding.dart:802 — FactoryEncoding._isCyclicRedirectingFactory has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl._buildConstructorInvocation (cyclomatic 17) · ×1
  • BodyBuilderImpl._buildConstructorInvocation (cyclomatic 17) pkg/front_end/lib/src/kernel/body_builder.dart:10765 — BodyBuilderImpl._buildConstructorInvocation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForwardingNode._createNoSuchMethodForwarder (cyclomatic 17) · ×1
  • ForwardingNode._createNoSuchMethodForwarder (cyclomatic 17) pkg/front_end/lib/src/kernel/forwarding_node.dart:494 — ForwardingNode._createNoSuchMethodForwarder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal (cyclomatic 17) · ×1
  • ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal (cyclomatic 17) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart:150 — ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _DeclarationBuilderRegistry.registerBuilder (cyclomatic 17) · ×1
  • _DeclarationBuilderRegistry.registerBuilder (cyclomatic 17) pkg/front_end/lib/src/source/name_space_builder.dart:258 — _DeclarationBuilderRegistry.registerBuilder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceLoader.computeLibraryScopes (cyclomatic 17) · ×1
  • SourceLoader.computeLibraryScopes (cyclomatic 17) pkg/front_end/lib/src/source/source_loader.dart:1738 — SourceLoader.computeLibraryScopes has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · SuccessfulInferenceResult.applyResult (cyclomatic 17) · ×1
  • SuccessfulInferenceResult.applyResult (cyclomatic 17) pkg/front_end/lib/src/type_inference/inference_results.dart:245 — SuccessfulInferenceResult.applyResult has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitDotShorthandPropertyGet (cyclomatic 17) · ×1
  • InferenceVisitorImpl.visitDotShorthandPropertyGet (cyclomatic 17) pkg/front_end/lib/src/type_inference/inference_visitor.dart:14135 — InferenceVisitorImpl.visitDotShorthandPropertyGet has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MatchingExpressionVisitor.visitObjectPattern (cyclomatic 17) · ×1
  • MatchingExpressionVisitor.visitObjectPattern (cyclomatic 17) pkg/front_end/lib/src/type_inference/matching_expressions.dart:487 — MatchingExpressionVisitor.visitObjectPattern has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ExpressionList.ExpressionList (cyclomatic 17) · ×1
  • ExpressionList.ExpressionList (cyclomatic 17) pkg/kernel/lib/src/ast/expressions.dart:16 — ExpressionList.ExpressionList has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _Visitor.visitMethodDeclaration (cyclomatic 17) · ×1
  • _Visitor.visitMethodDeclaration (cyclomatic 17) pkg/linter/lib/src/rules/avoid_renaming_method_parameters.dart:54 — _Visitor.visitMethodDeclaration has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._processExpression (cyclomatic 17) · ×1
  • _Visitor._processExpression (cyclomatic 17) pkg/linter/lib/src/rules/switch_on_type.dart:68 — _Visitor._processExpression has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitLexeme (cyclomatic 17) · ×1
  • _Visitor.visitLexeme (cyclomatic 17) pkg/linter/lib/src/rules/unnecessary_string_escapes.dart:55 — _Visitor.visitLexeme has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor._findAssignedField (cyclomatic 17) · ×1
  • _Visitor._findAssignedField (cyclomatic 17) pkg/linter/lib/src/rules/use_declaring_parameters.dart:96 — _Visitor._findAssignedField has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitIfElement (cyclomatic 17) · ×1
  • _Visitor.visitIfElement (cyclomatic 17) pkg/linter/lib/src/rules/use_null_aware_elements.dart:42 — _Visitor.visitIfElement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DwarfStackTraceDecoder.bind (cyclomatic 17) · ×1
  • DwarfStackTraceDecoder.bind (cyclomatic 17) pkg/native_stack_traces/lib/src/convert.dart:544 — DwarfStackTraceDecoder.bind has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Isolate._update (cyclomatic 17) · ×1
  • Isolate._update (cyclomatic 17) pkg/observatory/lib/src/service/object.dart:1708 — Isolate._update has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ServiceObject._fromMap (cyclomatic 50) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Histogram.printCounts (cyclomatic 17) · ×1
  • Histogram.printCounts (cyclomatic 17) pkg/scrape/lib/src/histogram.dart:42 — Histogram.printCounts has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Module.printAsWat (cyclomatic 17) · ×1
  • Module.printAsWat (cyclomatic 17) pkg/wasm_builder/lib/src/ir/module.dart:371 — Module.printAsWat has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Printer.visitExtensionTypeDeclaration (cyclomatic 17) · ×1
  • Printer.visitExtensionTypeDeclaration (cyclomatic 17) pkg/kernel/lib/text/ast_to_text.dart:1576 — Printer.visitExtensionTypeDeclaration has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _DeduplicateMixinKey.== (cyclomatic 17) · ×1
  • _DeduplicateMixinKey.== (cyclomatic 17) pkg/vm/lib/transformations/mixin_deduplication.dart:117 — _DeduplicateMixinKey.== has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _SelectorApproximation.observeArgs (cyclomatic 17) · ×1
  • _SelectorApproximation.observeArgs (cyclomatic 17) pkg/vm/lib/transformations/type_flow/analysis.dart:1035 — _SelectorApproximation.observeArgs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _TFClassImpl._initDispatchTargets (cyclomatic 17) · ×1
  • _TFClassImpl._initDispatchTargets (cyclomatic 17) pkg/vm/lib/transformations/type_flow/analysis.dart:1503 — _TFClassImpl._initDispatchTargets has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SummaryCollector._makeNarrow (cyclomatic 17) · ×1
  • SummaryCollector._makeNarrow (cyclomatic 17) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1524 — SummaryCollector._makeNarrow has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassConcreteType.isSubtypeOfRuntimeType (cyclomatic 17) · ×1
  • ClassConcreteType.isSubtypeOfRuntimeType (cyclomatic 17) pkg/vm/lib/transformations/type_flow/types.dart:1392 — ClassConcreteType.isSubtypeOfRuntimeType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnboxingInfoManager._updateUnboxingInfoOfMember (cyclomatic 17) · ×1
  • UnboxingInfoManager._updateUnboxingInfoOfMember (cyclomatic 17) pkg/vm/lib/transformations/type_flow/unboxing_info.dart:136 — UnboxingInfoManager._updateUnboxingInfoOfMember has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · D3SymbolTreeMap.D3SymbolTreeMap._clone (cyclomatic 17) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._clone (cyclomatic 17) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:286 — D3SymbolTreeMap.D3SymbolTreeMap._clone has cyclomatic complexity 17 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · RelevanceDataCollector._argumentListContext (cyclomatic 16) · ×1
  • RelevanceDataCollector._argumentListContext (cyclomatic 16) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2172 — RelevanceDataCollector._argumentListContext has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ExpectedCompletionsVisitor.safelyRecordEntity (cyclomatic 16) · ×1
  • ExpectedCompletionsVisitor.safelyRecordEntity (cyclomatic 16) pkg/analysis_server/tool/code_completion/visitors.dart:182 — ExpectedCompletionsVisitor.safelyRecordEntity has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CodeGenerator.checkIdl (cyclomatic 16) · ×1
  • _CodeGenerator.checkIdl (cyclomatic 16) pkg/analyzer/tool/summary/generate.dart:527 — _CodeGenerator.checkIdl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CodeGenerator._addFieldForGetter (cyclomatic 16) · ×1
  • _CodeGenerator._addFieldForGetter (cyclomatic 16) pkg/analyzer/tool/summary/generate.dart:732 — _CodeGenerator._addFieldForGetter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BytecodeGenerator._genConstructorInitializers (cyclomatic 16) · ×1
  • BytecodeGenerator._genConstructorInitializers (cyclomatic 16) pkg/dart2bytecode/lib/bytecode_generator.dart:1281 — BytecodeGenerator._genConstructorInitializers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BytecodeGenerator._checkArguments (cyclomatic 16) · ×1
  • BytecodeGenerator._checkArguments (cyclomatic 16) pkg/dart2bytecode/lib/bytecode_generator.dart:2449 — BytecodeGenerator._checkArguments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BytecodeGenerator._genMethodInvocationUsingSpecializedBytecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BytecodeDisassembler._decodeOperands (cyclomatic 16) · ×1
  • BytecodeDisassembler._decodeOperands (cyclomatic 16) pkg/dart2bytecode/lib/disassembler.dart:88 — BytecodeDisassembler._decodeOperands has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DynamicForwarderCodeGenerator._generateDynamicMethodForwarder (cyclomatic 16) · ×1
  • DynamicForwarderCodeGenerator._generateDynamicMethodForwarder (cyclomatic 16) pkg/dart2wasm/lib/code_generator.dart:3925 — DynamicForwarderCodeGenerator._generateDynamicMethodForwarder has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Translator.convertType (cyclomatic 16) · ×1
  • Translator.convertType (cyclomatic 16) pkg/dart2wasm/lib/translator.dart:1598 — Translator.convertType has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Translator.toMostSpecificInterfaceType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase (cyclomatic 16) · ×1
  • _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase (cyclomatic 16) pkg/dart2wasm/lib/translator.dart:3364 — _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Translator.toMostSpecificInterfaceType (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage (cyclomatic 16) · ×1
  • _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage (cyclomatic 16) pkg/front_end/tool/coverage_merger.dart:1300 — _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NaiveTypeChecker.checkOverride (cyclomatic 16) · ×1
  • NaiveTypeChecker.checkOverride (cyclomatic 16) pkg/kernel/lib/naive_type_checker.dart:50 — NaiveTypeChecker.checkOverride has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _VerifyingVisitor.visitFunctionNode (cyclomatic 16) · ×1
  • _VerifyingVisitor.visitFunctionNode (cyclomatic 16) pkg/kernel/lib/verifier.dart:1061 — _VerifyingVisitor.visitFunctionNode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DartFuzz._emitMinimizedLiteralHelper (cyclomatic 16) · ×1
  • DartFuzz._emitMinimizedLiteralHelper (cyclomatic 16) runtime/tools/dartfuzz/dartfuzz.dart:802 — DartFuzz._emitMinimizedLiteralHelper has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DartFuzz.emitSingleStatement (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _HttpOutgoing.close (cyclomatic 16) · ×1
  • _HttpOutgoing.close (cyclomatic 16) sdk/lib/_http/http_impl.dart:1990 — _HttpOutgoing.close has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: _HttpResponse._findReasonPhrase (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _HttpParser._onDone (cyclomatic 16) · ×1
  • _HttpParser._onDone (cyclomatic 16) sdk/lib/_http/http_parser.dart:970 — _HttpParser._onDone has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _GrowableList.addAll (cyclomatic 16) · ×1
  • _GrowableList.addAll (cyclomatic 16) sdk/lib/_internal/vm/lib/growable_array.dart:296 — _GrowableList.addAll has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ChunkedJsonParser.parseStringEscape (cyclomatic 16) · ×1
  • _ChunkedJsonParser.parseStringEscape (cyclomatic 16) sdk/lib/_internal/wasm/common/convert_patch.dart:1377 — _ChunkedJsonParser.parseStringEscape has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WasmInstructionLowerer.visitBinaryIntOp (cyclomatic 16) · ×1
  • WasmInstructionLowerer.visitBinaryIntOp (cyclomatic 16) pkg/dart2wasm/lib/cfg/to_wasm.dart:400 — WasmInstructionLowerer.visitBinaryIntOp has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _SplayTree._splay (cyclomatic 16) · ×1
  • _SplayTree._splay (cyclomatic 16) sdk/lib/collection/splay_tree.dart:67 — _SplayTree._splay has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Uri._normalize (cyclomatic 16) · ×1
  • _Uri._normalize (cyclomatic 16) sdk/lib/core/uri.dart:2885 — _Uri._normalize has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Uri._uriDecode (cyclomatic 16) · ×1
  • _Uri._uriDecode (cyclomatic 16) sdk/lib/core/uri.dart:3619 — _Uri._uriDecode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DebugInfo.== (cyclomatic 16) · ×1
  • DebugInfo.== (cyclomatic 16) pkg/dwds/lib/data/debug_info.dart:83 — DebugInfo.== has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AstToIr._enterScope (cyclomatic 16) · ×1
  • AstToIr._enterScope (cyclomatic 16) pkg/cfg/lib/front_end/ast_to_ir.dart:959 — AstToIr._enterScope has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FfiDefinitionTransformer._checkFieldAnnotations (cyclomatic 16) · ×1
  • _FfiDefinitionTransformer._checkFieldAnnotations (cyclomatic 16) pkg/vm/lib/modular/transformations/ffi/definitions.dart:462 — _FfiDefinitionTransformer._checkFieldAnnotations has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Unboxing._convertInput (cyclomatic 16) · ×1
  • Unboxing._convertInput (cyclomatic 16) pkg/native_compiler/lib/passes/unboxing.dart:149 — Unboxing._convertInput has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ClassSerializationCluster.trace (cyclomatic 16) · ×1
  • ClassSerializationCluster.trace (cyclomatic 16) pkg/native_compiler/lib/snapshot/snapshot.dart:707 — ClassSerializationCluster.trace has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SnapshotSerializer._createPredefinedCluster (cyclomatic 41) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _Checker._unmatched (cyclomatic 16) · ×1
  • _Checker._unmatched (cyclomatic 16) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart:112 — _Checker._unmatched has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ListPatternShape.witnessToDart (cyclomatic 16) · ×1
  • ListPatternShape.witnessToDart (cyclomatic 16) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:158 — ListPatternShape.witnessToDart has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser._isConstructor (cyclomatic 16) · ×1
  • Parser._isConstructor (cyclomatic 16) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5729 — Parser._isConstructor has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Parser.missingParameterMessage (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Utf8BytesScanner.scanUntilLineEnd (cyclomatic 16) · ×1
  • Utf8BytesScanner.scanUntilLineEnd (cyclomatic 16) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:249 — Utf8BytesScanner.scanUntilLineEnd has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer.analyzeRecordPattern (cyclomatic 16) · ×1
  • TypeAnalyzer.analyzeRecordPattern (cyclomatic 16) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:2076 — TypeAnalyzer.analyzeRecordPattern has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DartUnitHighlightsComputer._addIdentifierRegion (cyclomatic 16) · ×1
  • DartUnitHighlightsComputer._addIdentifierRegion (cyclomatic 16) pkg/analysis_server/lib/src/computer/computer_highlights.dart:108 — DartUnitHighlightsComputer._addIdentifierRegion has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImportElementsComputer._computeUpdate (cyclomatic 16) · ×1
  • ImportElementsComputer._computeUpdate (cyclomatic 16) pkg/analysis_server/lib/src/computer/import_elements_computer.dart:192 — ImportElementsComputer._computeUpdate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResultMerger.mergeOutline (cyclomatic 16) · ×1
  • ResultMerger.mergeOutline (cyclomatic 16) pkg/analysis_server/lib/src/plugin/result_merger.dart:392 — ResultMerger.mergeOutline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._canAccessInstanceMember (cyclomatic 16) · ×1
  • DeclarationHelper._canAccessInstanceMember (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1814 — DeclarationHelper._canAccessInstanceMember has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclarationHelper._suggestClass (cyclomatic 16) · ×1
  • DeclarationHelper._suggestClass (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2041 — DeclarationHelper._suggestClass has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitFieldDeclaration (cyclomatic 16) · ×1
  • InScopeCompletionPass.visitFieldDeclaration (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1383 — InScopeCompletionPass.visitFieldDeclaration has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass.visitPropertyAccess (cyclomatic 16) · ×1
  • InScopeCompletionPass.visitPropertyAccess (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2702 — InScopeCompletionPass.visitPropertyAccess has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InScopeCompletionPass._forPattern (cyclomatic 16) · ×1
  • InScopeCompletionPass._forPattern (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:4095 — InScopeCompletionPass._forPattern has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementCompletionProcessor._complete_controlFlowBlock (cyclomatic 16) · ×1
  • StatementCompletionProcessor._complete_controlFlowBlock (cyclomatic 16) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:411 — StatementCompletionProcessor._complete_controlFlowBlock has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BulkFixProcessor._computeFixes (cyclomatic 16) · ×1
  • BulkFixProcessor._computeFixes (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:436 — BulkFixProcessor._computeFixes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _AddInvocation.compute (cyclomatic 16) · ×1
  • _AddInvocation.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart:214 — _AddInvocation.compute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToContains.compute (cyclomatic 16) · ×1
  • ConvertToContains.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart:27 — ConvertToContains.compute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConvertToExpressionFunctionBody.compute (cyclomatic 16) · ×1
  • ConvertToExpressionFunctionBody.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart:32 — ConvertToExpressionFunctionBody.compute has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConvertToPrimaryConstructor.compute (cyclomatic 16) · ×1
  • ConvertToPrimaryConstructor.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_primary_constructor.dart:49 — ConvertToPrimaryConstructor.compute has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CreateClass.producers (cyclomatic 16) · ×1
  • CreateClass.producers (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:21 — CreateClass.producers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CreateConstructor._computeWithSuperParameters (cyclomatic 16) · ×1
  • _CreateConstructor._computeWithSuperParameters (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:187 — _CreateConstructor._computeWithSuperParameters has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateLocalVariable.compute (cyclomatic 16) · ×1
  • CreateLocalVariable.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/create_local_variable.dart:31 — CreateLocalVariable.compute has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · EncapsulateField.compute (cyclomatic 16) · ×1
  • EncapsulateField.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart:44 — EncapsulateField.compute has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _ReplacementEditBuilder.visitSimpleIdentifier (cyclomatic 16) · ×1
  • _ReplacementEditBuilder.visitSimpleIdentifier (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:331 — _ReplacementEditBuilder.visitSimpleIdentifier has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlutterParentAndChild.swapParentAndChild (cyclomatic 16) · ×1
  • FlutterParentAndChild.swapParentAndChild (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart:21 — FlutterParentAndChild.swapParentAndChild has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RenameToCamelCase.compute (cyclomatic 16) · ×1
  • RenameToCamelCase.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart:35 — RenameToCamelCase.compute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReplaceIfElseWithConditional.compute (cyclomatic 16) · ×1
  • ReplaceIfElseWithConditional.compute (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart:25 — ReplaceIfElseWithConditional.compute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReplacedBy._instanceInvocation (cyclomatic 16) · ×1
  • ReplacedBy._instanceInvocation (cyclomatic 16) pkg/analysis_server/lib/src/services/correction/fix/data_driven/replaced_by.dart:155 — ReplacedBy._instanceInvocation has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PropertyDescription._changeCode (cyclomatic 16) · ×1
  • PropertyDescription._changeCode (cyclomatic 16) pkg/analysis_server/lib/src/services/flutter/property.dart:177 — PropertyDescription._changeCode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ReferenceProcessor._inlineMethodInvocation (cyclomatic 16) · ×1
  • _ReferenceProcessor._inlineMethodInvocation (cyclomatic 16) pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart:793 — _ReferenceProcessor._inlineMethodInvocation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PluginServer._getResponse (cyclomatic 16) · ×1
  • PluginServer._getResponse (cyclomatic 16) pkg/analysis_server_plugin/lib/src/plugin_server.dart:737 — PluginServer._getResponse has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _ParsedPluginsData.parse (cyclomatic 16) · ×1
  • _ParsedPluginsData.parse (cyclomatic 16) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1510 — _ParsedPluginsData.parse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisDriver.performWork (cyclomatic 16) · ×1
  • AnalysisDriver.performWork (cyclomatic 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:1205 — AnalysisDriver.performWork has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnalysisDriver._analyzeFileImpl (cyclomatic 16) · ×1
  • AnalysisDriver._analyzeFileImpl (cyclomatic 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:1364 — AnalysisDriver._analyzeFileImpl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnalysisDriver._produceErrors (cyclomatic 16) · ×1
  • AnalysisDriver._produceErrors (cyclomatic 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:2153 — AnalysisDriver._produceErrors has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryAnalyzer._resolvePartDirective (cyclomatic 16) · ×1
  • LibraryAnalyzer._resolvePartDirective (cyclomatic 16) pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart:1015 — LibraryAnalyzer._resolvePartDirective has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _FindDeclarations.compute (cyclomatic 16) · ×1
  • _FindDeclarations.compute (cyclomatic 16) pkg/analyzer/lib/src/dart/analysis/search.dart:1408 — _FindDeclarations.compute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpressionImpl.computeConstantValue (cyclomatic 16) · ×1
  • ExpressionImpl.computeConstantValue (cyclomatic 16) pkg/analyzer/lib/src/dart/ast/ast.dart:19459 — ExpressionImpl.computeConstantValue has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StringLexemeHelper.StringLexemeHelper (cyclomatic 16) · ×1
  • StringLexemeHelper.StringLexemeHelper (cyclomatic 16) pkg/analyzer/lib/src/dart/ast/ast.dart:55713 — StringLexemeHelper.StringLexemeHelper has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: V1Projection._materializeEnclosingTree (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ToSourceVisitor._visitParsedExpression (cyclomatic 16) · ×1
  • ToSourceVisitor._visitParsedExpression (cyclomatic 16) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1928 — ToSourceVisitor._visitParsedExpression has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _Collector._typedLiteral (cyclomatic 16) · ×1
  • _Collector._typedLiteral (cyclomatic 16) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:391 — _Collector._typedLiteral has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryFragmentImpl.shouldIgnoreUndefined (cyclomatic 16) · ×1
  • LibraryFragmentImpl.shouldIgnoreUndefined (cyclomatic 16) pkg/analyzer/lib/src/dart/element/element.dart:8311 — LibraryFragmentImpl.shouldIgnoreUndefined has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NormalizeHelper._normalize (cyclomatic 16) · ×1
  • NormalizeHelper._normalize (cyclomatic 16) pkg/analyzer/lib/src/dart/element/normalize.dart:106 — NormalizeHelper._normalize has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TopMergeHelper._functionTypes (cyclomatic 16) · ×1
  • TopMergeHelper._functionTypes (cyclomatic 16) pkg/analyzer/lib/src/dart/element/top_merge.dart:133 — TopMergeHelper._functionTypes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlowAnalysisHelper.getLabelTarget (cyclomatic 16) · ×1
  • FlowAnalysisHelper.getLabelTarget (cyclomatic 16) pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:480 — FlowAnalysisHelper.getLabelTarget has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallInvocationResolver.resolve (cyclomatic 16) · ×1
  • CallInvocationResolver.resolve (cyclomatic 16) pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart:42 — CallInvocationResolver.resolve has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeAnalyzer._resolveParsedDotShorthandInvocation (cyclomatic 16) · ×1
  • TypeAnalyzer._resolveParsedDotShorthandInvocation (cyclomatic 16) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5464 — TypeAnalyzer._resolveParsedDotShorthandInvocation has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AnnotationVerifier._checkInternal (cyclomatic 16) · ×1
  • AnnotationVerifier._checkInternal (cyclomatic 16) pkg/analyzer/lib/src/error/annotation_verifier.dart:326 — AnnotationVerifier._checkInternal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnotationVerifier._findUndefinedUseResultParameter (cyclomatic 16) · ×1
  • AnnotationVerifier._findUndefinedUseResultParameter (cyclomatic 16) pkg/analyzer/lib/src/error/annotation_verifier.dart:688 — AnnotationVerifier._findUndefinedUseResultParameter has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NullSafetyDeadCodeVerifier._verifyUnassignedVariable (cyclomatic 16) · ×1
  • NullSafetyDeadCodeVerifier._verifyUnassignedVariable (cyclomatic 16) pkg/analyzer/lib/src/error/dead_code_verifier.dart:457 — NullSafetyDeadCodeVerifier._verifyUnassignedVariable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores (cyclomatic 16) · ×1
  • IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores (cyclomatic 16) pkg/analyzer/lib/src/error/ignore_validator.dart:198 — IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ClassVerifier._reportConcreteClassWithAbstractMember (cyclomatic 16) · ×1
  • _ClassVerifier._reportConcreteClassWithAbstractMember (cyclomatic 16) pkg/analyzer/lib/src/error/inheritance_override.dart:907 — _ClassVerifier._reportConcreteClassWithAbstractMember has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper (cyclomatic 16) · ×1
  • MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper (cyclomatic 16) pkg/analyzer/lib/src/error/must_call_super_verifier.dart:77 — MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _CharacterSequenceFromMultiLineComment.next (cyclomatic 16) · ×1
  • _CharacterSequenceFromMultiLineComment.next (cyclomatic 16) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:968 — _CharacterSequenceFromMultiLineComment.next has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: DocCommentBuilder._parseDocDirectiveTag (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ErrorVerifier.visitFieldsDeclaration (cyclomatic 16) · ×1
  • ErrorVerifier.visitFieldsDeclaration (cyclomatic 16) pkg/analyzer/lib/src/generated/error_verifier.dart:1237 — ErrorVerifier.visitFieldsDeclaration has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ErrorVerifier._checkForInvalidInstanceMemberAccess2 (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForNotInitializedFieldDeclaration (cyclomatic 16) · ×1
  • ErrorVerifier._checkForNotInitializedFieldDeclaration (cyclomatic 16) pkg/analyzer/lib/src/generated/error_verifier.dart:7029 — ErrorVerifier._checkForNotInitializedFieldDeclaration has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ErrorVerifier._checkForInvalidInstanceMemberAccess2 (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ErrorVerifier._checkForUnnecessaryNullAware (cyclomatic 16) · ×1
  • ErrorVerifier._checkForUnnecessaryNullAware (cyclomatic 16) pkg/analyzer/lib/src/generated/error_verifier.dart:7669 — ErrorVerifier._checkForUnnecessaryNullAware has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ErrorVerifier._checkForInvalidInstanceMemberAccess2 (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FfiVerifier._validateFfiMethodInvocation (cyclomatic 16) · ×1
  • FfiVerifier._validateFfiMethodInvocation (cyclomatic 16) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1694 — FfiVerifier._validateFfiMethodInvocation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IgnoreInfo.isIgnoreComment (cyclomatic 16) · ×1
  • IgnoreInfo.isIgnoreComment (cyclomatic 16) pkg/analyzer/lib/src/ignore_comments/ignore_info.dart:212 — IgnoreInfo.isIgnoreComment has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AstBinaryFlags.encode (cyclomatic 16) · ×1
  • AstBinaryFlags.encode (cyclomatic 16) pkg/analyzer/lib/src/summary2/ast_binary_flags.dart:65 — AstBinaryFlags.encode has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DefaultTypesBuilder._findRawTypePathsToDeclaration (cyclomatic 16) · ×1
  • DefaultTypesBuilder._findRawTypePathsToDeclaration (cyclomatic 16) pkg/analyzer/lib/src/summary2/default_types_builder.dart:203 — DefaultTypesBuilder._findRawTypePathsToDeclaration has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElementBuilder._buildTopFragments (cyclomatic 16) · ×1
  • ElementBuilder._buildTopFragments (cyclomatic 16) pkg/analyzer/lib/src/summary2/element_builder.dart:172 — ElementBuilder._buildTopFragments has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CommandLineOptions._parse (cyclomatic 16) · ×1
  • CommandLineOptions._parse (cyclomatic 16) pkg/analyzer_cli/lib/src/options.dart:350 — CommandLineOptions._parse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompletionTarget._computeDroppedToken (cyclomatic 16) · ×1
  • CompletionTarget._computeDroppedToken (cyclomatic 16) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:640 — CompletionTarget._computeDroppedToken has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DumpInfoTask.buildDumpInfoDataNew (cyclomatic 16) · ×1
  • DumpInfoTask.buildDumpInfoDataNew (cyclomatic 16) pkg/compiler/lib/src/dump_info.dart:1913 — DumpInfoTask.buildDumpInfoDataNew has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeSystem.joinTypeMasks (cyclomatic 16) · ×1
  • TypeSystem.joinTypeMasks (cyclomatic 16) pkg/compiler/lib/src/inferrer/type_system.dart:824 — TypeSystem.joinTypeMasks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlatTypeMask._intersection (cyclomatic 16) · ×1
  • FlatTypeMask._intersection (cyclomatic 16) pkg/compiler/lib/src/inferrer/typemasks/flat_type_mask.dart:567 — FlatTypeMask._intersection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeMask.getNotNormalizedReason (cyclomatic 16) · ×1
  • TypeMask.getNotNormalizedReason (cyclomatic 16) pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:526 — TypeMask.getNotNormalizedReason has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _RecipeGenerator.visitFunctionType (cyclomatic 16) · ×1
  • _RecipeGenerator.visitFunctionType (cyclomatic 16) pkg/compiler/lib/src/js_backend/runtime_types_new.dart:340 — _RecipeGenerator.visitFunctionType has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _RecipeToIdentifier.visitFunctionType (cyclomatic 16) · ×1
  • _RecipeToIdentifier.visitFunctionType (cyclomatic 16) pkg/compiler/lib/src/js_backend/type_reference.dart:712 — _RecipeToIdentifier.visitFunctionType has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FieldVisitor.visitFields (cyclomatic 16) · ×1
  • FieldVisitor.visitFields (cyclomatic 16) pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart:36 — FieldVisitor.visitFields has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KernelAnnotationProcessor.extractJsInteropAnnotations (cyclomatic 16) · ×1
  • KernelAnnotationProcessor.extractJsInteropAnnotations (cyclomatic 16) pkg/compiler/lib/src/kernel/native_basic_data.dart:75 — KernelAnnotationProcessor.extractJsInteropAnnotations has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder.visitStaticInvocation (cyclomatic 16) · ×1
  • KernelSsaGraphBuilder.visitStaticInvocation (cyclomatic 16) pkg/compiler/lib/src/ssa/builder.dart:5079 — KernelSsaGraphBuilder.visitStaticInvocation has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._handleInvokeFactoryConstructor (cyclomatic 16) · ×1
  • KernelSsaGraphBuilder._handleInvokeFactoryConstructor (cyclomatic 16) pkg/compiler/lib/src/ssa/builder.dart:5196 — KernelSsaGraphBuilder._handleInvokeFactoryConstructor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KernelSsaGraphBuilder._setupStateForInlining (cyclomatic 16) · ×1
  • KernelSsaGraphBuilder._setupStateForInlining (cyclomatic 16) pkg/compiler/lib/src/ssa/builder.dart:8333 — KernelSsaGraphBuilder._setupStateForInlining has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · InlineData.toString (cyclomatic 16) · ×1
  • InlineData.toString (cyclomatic 16) pkg/compiler/lib/src/ssa/builder.dart:9089 — InlineData.toString has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitInvokeDynamicMethod (cyclomatic 16) · ×1
  • SsaInstructionSimplifier.visitInvokeDynamicMethod (cyclomatic 16) pkg/compiler/lib/src/ssa/optimize.dart:1028 — SsaInstructionSimplifier.visitInvokeDynamicMethod has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitInvokeDynamicSetter (cyclomatic 16) · ×1
  • SsaInstructionSimplifier.visitInvokeDynamicSetter (cyclomatic 16) pkg/compiler/lib/src/ssa/optimize.dart:2132 — SsaInstructionSimplifier.visitInvokeDynamicSetter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitStringify (cyclomatic 16) · ×1
  • SsaInstructionSimplifier.visitStringify (cyclomatic 16) pkg/compiler/lib/src/ssa/optimize.dart:2403 — SsaInstructionSimplifier.visitStringify has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitBitOr (cyclomatic 16) · ×1
  • SsaInstructionSimplifier.visitBitOr (cyclomatic 16) pkg/compiler/lib/src/ssa/optimize.dart:2858 — SsaInstructionSimplifier.visitBitOr has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaInstructionSimplifier.visitArrayFlagsCheck (cyclomatic 16) · ×1
  • SsaInstructionSimplifier.visitArrayFlagsCheck (cyclomatic 16) pkg/compiler/lib/src/ssa/optimize.dart:3026 — SsaInstructionSimplifier.visitArrayFlagsCheck has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SsaValueRangeAnalyzer.visitBoundsCheck (cyclomatic 16) · ×1
  • SsaValueRangeAnalyzer.visitBoundsCheck (cyclomatic 16) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:908 — SsaValueRangeAnalyzer.visitBoundsCheck has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JsBuilder._irregularEscape (cyclomatic 16) · ×1
  • JsBuilder._irregularEscape (cyclomatic 16) pkg/dev_compiler/lib/src/js_ast/builder.dart:354 — JsBuilder._irregularEscape has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: MiniJsParser.categoryToString (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ProgramCompiler._directCastMethod (cyclomatic 16) · ×1
  • ProgramCompiler._directCastMethod (cyclomatic 16) pkg/dev_compiler/lib/src/kernel/compiler.dart:7824 — ProgramCompiler._directCastMethod has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._emitJSInteropClassNonExternalMembers (cyclomatic 16) · ×1
  • LibraryCompiler._emitJSInteropClassNonExternalMembers (cyclomatic 16) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1601 — LibraryCompiler._emitJSInteropClassNonExternalMembers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LibraryCompiler._directCastMethod (cyclomatic 16) · ×1
  • LibraryCompiler._directCastMethod (cyclomatic 16) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8692 — LibraryCompiler._directCastMethod has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppInspector._populateScriptCaches (cyclomatic 16) · ×1
  • AppInspector._populateScriptCaches (cyclomatic 16) pkg/dwds/lib/src/debugging/inspector.dart:131 — AppInspector._populateScriptCaches has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DevHandler._handleMessage (cyclomatic 16) · ×1
  • DevHandler._handleMessage (cyclomatic 16) pkg/dwds/lib/src/handlers/dev_handler.dart:477 — DevHandler._handleMessage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: DevHandler._deserializeMessage (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ProcessedOptions.validateOptions (cyclomatic 16) · ×1
  • ProcessedOptions.validateOptions (cyclomatic 16) pkg/front_end/lib/src/base/processed_options.dart:395 — ProcessedOptions.validateOptions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FactoryEncoding.checkRedirectingFactory (cyclomatic 16) · ×1
  • FactoryEncoding.checkRedirectingFactory (cyclomatic 16) pkg/front_end/lib/src/fragment/factory/encoding.dart:565 — FactoryEncoding.checkRedirectingFactory has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FactoryEncoding._computeRedirecteeType (cyclomatic 16) · ×1
  • FactoryEncoding._computeRedirecteeType (cyclomatic 16) pkg/front_end/lib/src/fragment/factory/encoding.dart:682 — FactoryEncoding._computeRedirecteeType has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyBuilderImpl.pushQualifiedReference (cyclomatic 16) · ×1
  • BodyBuilderImpl.pushQualifiedReference (cyclomatic 16) pkg/front_end/lib/src/kernel/body_builder.dart:9784 — BodyBuilderImpl.pushQualifiedReference has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator.visitLogicalExpression (cyclomatic 16) · ×1
  • ConstantEvaluator.visitLogicalExpression (cyclomatic 16) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4613 — ConstantEvaluator.visitLogicalExpression has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantEvaluator._handleFromEnvironment (cyclomatic 16) · ×1
  • ConstantEvaluator._handleFromEnvironment (cyclomatic 16) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5109 — ConstantEvaluator._handleFromEnvironment has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DelayedAssignment.handleAssignment (cyclomatic 16) · ×1
  • DelayedAssignment.handleAssignment (cyclomatic 16) pkg/front_end/lib/src/kernel/expression_generator.dart:6074 — DelayedAssignment.handleAssignment has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Overrides.collectOverrides (cyclomatic 16) · ×1
  • _Overrides.collectOverrides (cyclomatic 16) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:2913 — _Overrides.collectOverrides has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceClassBuilder.build (cyclomatic 16) · ×1
  • SourceClassBuilder.build (cyclomatic 16) pkg/front_end/lib/src/source/source_class_builder.dart:479 — SourceClassBuilder.build has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceLibraryBuilder.addImportsToScope (cyclomatic 16) · ×1
  • SourceLibraryBuilder.addImportsToScope (cyclomatic 16) pkg/front_end/lib/src/source/source_library_builder.dart:628 — SourceLibraryBuilder.addImportsToScope has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceLibraryBuilder.checkPendingBoundsChecks (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SourceLibraryBuilder.checkTypesInOutline (cyclomatic 16) · ×1
  • SourceLibraryBuilder.checkTypesInOutline (cyclomatic 16) pkg/front_end/lib/src/source/source_library_builder.dart:1382 — SourceLibraryBuilder.checkTypesInOutline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SourceLibraryBuilder.checkPendingBoundsChecks (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SourceLoader.tokenize (cyclomatic 16) · ×1
  • SourceLoader.tokenize (cyclomatic 16) pkg/front_end/lib/src/source/source_loader.dart:1157 — SourceLoader.tokenize has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _AsyncContext._checkValidReturn (cyclomatic 16) · ×1
  • _AsyncContext._checkValidReturn (cyclomatic 16) pkg/front_end/lib/src/type_inference/body_inference_context.dart:534 — _AsyncContext._checkValidReturn has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InferenceVisitorImpl.visitAnonymousMethodBlock (cyclomatic 16) · ×1
  • InferenceVisitorImpl.visitAnonymousMethodBlock (cyclomatic 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:9415 — InferenceVisitorImpl.visitAnonymousMethodBlock has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InferenceVisitorImpl.visitRelationalPattern (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ReferenceName.fromNamedNode (cyclomatic 16) · ×1
  • ReferenceName.fromNamedNode (cyclomatic 16) pkg/kernel/lib/src/equivalence_helpers.dart:253 — ReferenceName.fromNamedNode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitCompilationUnit (cyclomatic 16) · ×1
  • _Visitor.visitCompilationUnit (cyclomatic 16) pkg/linter/lib/src/rules/dangling_library_doc_comments.dart:38 — _Visitor.visitCompilationUnit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitSwitchStatement (cyclomatic 16) · ×1
  • _Visitor.visitSwitchStatement (cyclomatic 16) pkg/linter/lib/src/rules/exhaustive_cases.dart:37 — _Visitor.visitSwitchStatement has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _Visitor.visitDeclaredVariablePattern (cyclomatic 16) · ×1
  • _Visitor.visitDeclaredVariablePattern (cyclomatic 16) pkg/linter/lib/src/rules/prefer_final_locals.dart:78 — _Visitor.visitDeclaredVariablePattern has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ConstructorChecker._checkInitializer (cyclomatic 16) · ×1
  • _ConstructorChecker._checkInitializer (cyclomatic 16) pkg/linter/lib/src/rules/prefer_initializing_formals.dart:142 — _ConstructorChecker._checkInitializer has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor._checkBody (cyclomatic 16) · ×1
  • _Visitor._checkBody (cyclomatic 16) pkg/linter/lib/src/rules/unnecessary_async.dart:130 — _Visitor._checkBody has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _Visitor._checkConstructor (cyclomatic 16) · ×1
  • _Visitor._checkConstructor (cyclomatic 16) pkg/linter/lib/src/rules/use_key_in_widget_constructors.dart:82 — _Visitor._checkConstructor has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Printer.writeFunction (cyclomatic 16) · ×1
  • Printer.writeFunction (cyclomatic 16) pkg/kernel/lib/text/ast_to_text.dart:825 — Printer.writeFunction has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WidgetCreatorTracker._getPragmaName (cyclomatic 16) · ×1
  • WidgetCreatorTracker._getPragmaName (cyclomatic 16) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:674 — WidgetCreatorTracker._getPragmaName has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeCodeOracle.handleNativeProcedure (cyclomatic 16) · ×1
  • NativeCodeOracle.handleNativeProcedure (cyclomatic 16) pkg/vm/lib/transformations/type_flow/native_code.dart:433 — NativeCodeOracle.handleNativeProcedure has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SummaryCollector.rawArguments (cyclomatic 16) · ×1
  • SummaryCollector.rawArguments (cyclomatic 16) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1086 — SummaryCollector.rawArguments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypesBuilder.fromStaticType (cyclomatic 16) · ×1
  • TypesBuilder.fromStaticType (cyclomatic 16) pkg/vm/lib/transformations/type_flow/types.dart:283 — TypesBuilder.fromStaticType has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SimpleUnreachableCodeElimination.visitSwitchStatement (cyclomatic 16) · ×1
  • SimpleUnreachableCodeElimination.visitSwitchStatement (cyclomatic 16) pkg/vm/lib/transformations/unreachable_code_elimination.dart:192 — SimpleUnreachableCodeElimination.visitSwitchStatement has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox (cyclomatic 16) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox (cyclomatic 16) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:774 — D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D17 · Explicit Debt · TodoComment repeated across 16 files · ×1
  • TodoComment repeated across 16 files tests/lib/mirrors/abstract_class_test.dart:5 — The identical TodoComment appears in 16 files (16 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 16 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(51557): Decide if the mixins being applied in this test should be". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 155 files · ×1
  • TodoComment repeated across 155 files tests/language/variable/bad_initializer1_runtime_test.dart:1 — The identical TodoComment appears in 155 files (155 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 155 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(multitest): This was automatically migrated from a multitest and may". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 19 files · ×1
  • TodoComment repeated across 19 files tests/language/patterns/exhaustiveness/bool_switch_test.dart:140 — The identical TodoComment appears in 19 files (19 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 19 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(johnniwinther): Should we avoid the unreachable error here?". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 12 files · ×1
  • TodoComment repeated across 12 files runtime/tests/vm/dart/generated/deeply_nested_list_literal_generator.dart:7 — The identical TodoComment appears in 12 files (12 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 12 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(https://github.com/dart-lang/sdk/issues/61310): n = 1 << 16". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 32 files · ×1
  • TodoComment repeated across 32 files pkg/linter/test/rules/annotate_redeclares_test.dart:45 — The identical TodoComment appears in 32 files (68 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 68 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(scheglov): implement augmentation". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · TodoComment repeated across 113 files · ×1
  • TodoComment repeated across 113 files pkg/analysis_server_plugin/lib/src/correction/ignore_diagnostic.dart:42 — The identical TodoComment appears in 113 files (119 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 119 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO(applicability): comment on why.". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D2 · Cognitive Complexity · AstWriter._computeProperties (cognitive 690) · ×1
  • AstWriter._computeProperties (cognitive 690) pkg/analysis_server/lib/src/status/utilities/ast_writer.dart:30 — AstWriter._computeProperties has cognitive complexity 690 (threshold 15). Drivers by points: if/else 75 (690 pts) (nesting depth added 615). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RequirementsManifest.isSatisfied (cognitive 333) · ×1
  • RequirementsManifest.isSatisfied (cognitive 333) pkg/analyzer/lib/src/fine/requirements.dart:1004 — RequirementsManifest.isSatisfied has cognitive complexity 333 (threshold 15). Drivers by points: if/else 87 (262 pts), loops 28 (71 pts) (nesting depth added 218). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Processor.calculate (cognitive 271) · ×1
  • _Processor.calculate (cognitive 271) pkg/front_end/lib/src/util/outline_extractor.dart:309 — _Processor.calculate has cognitive complexity 271 (threshold 15). Drivers by points: if/else 46 (191 pts), loops 19 (68 pts), boolean chains 12 (nesting depth added 194). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypeUseGenerator.buildSelectorAccess (cognitive 248) · ×1
  • TypeUseGenerator.buildSelectorAccess (cognitive 248) pkg/front_end/lib/src/kernel/expression_generator.dart:4693 — TypeUseGenerator.buildSelectorAccess has cognitive complexity 248 (threshold 15). Drivers by points: if/else 48 (157 pts), ternaries 8 (33 pts), loops 4 (31 pts), match/switch 4 (16 pts), boolean chains 11 (nesting depth added 173). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _HttpParser._doParse (cognitive 242) · ×1
  • _HttpParser._doParse (cognitive 242) sdk/lib/_http/http_parser.dart:486 — _HttpParser._doParse has cognitive complexity 242 (threshold 15). Drivers by points: if/else 90 (203 pts), boolean chains 27, loops 3 (10 pts), match/switch 1 (2 pts) (nesting depth added 121). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantsTransformer.visitPatternSwitchStatement (cognitive 200) · ×1
  • ConstantsTransformer.visitPatternSwitchStatement (cognitive 200) pkg/front_end/lib/src/kernel/constant_evaluator.dart:750 — ConstantsTransformer.visitPatternSwitchStatement has cognitive complexity 200 (threshold 15). Drivers by points: if/else 40 (108 pts), loops 26 (83 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 127). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartTypes._subtypeHelper (cognitive 196) · ×1
  • DartTypes._subtypeHelper (cognitive 196) pkg/compiler/lib/src/elements/types.dart:1949 — DartTypes._subtypeHelper has cognitive complexity 196 (threshold 15). Drivers by points: if/else 51 (140 pts), loops 9 (34 pts), boolean chains 15, match/switch 1 (4 pts), ternaries 1 (3 pts) (nesting depth added 119). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _BigIntImpl._binaryGcd (cognitive 180) · ×1
  • _BigIntImpl._binaryGcd (cognitive 180) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2112 — _BigIntImpl._binaryGcd has cognitive complexity 180 (threshold 15). Drivers by points: if/else 62 (142 pts), boolean chains 24, loops 8 (14 pts) (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BodyBuilderImpl.resolveAndBuildConstructorInvocation (cognitive 164) · ×1
  • BodyBuilderImpl.resolveAndBuildConstructorInvocation (cognitive 164) pkg/front_end/lib/src/kernel/body_builder.dart:9991 — BodyBuilderImpl.resolveAndBuildConstructorInvocation has cognitive complexity 164 (threshold 15). Drivers by points: if/else 44 (108 pts), ternaries 4 (18 pts), boolean chains 16, loops 2 (11 pts), match/switch 4 (11 pts) (nesting depth added 94). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartFileEditBuilderImpl._addLibraryImports (cognitive 160) · ×1
  • DartFileEditBuilderImpl._addLibraryImports (cognitive 160) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2533 — DartFileEditBuilderImpl._addLibraryImports has cognitive complexity 160 (threshold 15). Drivers by points: if/else 47 (111 pts), loops 12 (28 pts), boolean chains 12, ternaries 2 (9 pts) (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceClassBuilder.checkSupertypes (cognitive 153) · ×1
  • SourceClassBuilder.checkSupertypes (cognitive 153) pkg/front_end/lib/src/source/source_class_builder.dart:731 — SourceClassBuilder.checkSupertypes has cognitive complexity 153 (threshold 15). Drivers by points: if/else 39 (89 pts), boolean chains 38, loops 8 (22 pts), match/switch 1 (4 pts) (nesting depth added 67). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BodyBuilderImpl.processLookupResult (cognitive 152) · ×1
  • BodyBuilderImpl.processLookupResult (cognitive 152) pkg/front_end/lib/src/kernel/body_builder.dart:9220 — BodyBuilderImpl.processLookupResult has cognitive complexity 152 (threshold 15). Drivers by points: if/else 45 (100 pts), boolean chains 39, ternaries 4 (13 pts) (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryCompiler.visitStaticInvocation (cognitive 151) · ×1
  • LibraryCompiler.visitStaticInvocation (cognitive 151) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7395 — LibraryCompiler.visitStaticInvocation has cognitive complexity 151 (threshold 15). Drivers by points: if/else 54 (114 pts), loops 6 (17 pts), boolean chains 13, match/switch 2 (6 pts), ternaries 1 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (cognitive 150) · ×1
  • Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl (cognitive 150) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5281 — Parser.parseClassOrMixinOrExtensionOrEnumMemberImpl has cognitive complexity 150 (threshold 15). Drivers by points: if/else 50 (110 pts), boolean chains 40 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProgramCompiler.visitStaticInvocation (cognitive 149) · ×1
  • ProgramCompiler.visitStaticInvocation (cognitive 149) pkg/dev_compiler/lib/src/kernel/compiler.dart:6706 — ProgramCompiler.visitStaticInvocation has cognitive complexity 149 (threshold 15). Drivers by points: if/else 53 (114 pts), loops 6 (17 pts), boolean chains 13, match/switch 1 (4 pts), ternaries 1 (nesting depth added 75). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _MixinInferenceSolution._solveForEquality (cognitive 145) · ×1
  • _MixinInferenceSolution._solveForEquality (cognitive 145) pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart:261 — _MixinInferenceSolution._solveForEquality has cognitive complexity 145 (threshold 15). Drivers by points: if/else 44 (99 pts), loops 10 (30 pts), boolean chains 15, match/switch 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader._checkSupertypeClassModifiers (cognitive 145) · ×1
  • SourceLoader._checkSupertypeClassModifiers (cognitive 145) pkg/front_end/lib/src/source/source_loader.dart:2222 — SourceLoader._checkSupertypeClassModifiers has cognitive complexity 145 (threshold 15). Drivers by points: if/else 39 (90 pts), boolean chains 29, ternaries 4 (20 pts), loops 2 (6 pts) (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassMembersNodeBuilder.build (cognitive 144) · ×1
  • ClassMembersNodeBuilder.build (cognitive 144) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:597 — ClassMembersNodeBuilder.build has cognitive complexity 144 (threshold 15). Drivers by points: if/else 48 (101 pts), loops 10 (23 pts), boolean chains 13, ternaries 4 (7 pts) (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseFormalParameter (cognitive 142) · ×1
  • Parser.parseFormalParameter (cognitive 142) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:2033 — Parser.parseFormalParameter has cognitive complexity 142 (threshold 15). Drivers by points: if/else 60 (123 pts), boolean chains 15, match/switch 1 (4 pts) (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.resolveDataFlow (cognitive 141) · ×1
  • LinearScanRegisterAllocator.resolveDataFlow (cognitive 141) pkg/native_compiler/lib/back_end/register_allocator.dart:941 — LinearScanRegisterAllocator.resolveDataFlow has cognitive complexity 141 (threshold 15). Drivers by points: if/else 26 (99 pts), loops 9 (23 pts), ternaries 3 (11 pts), boolean chains 8 (nesting depth added 95). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Types.performSubtypeCheck (cognitive 141) · ×1
  • Types.performSubtypeCheck (cognitive 141) pkg/kernel/lib/src/types.dart:65 — Types.performSubtypeCheck has cognitive complexity 141 (threshold 15). Drivers by points: if/else 42 (102 pts), loops 9 (25 pts), boolean chains 9, ternaries 2 (4 pts), match/switch 1 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JFieldAnalysis.from (cognitive 140) · ×1
  • JFieldAnalysis.from (cognitive 140) pkg/compiler/lib/src/js_backend/field_analysis.dart:289 — JFieldAnalysis.from has cognitive complexity 140 (threshold 15). Drivers by points: if/else 43 (113 pts), boolean chains 10, loops 2 (8 pts), match/switch 1 (5 pts), ternaries 1 (4 pts) (nesting depth added 83). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _FfiUseSiteTransformer._visitStaticInvocation (cognitive 139) · ×1
  • _FfiUseSiteTransformer._visitStaticInvocation (cognitive 139) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:359 — _FfiUseSiteTransformer._visitStaticInvocation has cognitive complexity 139 (threshold 15). Drivers by points: if/else 49 (100 pts), boolean chains 29, ternaries 3 (9 pts), error handling 1 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantEvaluator._handleInvocation (cognitive 137) · ×1
  • ConstantEvaluator._handleInvocation (cognitive 137) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4300 — ConstantEvaluator._handleInvocation has cognitive complexity 137 (threshold 15). Drivers by points: if/else 37 (87 pts), boolean chains 23, match/switch 6 (19 pts), loops 2 (8 pts) (nesting depth added 69). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser._parsePrecedenceExpressionLoop (cognitive 133) · ×1
  • Parser._parsePrecedenceExpressionLoop (cognitive 133) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7211 — Parser._parsePrecedenceExpressionLoop has cognitive complexity 133 (threshold 15). Drivers by points: if/else 53 (122 pts), boolean chains 10, loops 1 (nesting depth added 69). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.visitClassDeclaration (cognitive 133) · ×1
  • _Visitor.visitClassDeclaration (cognitive 133) pkg/linter/lib/src/rules/analyzer_element_model_tracking.dart:54 — _Visitor.visitClassDeclaration has cognitive complexity 133 (threshold 15). Drivers by points: if/else 19 (85 pts), loops 5 (24 pts), boolean chains 17, match/switch 2 (7 pts) (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Type.generate (cognitive 127) · ×1
  • Type.generate (cognitive 127) pkg/vm_service/tool/dart/generate_dart_common.dart:571 — Type.generate has cognitive complexity 127 (threshold 15). Drivers by points: if/else 57 (90 pts), boolean chains 23, loops 4 (7 pts), ternaries 3 (7 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed (cognitive 127) · ×1
  • RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed (cognitive 127) pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart:1075 — RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed has cognitive complexity 127 (threshold 15). Drivers by points: if/else 50 (85 pts), loops 16 (31 pts), match/switch 2 (7 pts), boolean chains 4 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._initializeExperimentalInvalidation (cognitive 127) · ×1
  • IncrementalCompiler._initializeExperimentalInvalidation (cognitive 127) pkg/front_end/lib/src/base/incremental_compiler.dart:1283 — IncrementalCompiler._initializeExperimentalInvalidation has cognitive complexity 127 (threshold 15). Drivers by points: if/else 26 (77 pts), loops 16 (46 pts), boolean chains 4 (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResolvedCorrectionProducer.inferUndefinedExpressionType (cognitive 126) · ×1
  • ResolvedCorrectionProducer.inferUndefinedExpressionType (cognitive 126) pkg/analysis_server_plugin/lib/edit/dart/correction_producer.dart:514 — ResolvedCorrectionProducer.inferUndefinedExpressionType has cognitive complexity 126 (threshold 15). Drivers by points: if/else 60 (110 pts), boolean chains 8, match/switch 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sort._dualPivotQuicksort (cognitive 125) · ×1
  • Sort._dualPivotQuicksort (cognitive 125) sdk/lib/internal/sort.dart:90 — Sort._dualPivotQuicksort has cognitive complexity 125 (threshold 15). Drivers by points: if/else 39 (100 pts), loops 8 (24 pts), boolean chains 1 (nesting depth added 77). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OutlineBuilder.endFormalParameters (cognitive 125) · ×1
  • OutlineBuilder.endFormalParameters (cognitive 125) pkg/front_end/lib/src/source/outline_builder.dart:3296 — OutlineBuilder.endFormalParameters has cognitive complexity 125 (threshold 15). Drivers by points: if/else 39 (102 pts), loops 4 (13 pts), boolean chains 10 (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.visitParenthesizedExpression (cognitive 124) · ×1
  • _Visitor.visitParenthesizedExpression (cognitive 124) pkg/linter/lib/src/rules/unnecessary_parenthesis.dart:56 — _Visitor.visitParenthesizedExpression has cognitive complexity 124 (threshold 15). Drivers by points: if/else 43 (74 pts), boolean chains 50 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitBinaryExpression (cognitive 123) · ×1
  • ConstantEvaluator.visitBinaryExpression (cognitive 123) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:116 — ConstantEvaluator.visitBinaryExpression has cognitive complexity 123 (threshold 15). Drivers by points: if/else 48 (91 pts), boolean chains 27, ternaries 1 (4 pts), loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtypeHelper._isSubtypeOf (cognitive 122) · ×1
  • SubtypeHelper._isSubtypeOf (cognitive 122) pkg/analyzer/lib/src/dart/element/subtype.dart:262 — SubtypeHelper._isSubtypeOf has cognitive complexity 122 (threshold 15). Drivers by points: if/else 47 (82 pts), boolean chains 37, loops 1 (3 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl.canBeSubtypeOf (cognitive 122) · ×1
  • TypeSystemImpl.canBeSubtypeOf (cognitive 122) pkg/analyzer/lib/src/dart/element/type_system.dart:141 — TypeSystemImpl.canBeSubtypeOf has cognitive complexity 122 (threshold 15). Drivers by points: if/else 38 (89 pts), loops 7 (19 pts), boolean chains 14 (nesting depth added 63). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImpactData.apply (cognitive 122) · ×1
  • ImpactData.apply (cognitive 122) pkg/compiler/lib/src/ir/impact_data.dart:1438 — ImpactData.apply has cognitive complexity 122 (threshold 15). Drivers by points: loops 37 (74 pts), if/else 40 (42 pts), match/switch 2 (6 pts) (nesting depth added 43). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · InvokeDynamicSpecializer.lookupSpecializer (cognitive 121) · ×1
  • InvokeDynamicSpecializer.lookupSpecializer (cognitive 121) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:71 — InvokeDynamicSpecializer.lookupSpecializer has cognitive complexity 121 (threshold 15). Drivers by points: if/else 45 (121 pts) (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ModifyParameters.apply (cognitive 118) · ×1
  • ModifyParameters.apply (cognitive 118) pkg/analysis_server/lib/src/services/correction/fix/data_driven/modify_parameters.dart:81 — ModifyParameters.apply has cognitive complexity 118 (threshold 15). Drivers by points: if/else 29 (67 pts), loops 8 (17 pts), ternaries 4 (16 pts), boolean chains 9, match/switch 3 (9 pts) (nesting depth added 65). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _SanitizedMember.computeMembers (cognitive 118) · ×1
  • _SanitizedMember.computeMembers (cognitive 118) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1960 — _SanitizedMember.computeMembers has cognitive complexity 118 (threshold 15). Drivers by points: if/else 46 (105 pts), boolean chains 13 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · KernelTarget._finishConstruction (cognitive 114) · ×1
  • KernelTarget._finishConstruction (cognitive 114) pkg/front_end/lib/src/kernel/kernel_target.dart:1552 — KernelTarget._finishConstruction has cognitive complexity 114 (threshold 15). Drivers by points: if/else 30 (76 pts), boolean chains 19, loops 8 (16 pts), ternaries 1 (3 pts) (nesting depth added 56). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartLanguageServerBenchmark._listenToStdout (cognitive 113) · ×1
  • DartLanguageServerBenchmark._listenToStdout (cognitive 113) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:347 — DartLanguageServerBenchmark._listenToStdout has cognitive complexity 113 (threshold 15). Drivers by points: if/else 26 (88 pts), boolean chains 16, ternaries 1 (5 pts), loops 2 (4 pts) (nesting depth added 68). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · V1Projection._toV1Expression (cognitive 112) · ×1
  • V1Projection._toV1Expression (cognitive 112) pkg/analyzer/lib/src/dart/ast/ast.dart:62253 — V1Projection._toV1Expression has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 35 (70 pts), if/else 36, boolean chains 6 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator2.visitBinaryOperatorInvocation (cognitive 110) · ×1
  • ConstantEvaluator2.visitBinaryOperatorInvocation (cognitive 110) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:438 — ConstantEvaluator2.visitBinaryOperatorInvocation has cognitive complexity 110 (threshold 15). Drivers by points: if/else 43 (82 pts), boolean chains 23, ternaries 1 (4 pts), loops 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WebSocketProtocolTransformer.add (cognitive 109) · ×1
  • _WebSocketProtocolTransformer.add (cognitive 109) sdk/lib/_http/websocket_impl.dart:313 — _WebSocketProtocolTransformer.add has cognitive complexity 109 (threshold 15). Drivers by points: if/else 32 (97 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 65). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HttpDate._parseCookieDate (cognitive 108) · ×1
  • HttpDate._parseCookieDate (cognitive 108) sdk/lib/_http/http_date.dart:280 — HttpDate._parseCookieDate has cognitive complexity 108 (threshold 15). Drivers by points: if/else 31 (74 pts), boolean chains 21, loops 4 (11 pts), ternaries 1 (2 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Tuple.sanitize (cognitive 106) · ×1
  • _Tuple.sanitize (cognitive 106) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:549 — _Tuple.sanitize has cognitive complexity 106 (threshold 15). Drivers by points: if/else 46 (81 pts), boolean chains 15, loops 4 (8 pts), ternaries 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramBuilder._addJsInteropStubs (cognitive 105) · ×1
  • ProgramBuilder._addJsInteropStubs (cognitive 105) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:455 — ProgramBuilder._addJsInteropStubs has cognitive complexity 105 (threshold 15). Drivers by points: if/else 19 (71 pts), ternaries 2 (13 pts), loops 3 (11 pts), boolean chains 10 (nesting depth added 71). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SummaryCollector.createSummary (cognitive 104) · ×1
  • SummaryCollector.createSummary (cognitive 104) pkg/vm/lib/transformations/type_flow/summary_collector.dart:772 — SummaryCollector.createSummary has cognitive complexity 104 (threshold 15). Drivers by points: if/else 32 (56 pts), ternaries 8 (21 pts), loops 7 (15 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Tuple.sanitize (cognitive 103) · ×1
  • _Tuple.sanitize (cognitive 103) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1481 — _Tuple.sanitize has cognitive complexity 103 (threshold 15). Drivers by points: if/else 44 (73 pts), boolean chains 24, loops 2 (4 pts), ternaries 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri.resolveUri (cognitive 102) · ×1
  • _Uri.resolveUri (cognitive 102) sdk/lib/core/uri.dart:3220 — _Uri.resolveUri has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (90 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parseMethod (cognitive 102) · ×1
  • Parser.parseMethod (cognitive 102) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5807 — Parser.parseMethod has cognitive complexity 102 (threshold 15). Drivers by points: if/else 48 (73 pts), boolean chains 20, ternaries 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceTypeAliasBuilder._checkCyclicTypedefDependency (cognitive 102) · ×1
  • SourceTypeAliasBuilder._checkCyclicTypedefDependency (cognitive 102) pkg/front_end/lib/src/source/source_type_alias_builder.dart:165 — SourceTypeAliasBuilder._checkCyclicTypedefDependency has cognitive complexity 102 (threshold 15). Drivers by points: if/else 21 (68 pts), loops 8 (29 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 70). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DuplicateDefinitionVerifier.checkUnit (cognitive 99) · ×1
  • DuplicateDefinitionVerifier.checkUnit (cognitive 99) pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart:112 — DuplicateDefinitionVerifier.checkUnit has cognitive complexity 99 (threshold 15). Drivers by points: if/else 28 (82 pts), loops 13 (15 pts), match/switch 1 (2 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseTopLevelMemberImpl (cognitive 97) · ×1
  • Parser.parseTopLevelMemberImpl (cognitive 97) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4193 — Parser.parseTopLevelMemberImpl has cognitive complexity 97 (threshold 15). Drivers by points: if/else 38 (73 pts), boolean chains 24 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitVariableDeclaration (cognitive 97) · ×1
  • InScopeCompletionPass.visitVariableDeclaration (cognitive 97) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3418 — InScopeCompletionPass.visitVariableDeclaration has cognitive complexity 97 (threshold 15). Drivers by points: if/else 34 (84 pts), boolean chains 9, match/switch 1 (4 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CompletionHandler._getServerDartItems (cognitive 96) · ×1
  • CompletionHandler._getServerDartItems (cognitive 96) pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart:386 — CompletionHandler._getServerDartItems has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (55 pts), ternaries 6 (20 pts), boolean chains 11, error handling 4 (8 pts), loops 1 (2 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency (cognitive 95) · ×1
  • SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency (cognitive 95) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:509 — SourceExtensionTypeDeclarationBuilder._checkRepresentationDependency has cognitive complexity 95 (threshold 15). Drivers by points: if/else 21 (62 pts), loops 8 (27 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SwitchInfo.SwitchInfo (cognitive 94) · ×1
  • SwitchInfo.SwitchInfo (cognitive 94) pkg/dart2wasm/lib/code_generator.dart:5364 — SwitchInfo.SwitchInfo has cognitive complexity 94 (threshold 15). Drivers by points: if/else 26 (57 pts), boolean chains 23, loops 4 (10 pts), ternaries 1 (4 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.parse (cognitive 94) · ×1
  • Uri.parse (cognitive 94) sdk/lib/core/uri.dart:841 — Uri.parse has cognitive complexity 94 (threshold 15). Drivers by points: if/else 34 (75 pts), boolean chains 19 (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImportElementsComputer.createEdits (cognitive 94) · ×1
  • ImportElementsComputer.createEdits (cognitive 94) pkg/analysis_server/lib/src/computer/import_elements_computer.dart:31 — ImportElementsComputer.createEdits has cognitive complexity 94 (threshold 15). Drivers by points: if/else 16 (62 pts), loops 9 (30 pts), boolean chains 2 (nesting depth added 67). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BodyBuilderImpl.beginSwitchCase (cognitive 93) · ×1
  • BodyBuilderImpl.beginSwitchCase (cognitive 93) pkg/front_end/lib/src/kernel/body_builder.dart:957 — BodyBuilderImpl.beginSwitchCase has cognitive complexity 93 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 8 (30 pts), ternaries 1 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InScopeCompletionPass.visitArgumentList (cognitive 91) · ×1
  • InScopeCompletionPass.visitArgumentList (cognitive 91) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:293 — InScopeCompletionPass.visitArgumentList has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (71 pts), boolean chains 10, loops 3 (10 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DeclarationByElementLocator.visitNode (cognitive 91) · ×1
  • DeclarationByElementLocator.visitNode (cognitive 91) pkg/analyzer/lib/src/dart/analysis/results.dart:96 — DeclarationByElementLocator.visitNode has cognitive complexity 91 (threshold 15). Drivers by points: if/else 46 (82 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Future._propagateToListeners (cognitive 90) · ×1
  • _Future._propagateToListeners (cognitive 90) sdk/lib/async/future_impl.dart:831 — _Future._propagateToListeners has cognitive complexity 90 (threshold 15). Drivers by points: if/else 26 (70 pts), error handling 3 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FrontendCompiler.compile (cognitive 88) · ×1
  • FrontendCompiler.compile (cognitive 88) pkg/frontend_server/lib/frontend_server.dart:699 — FrontendCompiler.compile has cognitive complexity 88 (threshold 15). Drivers by points: if/else 38 (64 pts), loops 4 (9 pts), ternaries 5 (8 pts), boolean chains 7 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstrumentationLog._parseLogContent (cognitive 86) · ×1
  • InstrumentationLog._parseLogContent (cognitive 86) pkg/analysis_server/tool/instrumentation/log/log.dart:285 — InstrumentationLog._parseLogContent has cognitive complexity 86 (threshold 15). Drivers by points: if/else 28 (85 pts), loops 1 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Intrinsifier.generateStaticIntrinsic (cognitive 86) · ×1
  • Intrinsifier.generateStaticIntrinsic (cognitive 86) pkg/dart2wasm/lib/intrinsics.dart:1355 — Intrinsifier.generateStaticIntrinsic has cognitive complexity 86 (threshold 15). Drivers by points: if/else 32 (51 pts), match/switch 7 (13 pts), boolean chains 12, loops 5 (10 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeaturesDataInterpreter.isAsExpected (cognitive 86) · ×1
  • FeaturesDataInterpreter.isAsExpected (cognitive 86) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:252 — FeaturesDataInterpreter.isAsExpected has cognitive complexity 86 (threshold 15). Drivers by points: if/else 23 (57 pts), loops 4 (22 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MixinFullResolution.transformClass (cognitive 85) · ×1
  • MixinFullResolution.transformClass (cognitive 85) pkg/vm/lib/modular/transformations/mixin_full_resolution.dart:78 — MixinFullResolution.transformClass has cognitive complexity 85 (threshold 15). Drivers by points: if/else 27 (56 pts), loops 7 (16 pts), boolean chains 5, match/switch 1 (5 pts), ternaries 1 (3 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseExpressionStatementOrDeclarationAfterModifiers (cognitive 85) · ×1
  • Parser.parseExpressionStatementOrDeclarationAfterModifiers (cognitive 85) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9891 — Parser.parseExpressionStatementOrDeclarationAfterModifiers has cognitive complexity 85 (threshold 15). Drivers by points: if/else 35 (68 pts), boolean chains 17 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DispatchTable.build (cognitive 84) · ×1
  • DispatchTable.build (cognitive 84) pkg/dart2wasm/lib/dispatch_table.dart:505 — DispatchTable.build has cognitive complexity 84 (threshold 15). Drivers by points: if/else 33 (62 pts), loops 11 (16 pts), boolean chains 6 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeEnvironment.computeTypeShapeCheckSufficiency (cognitive 84) · ×1
  • TypeEnvironment.computeTypeShapeCheckSufficiency (cognitive 84) pkg/kernel/lib/type_environment.dart:306 — TypeEnvironment.computeTypeShapeCheckSufficiency has cognitive complexity 84 (threshold 15). Drivers by points: if/else 29 (59 pts), loops 6 (15 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaCodeGenerator.visitLoopInfo (cognitive 84) · ×1
  • SsaCodeGenerator.visitLoopInfo (cognitive 84) pkg/compiler/lib/src/ssa/codegen.dart:1046 — SsaCodeGenerator.visitLoopInfo has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (67 pts), boolean chains 10, loops 1 (6 pts), match/switch 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MiniJsParser.getToken (cognitive 84) · ×1
  • MiniJsParser.getToken (cognitive 84) pkg/dev_compiler/lib/src/js_ast/builder.dart:701 — MiniJsParser.getToken has cognitive complexity 84 (threshold 15). Drivers by points: if/else 29 (62 pts), boolean chains 14, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConvertToDeclaringParameter.compute (cognitive 83) · ×1
  • ConvertToDeclaringParameter.compute (cognitive 83) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:41 — ConvertToDeclaringParameter.compute has cognitive complexity 83 (threshold 15). Drivers by points: if/else 43 (69 pts), boolean chains 7, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionTypeMembersNodeBuilder.build (cognitive 83) · ×1
  • ExtensionTypeMembersNodeBuilder.build (cognitive 83) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:35 — ExtensionTypeMembersNodeBuilder.build has cognitive complexity 83 (threshold 15). Drivers by points: if/else 33 (62 pts), loops 7 (11 pts), boolean chains 6, ternaries 4 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.getToken (cognitive 83) · ×1
  • MiniJsParser.getToken (cognitive 83) pkg/js_ast/lib/src/builder.dart:619 — MiniJsParser.getToken has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (58 pts), boolean chains 17, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.visitClassDeclaration (cognitive 83) · ×1
  • _Visitor.visitClassDeclaration (cognitive 83) pkg/linter/lib/src/rules/use_enums.dart:139 — _Visitor.visitClassDeclaration has cognitive complexity 83 (threshold 15). Drivers by points: if/else 28 (68 pts), boolean chains 8, loops 3 (6 pts), error handling 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _EnumDescription._validateFields (cognitive 82) · ×1
  • _EnumDescription._validateFields (cognitive 82) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:653 — _EnumDescription._validateFields has cognitive complexity 82 (threshold 15). Drivers by points: if/else 19 (65 pts), loops 5 (10 pts), boolean chains 7 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LeastUpperBoundHelper._computeLeastUpperBound (cognitive 82) · ×1
  • LeastUpperBoundHelper._computeLeastUpperBound (cognitive 82) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:391 — LeastUpperBoundHelper._computeLeastUpperBound has cognitive complexity 82 (threshold 15). Drivers by points: if/else 55 (71 pts), boolean chains 11 (nesting depth added 16). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Driver._analyzeAll (cognitive 82) · ×1
  • Driver._analyzeAll (cognitive 82) pkg/analyzer_cli/lib/src/driver.dart:145 — Driver._analyzeAll has cognitive complexity 82 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 8 (22 pts), error handling 2 (8 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClassVerifier.verify (cognitive 81) · ×1
  • _ClassVerifier.verify (cognitive 81) pkg/analyzer/lib/src/error/inheritance_override.dart:313 — _ClassVerifier.verify has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (60 pts), boolean chains 11, loops 4 (7 pts), ternaries 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Analysis.reverseTransitiveGraph (cognitive 80) · ×1
  • Analysis.reverseTransitiveGraph (cognitive 80) pkg/heap_snapshot/lib/analysis.dart:335 — Analysis.reverseTransitiveGraph has cognitive complexity 80 (threshold 15). Drivers by points: if/else 14 (66 pts), loops 4 (13 pts), boolean chains 1 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportLibrary._importLibraryForElement (cognitive 79) · ×1
  • ImportLibrary._importLibraryForElement (cognitive 79) pkg/analysis_server/lib/src/services/correction/dart/import_library.dart:312 — ImportLibrary._importLibraryForElement has cognitive complexity 79 (threshold 15). Drivers by points: if/else 22 (44 pts), ternaries 10 (30 pts), boolean chains 3, loops 2 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplaceWithVar.compute (cognitive 79) · ×1
  • ReplaceWithVar.compute (cognitive 79) pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart:33 — ReplaceWithVar.compute has cognitive complexity 79 (threshold 15). Drivers by points: if/else 28 (63 pts), boolean chains 16 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExtractMethodRefactoringImpl.buildChange (cognitive 79) · ×1
  • ExtractMethodRefactoringImpl.buildChange (cognitive 79) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:190 — ExtractMethodRefactoringImpl.buildChange has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (66 pts), loops 3 (6 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExpressionCompiler.compileExpressionToJs (cognitive 79) · ×1
  • ExpressionCompiler.compileExpressionToJs (cognitive 79) pkg/dev_compiler/lib/src/kernel/expression_compiler.dart:68 — ExpressionCompiler.compileExpressionToJs has cognitive complexity 79 (threshold 15). Drivers by points: if/else 16 (58 pts), loops 4 (14 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase._inferInvocation (cognitive 79) · ×1
  • InferenceVisitorBase._inferInvocation (cognitive 79) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1738 — InferenceVisitorBase._inferInvocation has cognitive complexity 79 (threshold 15). Drivers by points: if/else 33 (51 pts), loops 7 (12 pts), boolean chains 10, match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToSuperParameters.compute (cognitive 78) · ×1
  • ConvertToSuperParameters.compute (cognitive 78) pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart:36 — ConvertToSuperParameters.compute has cognitive complexity 78 (threshold 15). Drivers by points: if/else 34 (66 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageScheduler.add (cognitive 77) · ×1
  • MessageScheduler.add (cognitive 77) pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:70 — MessageScheduler.add has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (60 pts), loops 3 (11 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConvertToSwitchExpression._getSupportedSwitchType (cognitive 77) · ×1
  • ConvertToSwitchExpression._getSupportedSwitchType (cognitive 77) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:386 — ConvertToSwitchExpression._getSupportedSwitchType has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (67 pts), boolean chains 9, loops 1 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Collector.collect (cognitive 77) · ×1
  • _Collector.collect (cognitive 77) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:76 — _Collector.collect has cognitive complexity 77 (threshold 15). Drivers by points: if/else 47 (64 pts), boolean chains 7, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartDebugAdapter.variablesRequest (cognitive 77) · ×1
  • DartDebugAdapter.variablesRequest (cognitive 77) pkg/dap_adapters/lib/src/adapters/dart.dart:2554 — DartDebugAdapter.variablesRequest has cognitive complexity 77 (threshold 15). Drivers by points: if/else 26 (42 pts), ternaries 8 (20 pts), boolean chains 9, error handling 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember (cognitive 77) · ×1
  • ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember (cognitive 77) pkg/front_end/lib/src/base/incremental_compiler.dart:3007 — ExpressionEvaluationHelperImpl.overwriteFindInterfaceMember has cognitive complexity 77 (threshold 15). Drivers by points: if/else 13 (54 pts), loops 4 (17 pts), boolean chains 6 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NamedTypeBuilderImpl.findRawTypesWithInboundReferences (cognitive 77) · ×1
  • NamedTypeBuilderImpl.findRawTypesWithInboundReferences (cognitive 77) pkg/front_end/lib/src/builder/named_type_builder.dart:1156 — NamedTypeBuilderImpl.findRawTypesWithInboundReferences has cognitive complexity 77 (threshold 15). Drivers by points: if/else 18 (63 pts), loops 3 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartScopeBuilder2._filter (cognitive 77) · ×1
  • DartScopeBuilder2._filter (cognitive 77) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:605 — DartScopeBuilder2._filter has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 39, if/else 30 (37 pts), loops 1 (nesting depth added 7). 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.
D2 · Cognitive Complexity · MemberDuplicateDefinitionVerifier._checkClassMembers (cognitive 76) · ×1
  • MemberDuplicateDefinitionVerifier._checkClassMembers (cognitive 76) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:48 — MemberDuplicateDefinitionVerifier._checkClassMembers has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (53 pts), ternaries 3 (12 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder (cognitive 76) · ×1
  • DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder (cognitive 76) pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:39 — DillExtensionTypeDeclarationBuilder.DillExtensionTypeDeclarationBuilder has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (64 pts), boolean chains 6, match/switch 2 (4 pts), loops 2 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.endPrimaryConstructor (cognitive 76) · ×1
  • OutlineBuilder.endPrimaryConstructor (cognitive 76) pkg/front_end/lib/src/source/outline_builder.dart:1801 — OutlineBuilder.endPrimaryConstructor has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (66 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceExtensionTypeDeclarationBuilder.build (cognitive 76) · ×1
  • SourceExtensionTypeDeclarationBuilder.build (cognitive 76) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:256 — SourceExtensionTypeDeclarationBuilder.build has cognitive complexity 76 (threshold 15). Drivers by points: if/else 23 (66 pts), loops 2 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _RecGroupBuilder._assignBrandTypes (cognitive 76) · ×1
  • _RecGroupBuilder._assignBrandTypes (cognitive 76) pkg/wasm_builder/lib/src/builder/types.dart:124 — _RecGroupBuilder._assignBrandTypes has cognitive complexity 76 (threshold 15). Drivers by points: if/else 9 (42 pts), loops 9 (28 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scrape._processPath (cognitive 75) · ×1
  • Scrape._processPath (cognitive 75) pkg/scrape/lib/scrape.dart:233 — Scrape._processPath has cognitive complexity 75 (threshold 15). Drivers by points: if/else 28 (73 pts), boolean chains 1, loops 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.buildLiveRanges (cognitive 75) · ×1
  • LinearScanRegisterAllocator.buildLiveRanges (cognitive 75) pkg/native_compiler/lib/back_end/register_allocator.dart:190 — LinearScanRegisterAllocator.buildLiveRanges has cognitive complexity 75 (threshold 15). Drivers by points: if/else 16 (51 pts), loops 6 (16 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuzzyMatcher.computeScore (cognitive 75) · ×1
  • FuzzyMatcher.computeScore (cognitive 75) pkg/analyzer/lib/src/utilities/fuzzy_matcher.dart:161 — FuzzyMatcher.computeScore has cognitive complexity 75 (threshold 15). Drivers by points: if/else 14 (43 pts), boolean chains 15, ternaries 3 (9 pts), loops 5 (8 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForAugmentationFormalParameters (cognitive 73) · ×1
  • ErrorVerifier._checkForAugmentationFormalParameters (cognitive 73) pkg/analyzer/lib/src/generated/error_verifier.dart:3117 — ErrorVerifier._checkForAugmentationFormalParameters has cognitive complexity 73 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 13, loops 6 (9 pts), ternaries 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseTopLevelKeywordDeclaration (cognitive 72) · ×1
  • Parser.parseTopLevelKeywordDeclaration (cognitive 72) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:682 — Parser.parseTopLevelKeywordDeclaration has cognitive complexity 72 (threshold 15). Drivers by points: if/else 30 (66 pts), boolean chains 6 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FlutterConvertToStatefulWidget.compute (cognitive 72) · ×1
  • FlutterConvertToStatefulWidget.compute (cognitive 72) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart:30 — FlutterConvertToStatefulWidget.compute has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 6 (9 pts), boolean chains 7, ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorDeclarationMixin._finalizeSuperInitializingFormals (cognitive 72) · ×1
  • _ConstructorDeclarationMixin._finalizeSuperInitializingFormals (cognitive 72) pkg/front_end/lib/src/fragment/constructor/declaration.dart:292 — _ConstructorDeclarationMixin._finalizeSuperInitializingFormals has cognitive complexity 72 (threshold 15). Drivers by points: if/else 26 (61 pts), boolean chains 7, loops 2, ternaries 1 (2 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PubspecFixGenerator._addMissingDependency (cognitive 71) · ×1
  • PubspecFixGenerator._addMissingDependency (cognitive 71) pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart:147 — PubspecFixGenerator._addMissingDependency has cognitive complexity 71 (threshold 15). Drivers by points: if/else 15 (44 pts), loops 5 (13 pts), ternaries 2 (10 pts), boolean chains 4 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GreatestLowerBoundHelper.getGreatestLowerBound (cognitive 71) · ×1
  • GreatestLowerBoundHelper.getGreatestLowerBound (cognitive 71) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:23 — GreatestLowerBoundHelper.getGreatestLowerBound has cognitive complexity 71 (threshold 15). Drivers by points: if/else 42 (56 pts), boolean chains 15 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypePropertyResolver.resolve (cognitive 71) · ×1
  • TypePropertyResolver.resolve (cognitive 71) pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart:101 — TypePropertyResolver.resolve has cognitive complexity 71 (threshold 15). Drivers by points: if/else 32 (60 pts), boolean chains 11 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._validateNativeAddressOf (cognitive 71) · ×1
  • FfiVerifier._validateNativeAddressOf (cognitive 71) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1972 — FfiVerifier._validateNativeAddressOf has cognitive complexity 71 (threshold 15). Drivers by points: if/else 17 (65 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _InitializationFromUri._initializeFromDill (cognitive 71) · ×1
  • _InitializationFromUri._initializeFromDill (cognitive 71) pkg/front_end/lib/src/base/incremental_compiler.dart:3508 — _InitializationFromUri._initializeFromDill has cognitive complexity 71 (threshold 15). Drivers by points: if/else 14 (61 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GraphIsomorphizer.generateRootImport (cognitive 70) · ×1
  • GraphIsomorphizer.generateRootImport (cognitive 70) pkg/compiler/tool/graph_isomorphizer.dart:189 — GraphIsomorphizer.generateRootImport has cognitive complexity 70 (threshold 15). Drivers by points: if/else 9 (41 pts), loops 9 (29 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportOrganizer._organizeDirectives (cognitive 70) · ×1
  • ImportOrganizer._organizeDirectives (cognitive 70) pkg/analysis_server/lib/src/services/correction/organize_imports.dart:85 — ImportOrganizer._organizeDirectives has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (47 pts), ternaries 3 (10 pts), boolean chains 5, loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkUseOfDefaultValuesInParameters (cognitive 70) · ×1
  • ErrorVerifier._checkUseOfDefaultValuesInParameters (cognitive 70) pkg/analyzer/lib/src/generated/error_verifier.dart:8327 — ErrorVerifier._checkUseOfDefaultValuesInParameters has cognitive complexity 70 (threshold 15). Drivers by points: if/else 34 (60 pts), ternaries 1 (7 pts), boolean chains 2, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalyzeCommand.run (cognitive 70) · ×1
  • AnalyzeCommand.run (cognitive 70) pkg/dartdev/lib/src/commands/analyze.dart:195 — AnalyzeCommand.run has cognitive complexity 70 (threshold 15). Drivers by points: if/else 33 (45 pts), ternaries 6 (10 pts), boolean chains 8, loops 5 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartSnippetRequest._getContext (cognitive 69) · ×1
  • DartSnippetRequest._getContext (cognitive 69) pkg/analysis_server/lib/src/services/snippets/dart_snippet_request.dart:98 — DartSnippetRequest._getContext has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 14, ternaries 3 (9 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstanceMemberInferrer._inferAccessorOrField (cognitive 69) · ×1
  • InstanceMemberInferrer._inferAccessorOrField (cognitive 69) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:88 — InstanceMemberInferrer._inferAccessorOrField has cognitive complexity 69 (threshold 15). Drivers by points: if/else 33 (60 pts), boolean chains 9 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._doTryInlineMethod (cognitive 69) · ×1
  • KernelSsaGraphBuilder._doTryInlineMethod (cognitive 69) pkg/compiler/lib/src/ssa/builder.dart:7879 — KernelSsaGraphBuilder._doTryInlineMethod has cognitive complexity 69 (threshold 15). Drivers by points: if/else 42 (50 pts), boolean chains 17, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BuildCliSubcommand.doBuild (cognitive 69) · ×1
  • BuildCliSubcommand.doBuild (cognitive 69) pkg/dartdev/lib/src/commands/build.dart:339 — BuildCliSubcommand.doBuild has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (52 pts), ternaries 3 (7 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _PropertyPreBuilder.absorbFragment (cognitive 69) · ×1
  • _PropertyPreBuilder.absorbFragment (cognitive 69) pkg/front_end/lib/src/source/builder_factory.dart:2320 — _PropertyPreBuilder.absorbFragment has cognitive complexity 69 (threshold 15). Drivers by points: if/else 33 (64 pts), boolean chains 4, match/switch 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogPlayer.play (cognitive 68) · ×1
  • LogPlayer.play (cognitive 68) pkg/analysis_server/tool/log_player/log_player.dart:63 — LogPlayer.play has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (54 pts), boolean chains 8, match/switch 1 (4 pts), loops 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserCreatorListener.endMethod (cognitive 68) · ×1
  • ParserCreatorListener.endMethod (cognitive 68) pkg/front_end/tool/parser_ast_helper_creator.dart:259 — ParserCreatorListener.endMethod has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 5 (14 pts), boolean chains 10, ternaries 1 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToInitializingFormal._computeChange (cognitive 68) · ×1
  • ConvertToInitializingFormal._computeChange (cognitive 68) pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart:187 — ConvertToInitializingFormal._computeChange has cognitive complexity 68 (threshold 15). Drivers by points: if/else 25 (48 pts), ternaries 2 (8 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FragmentEmitter.emitInstallTearOffs (cognitive 68) · ×1
  • FragmentEmitter.emitInstallTearOffs (cognitive 68) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1422 — FragmentEmitter.emitInstallTearOffs has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (45 pts), loops 5 (9 pts), boolean chains 7, ternaries 3 (7 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator._checkInitializers (cognitive 67) · ×1
  • _ConstructorInvocationEvaluator._checkInitializers (cognitive 67) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3150 — _ConstructorInvocationEvaluator._checkInitializers has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (51 pts), match/switch 2 (6 pts), ternaries 1 (6 pts), boolean chains 3, loops 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NullSafetyDeadCodeVerifier.flowEnd (cognitive 67) · ×1
  • NullSafetyDeadCodeVerifier.flowEnd (cognitive 67) pkg/analyzer/lib/src/error/dead_code_verifier.dart:205 — NullSafetyDeadCodeVerifier.flowEnd has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (59 pts), boolean chains 8 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KFieldAnalysis.registerInstantiatedClass (cognitive 67) · ×1
  • KFieldAnalysis.registerInstantiatedClass (cognitive 67) pkg/compiler/lib/src/js_backend/field_analysis.dart:47 — KFieldAnalysis.registerInstantiatedClass has cognitive complexity 67 (threshold 15). Drivers by points: if/else 13 (53 pts), boolean chains 5, match/switch 1 (5 pts), loops 3 (4 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor._findAssignedField (cognitive 67) · ×1
  • _Visitor._findAssignedField (cognitive 67) pkg/linter/lib/src/rules/use_declaring_parameters.dart:96 — _Visitor._findAssignedField has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (64 pts), loops 2 (3 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartDocTest.compileAndRun (cognitive 66) · ×1
  • DartDocTest.compileAndRun (cognitive 66) pkg/front_end/tool/dart_doctest_impl.dart:123 — DartDocTest.compileAndRun has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (44 pts), loops 7 (16 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoSuchMethodError.toString (cognitive 66) · ×1
  • NoSuchMethodError.toString (cognitive 66) sdk/lib/_internal/vm/lib/errors_patch.dart:233 — NoSuchMethodError.toString has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (50 pts), loops 2 (6 pts), ternaries 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamedTypeResolver.resolveConstructorTypeReference (cognitive 66) · ×1
  • NamedTypeResolver.resolveConstructorTypeReference (cognitive 66) pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart:132 — NamedTypeResolver.resolveConstructorTypeReference has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (38 pts), ternaries 4 (11 pts), match/switch 3 (9 pts), boolean chains 8 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterceptorStubGenerator.generateGetInterceptorMethod (cognitive 66) · ×1
  • InterceptorStubGenerator.generateGetInterceptorMethod (cognitive 66) pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart:50 — InterceptorStubGenerator.generateGetInterceptorMethod has cognitive complexity 66 (threshold 15). Drivers by points: if/else 42 (53 pts), boolean chains 9, ternaries 1 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _RawSecureSocket._tryFilter (cognitive 65) · ×1
  • _RawSecureSocket._tryFilter (cognitive 65) sdk/lib/io/secure_socket.dart:1105 — _RawSecureSocket._tryFilter has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (57 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parsePrimary (cognitive 65) · ×1
  • Parser.parsePrimary (cognitive 65) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8111 — Parser.parsePrimary has cognitive complexity 65 (threshold 15). Drivers by points: if/else 41 (57 pts), boolean chains 8 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseTryStatement (cognitive 64) · ×1
  • Parser.parseTryStatement (cognitive 64) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:10729 — Parser.parseTryStatement has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (62 pts), boolean chains 1, loops 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RuntimeTypesSubstitutionsMixin._computeChecks (cognitive 64) · ×1
  • RuntimeTypesSubstitutionsMixin._computeChecks (cognitive 64) pkg/compiler/lib/src/js_backend/runtime_types.dart:120 — RuntimeTypesSubstitutionsMixin._computeChecks has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 5 (12 pts), boolean chains 10, ternaries 2 (7 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProgramCompiler._emitClassSignature (cognitive 64) · ×1
  • ProgramCompiler._emitClassSignature (cognitive 64) pkg/dev_compiler/lib/src/kernel/compiler.dart:1816 — ProgramCompiler._emitClassSignature has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (39 pts), ternaries 6 (12 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitClassSignature (cognitive 64) · ×1
  • LibraryCompiler._emitClassSignature (cognitive 64) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2113 — LibraryCompiler._emitClassSignature has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (39 pts), ternaries 6 (12 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassMembersNodeBuilder.inferMethodType (cognitive 64) · ×1
  • ClassMembersNodeBuilder.inferMethodType (cognitive 64) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:131 — ClassMembersNodeBuilder.inferMethodType has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (44 pts), loops 4 (15 pts), boolean chains 5 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StandardBounds._getFunctionStandardUpperBound (cognitive 64) · ×1
  • StandardBounds._getFunctionStandardUpperBound (cognitive 64) pkg/kernel/lib/src/standard_bounds.dart:1332 — StandardBounds._getFunctionStandardUpperBound has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 7 (14 pts), boolean chains 8, ternaries 3 (6 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parse (cognitive 63) · ×1
  • _ChunkedJsonParser.parse (cognitive 63) sdk/lib/_internal/wasm/common/convert_patch.dart:897 — _ChunkedJsonParser.parse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (56 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddFieldFormalParameters._computeFromPieces (cognitive 63) · ×1
  • AddFieldFormalParameters._computeFromPieces (cognitive 63) pkg/analysis_server/lib/src/services/correction/dart/add_field_formal_parameters.dart:87 — AddFieldFormalParameters._computeFromPieces has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (42 pts), boolean chains 9, loops 5 (7 pts), ternaries 3 (4 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisOptionsImpl.signature (cognitive 63) · ×1
  • AnalysisOptionsImpl.signature (cognitive 63) pkg/analyzer/lib/src/analysis_options/analysis_options.dart:276 — AnalysisOptionsImpl.signature has cognitive complexity 63 (threshold 15). Drivers by points: if/else 9 (38 pts), loops 7 (17 pts), match/switch 2 (8 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluationEngine.computeDependencies (cognitive 63) · ×1
  • ConstantEvaluationEngine.computeDependencies (cognitive 63) pkg/analyzer/lib/src/dart/constant/evaluation.dart:221 — ConstantEvaluationEngine.computeDependencies has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 3 (9 pts), boolean chains 6 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ClassVerifier._verifyMustBeOverridden (cognitive 63) · ×1
  • _ClassVerifier._verifyMustBeOverridden (cognitive 63) pkg/analyzer/lib/src/error/inheritance_override.dart:1060 — _ClassVerifier._verifyMustBeOverridden has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 11, loops 4 (7 pts), match/switch 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InitializerBuilder._createImplicitSuperInitializer (cognitive 63) · ×1
  • _InitializerBuilder._createImplicitSuperInitializer (cognitive 63) pkg/front_end/lib/src/kernel/resolver_helpers.dart:574 — _InitializerBuilder._createImplicitSuperInitializer has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 3 (10 pts), match/switch 1 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.visitClassDeclaration (cognitive 63) · ×1
  • _Visitor.visitClassDeclaration (cognitive 63) pkg/linter/lib/src/rules/diagnostic_describe_all_properties.dart:75 — _Visitor.visitClassDeclaration has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · bin_to_assembly.Main (cognitive 63) · ×1
  • bin_to_assembly.Main (cognitive 63) runtime/tools/bin_to_assembly.py:15 — bin_to_assembly.Main has cognitive complexity 63 (threshold 15). Drivers by points: if/else 38 (54 pts), loops 2 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator.getFunctionDeclaration (cognitive 62) · ×1
  • BytecodeGenerator.getFunctionDeclaration (cognitive 62) pkg/dart2bytecode/lib/bytecode_generator.dart:621 — BytecodeGenerator.getFunctionDeclaration has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33 (51 pts), boolean chains 8, loops 2, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackChecker.checkStackStateForAssert (cognitive 62) · ×1
  • StackChecker.checkStackStateForAssert (cognitive 62) pkg/_fe_analyzer_shared/lib/src/util/stack_checker.dart:93 — StackChecker.checkStackStateForAssert has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (52 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatternConverter.dispatchPattern (cognitive 62) · ×1
  • PatternConverter.dispatchPattern (cognitive 62) pkg/analyzer/lib/src/generated/exhaustiveness.dart:581 — PatternConverter.dispatchPattern has cognitive complexity 62 (threshold 15). Drivers by points: if/else 29 (48 pts), loops 4 (8 pts), boolean chains 6 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosureDataBuilder._updateScopeBasedOnRtiNeed (cognitive 62) · ×1
  • ClosureDataBuilder._updateScopeBasedOnRtiNeed (cognitive 62) pkg/compiler/lib/src/js_model/closure.dart:256 — ClosureDataBuilder._updateScopeBasedOnRtiNeed has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (58 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitInvokeStatic (cognitive 62) · ×1
  • SsaInstructionSimplifier.visitInvokeStatic (cognitive 62) pkg/compiler/lib/src/ssa/optimize.dart:2238 — SsaInstructionSimplifier.visitInvokeStatic has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (61 pts), boolean chains 1 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResolutionWorldBuilder._getMemberUsage (cognitive 62) · ×1
  • ResolutionWorldBuilder._getMemberUsage (cognitive 62) pkg/compiler/lib/src/universe/resolution_world_builder.dart:799 — ResolutionWorldBuilder._getMemberUsage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (52 pts), boolean chains 6, loops 1 (4 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pdb._readModule (cognitive 62) · ×1
  • Pdb._readModule (cognitive 62) pkg/native_stack_traces/lib/src/pdb.dart:997 — Pdb._readModule has cognitive complexity 62 (threshold 15). Drivers by points: loops 12 (25 pts), if/else 7 (18 pts), ternaries 4 (13 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionLogAnalyzer.processFile (cognitive 61) · ×1
  • SessionLogAnalyzer.processFile (cognitive 61) pkg/analysis_server/.agents/skills/improve-performance-with-session-log/scripts/analyze_session_log.dart:217 — SessionLogAnalyzer.processFile has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (38 pts), boolean chains 20, error handling 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Intrinsifier.generateInstanceIntrinsic (cognitive 61) · ×1
  • Intrinsifier.generateInstanceIntrinsic (cognitive 61) pkg/dart2wasm/lib/intrinsics.dart:774 — Intrinsifier.generateInstanceIntrinsic has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (33 pts), match/switch 7 (20 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Cookie._parseSetCookieValue (cognitive 61) · ×1
  • _Cookie._parseSetCookieValue (cognitive 61) sdk/lib/_http/http_headers.dart:1100 — _Cookie._parseSetCookieValue has cognitive complexity 61 (threshold 15). Drivers by points: if/else 24 (43 pts), ternaries 2 (6 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForMixinWithConflictingPrivateMember (cognitive 61) · ×1
  • ErrorVerifier._checkForMixinWithConflictingPrivateMember (cognitive 61) pkg/analyzer/lib/src/generated/error_verifier.dart:6575 — ErrorVerifier._checkForMixinWithConflictingPrivateMember has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 4 (13 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConditionTargets._step (cognitive 61) · ×1
  • ConditionTargets._step (cognitive 61) pkg/compiler/lib/src/ssa/optimize.dart:4264 — ConditionTargets._step has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (52 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibrariesSpecification.parse (cognitive 60) · ×1
  • LibrariesSpecification.parse (cognitive 60) pkg/_fe_analyzer_shared/lib/src/util/libraries_specification.dart:200 — LibrariesSpecification.parse has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 3 (7 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionTarget.forOffset (cognitive 60) · ×1
  • CompletionTarget.forOffset (cognitive 60) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:140 — CompletionTarget.forOffset has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HValidator.visitBasicBlock (cognitive 60) · ×1
  • HValidator.visitBasicBlock (cognitive 60) pkg/compiler/lib/src/ssa/validate.dart:23 — HValidator.visitBasicBlock has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 16, loops 5 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._computeReusedLibraries (cognitive 60) · ×1
  • IncrementalCompiler._computeReusedLibraries (cognitive 60) pkg/front_end/lib/src/base/incremental_compiler.dart:2687 — IncrementalCompiler._computeReusedLibraries has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (40 pts), loops 9 (14 pts), boolean chains 6 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassIdNumbering._number (cognitive 59) · ×1
  • ClassIdNumbering._number (cognitive 59) pkg/dart2wasm/lib/class_info.dart:819 — ClassIdNumbering._number has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 5 (10 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferrerEngine._runOverAllElements (cognitive 59) · ×1
  • InferrerEngine._runOverAllElements (cognitive 59) pkg/compiler/lib/src/inferrer/engine.dart:358 — InferrerEngine._runOverAllElements has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 6 (8 pts), boolean chains 3, ternaries 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterceptorStubGenerator._fastPathForOneShotInterceptor (cognitive 59) · ×1
  • InterceptorStubGenerator._fastPathForOneShotInterceptor (cognitive 59) pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart:317 — InterceptorStubGenerator._fastPathForOneShotInterceptor has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 13, ternaries 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramBuilder._buildClass (cognitive 59) · ×1
  • ProgramBuilder._buildClass (cognitive 59) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:657 — ProgramBuilder._buildClass has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 10, loops 3 (4 pts), ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._defineClass (cognitive 59) · ×1
  • ProgramCompiler._defineClass (cognitive 59) pkg/dev_compiler/lib/src/kernel/compiler.dart:1462 — ProgramCompiler._defineClass has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 6 (12 pts), boolean chains 8, loops 5 (7 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForwardingNode.finalize (cognitive 59) · ×1
  • ForwardingNode.finalize (cognitive 59) pkg/front_end/lib/src/kernel/forwarding_node.dart:71 — ForwardingNode.finalize has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 19, match/switch 1 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parse (cognitive 58) · ×1
  • _ChunkedJsonParser.parse (cognitive 58) sdk/lib/_internal/vm/lib/convert_patch.dart:819 — _ChunkedJsonParser.parse has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Evaluator._visitElements (cognitive 58) · ×1
  • Evaluator._visitElements (cognitive 58) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:443 — Evaluator._visitElements has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 7 (25 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor._complete_tryStatement (cognitive 58) · ×1
  • StatementCompletionProcessor._complete_tryStatement (cognitive 58) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:1029 — StatementCompletionProcessor._complete_tryStatement has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (56 pts), boolean chains 2 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AddLate.compute (cognitive 58) · ×1
  • AddLate.compute (cognitive 58) pkg/analysis_server/lib/src/services/correction/dart/add_late.dart:35 — AddLate.compute has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (49 pts), boolean chains 9 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RemoveUnusedField.compute (cognitive 58) · ×1
  • RemoveUnusedField.compute (cognitive 58) pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart:120 — RemoveUnusedField.compute has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 9, match/switch 2 (8 pts), loops 3 (6 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SignatureUpdater.updateDeclaration (cognitive 58) · ×1
  • _SignatureUpdater.updateDeclaration (cognitive 58) pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart:783 — _SignatureUpdater.updateDeclaration has cognitive complexity 58 (threshold 15). Drivers by points: if/else 29 (46 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogSanitizer._sanitizeResult (cognitive 58) · ×1
  • LogSanitizer._sanitizeResult (cognitive 58) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:919 — LogSanitizer._sanitizeResult has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 4 (12 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InheritanceManager3._getInterfaceExtensionType (cognitive 58) · ×1
  • InheritanceManager3._getInterfaceExtensionType (cognitive 58) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:825 — InheritanceManager3._getInterfaceExtensionType has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 9 (11 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtypeHelper._isFunctionSubtypeOf (cognitive 58) · ×1
  • SubtypeHelper._isFunctionSubtypeOf (cognitive 58) pkg/analyzer/lib/src/dart/element/subtype.dart:85 — SubtypeHelper._isFunctionSubtypeOf has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (49 pts), match/switch 1 (4 pts), boolean chains 3, loops 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaSimplifyInterceptors.visitInterceptor (cognitive 58) · ×1
  • SsaSimplifyInterceptors.visitInterceptor (cognitive 58) pkg/compiler/lib/src/ssa/interceptor_simplifier.dart:235 — SsaSimplifyInterceptors.visitInterceptor has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 13, loops 2 (5 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantsTransformer.visitSwitchExpression (cognitive 58) · ×1
  • ConstantsTransformer.visitSwitchExpression (cognitive 58) pkg/front_end/lib/src/kernel/constant_evaluator.dart:2002 — ConstantsTransformer.visitSwitchExpression has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (39 pts), loops 6 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantEvaluator.handleConstructorInvocation (cognitive 58) · ×1
  • ConstantEvaluator.handleConstructorInvocation (cognitive 58) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3735 — ConstantEvaluator.handleConstructorInvocation has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (48 pts), loops 6, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsInteropChecks.visitProcedure (cognitive 57) · ×1
  • JsInteropChecks.visitProcedure (cognitive 57) pkg/_js_interop_checks/lib/js_interop_checks.dart:312 — JsInteropChecks.visitProcedure has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 23 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BulkFixProcessor._fixSingleDiagnostic (cognitive 57) · ×1
  • BulkFixProcessor._fixSingleDiagnostic (cognitive 57) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:752 — BulkFixProcessor._fixSingleDiagnostic has cognitive complexity 57 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 4 (18 pts), ternaries 1 (6 pts), error handling 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterConvertToStatelessWidget.compute (cognitive 57) · ×1
  • FlutterConvertToStatelessWidget.compute (cognitive 57) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:32 — FlutterConvertToStatelessWidget.compute has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 7, loops 4 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InheritanceManager3._getInterfaceClass (cognitive 57) · ×1
  • InheritanceManager3._getInterfaceClass (cognitive 57) pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart:638 — InheritanceManager3._getInterfaceClass has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 7 (14 pts), ternaries 2 (10 pts), boolean chains 4 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryManifestBuilder._buildManifests (cognitive 57) · ×1
  • LibraryManifestBuilder._buildManifests (cognitive 57) pkg/analyzer/lib/src/fine/library_manifest.dart:874 — LibraryManifestBuilder._buildManifests has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 13 (26 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSelection._followingSameFaultInstruction (cognitive 57) · ×1
  • SsaInstructionSelection._followingSameFaultInstruction (cognitive 57) pkg/compiler/lib/src/ssa/codegen_helpers.dart:106 — SsaInstructionSelection._followingSameFaultInstruction has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (49 pts), ternaries 1 (5 pts), boolean chains 2, loops 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RunCommand._runLocal (cognitive 57) · ×1
  • RunCommand._runLocal (cognitive 57) pkg/dartdev/lib/src/commands/run.dart:537 — RunCommand._runLocal has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 8, match/switch 1 (4 pts), error handling 2, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitStaticInvocation (cognitive 57) · ×1
  • ConstantEvaluator.visitStaticInvocation (cognitive 57) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5181 — ConstantEvaluator.visitStaticInvocation has cognitive complexity 57 (threshold 15). Drivers by points: if/else 29 (52 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CfeTypeOperations.getPropertyTypes (cognitive 57) · ×1
  • CfeTypeOperations.getPropertyTypes (cognitive 57) pkg/front_end/lib/src/kernel/exhaustiveness.dart:126 — CfeTypeOperations.getPropertyTypes has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 7 (16 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · minimize.minimize (cognitive 57) · ×1
  • minimize.minimize (cognitive 57) runtime/tools/dartfuzz/minimize.py:198 — minimize.minimize has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (46 pts), boolean chains 10, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Primitives._generalApplyFunction (cognitive 56) · ×1
  • Primitives._generalApplyFunction (cognitive 56) sdk/lib/_internal/js_runtime/lib/js_helper.dart:1097 — Primitives._generalApplyFunction has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (47 pts), loops 2 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BigIntImpl.modPow (cognitive 56) · ×1
  • _BigIntImpl.modPow (cognitive 56) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1939 — _BigIntImpl.modPow has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 8 (17 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddNullCheck.compute (cognitive 56) · ×1
  • AddNullCheck.compute (cognitive 56) pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart:79 — AddNullCheck.compute has cognitive complexity 56 (threshold 15). Drivers by points: if/else 27 (32 pts), boolean chains 21, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MemorySet.intersectionFor (cognitive 56) · ×1
  • MemorySet.intersectionFor (cognitive 56) pkg/compiler/lib/src/ssa/optimize.dart:5093 — MemorySet.intersectionFor has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (53 pts), loops 2 (3 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassHierarchyNodeBuilder.build (cognitive 56) · ×1
  • ClassHierarchyNodeBuilder.build (cognitive 56) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:121 — ClassHierarchyNodeBuilder.build has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 4 (18 pts), ternaries 1 (4 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Translator.translateStorageType (cognitive 55) · ×1
  • Translator.translateStorageType (cognitive 55) pkg/dart2wasm/lib/translator.dart:1059 — Translator.translateStorageType has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (41 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseArgumentOrIndexStar (cognitive 55) · ×1
  • Parser.parseArgumentOrIndexStar (cognitive 55) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8012 — Parser.parseArgumentOrIndexStar has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (51 pts), boolean chains 3, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AddDigitSeparators.compute (cognitive 55) · ×1
  • _AddDigitSeparators.compute (cognitive 55) pkg/analysis_server/lib/src/services/correction/dart/add_digit_separators.dart:67 — _AddDigitSeparators.compute has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (46 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementMatcher.matches (cognitive 55) · ×1
  • ElementMatcher.matches (cognitive 55) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:53 — ElementMatcher.matches has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 6 (17 pts), boolean chains 3 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExtractLocalRefactoringImpl._checkSelection (cognitive 55) · ×1
  • ExtractLocalRefactoringImpl._checkSelection (cognitive 55) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart:269 — ExtractLocalRefactoringImpl._checkSelection has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 14, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeastUpperBoundHelper._functionType (cognitive 55) · ×1
  • LeastUpperBoundHelper._functionType (cognitive 55) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:674 — LeastUpperBoundHelper._functionType has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (44 pts), ternaries 1 (5 pts), boolean chains 3, loops 3 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkForAllMixinErrorCodes (cognitive 55) · ×1
  • ErrorVerifier._checkForAllMixinErrorCodes (cognitive 55) pkg/analyzer/lib/src/generated/error_verifier.dart:2852 — ErrorVerifier._checkForAllMixinErrorCodes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (49 pts), boolean chains 5, loops 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CompletionTarget.computeReplacementRange (cognitive 55) · ×1
  • CompletionTarget.computeReplacementRange (cognitive 55) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:487 — CompletionTarget.computeReplacementRange has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 8, loops 2 (8 pts), ternaries 2 (4 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NativeEmitter.prepareNativeClasses (cognitive 55) · ×1
  • NativeEmitter.prepareNativeClasses (cognitive 55) pkg/compiler/lib/src/js_emitter/native_emitter.dart:41 — NativeEmitter.prepareNativeClasses has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 10, loops 4 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.getInvalidJsInteropTypeTest (cognitive 55) · ×1
  • _Visitor.getInvalidJsInteropTypeTest (cognitive 55) pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:324 — _Visitor.getInvalidJsInteropTypeTest has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 15, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _FlowAnalysisImpl._getNonPromotionReasons (cognitive 54) · ×1
  • _FlowAnalysisImpl._getNonPromotionReasons (cognitive 54) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:8852 — _FlowAnalysisImpl._getNonPromotionReasons has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (20 pts), ternaries 2 (9 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.tokenizeFractionPart (cognitive 54) · ×1
  • AbstractScanner.tokenizeFractionPart (cognitive 54) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1693 — AbstractScanner.tokenizeFractionPart has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 7, loops 3 (7 pts), ternaries 2 (7 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InScopeCompletionPass.visitClassDeclaration (cognitive 54) · ×1
  • InScopeCompletionPass.visitClassDeclaration (cognitive 54) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:652 — InScopeCompletionPass.visitClassDeclaration has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InScopeCompletionPass.visitSwitchPatternCase (cognitive 54) · ×1
  • InScopeCompletionPass.visitSwitchPatternCase (cognitive 54) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:3154 — InScopeCompletionPass.visitSwitchPatternCase has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FixProcessor._addFromProducers (cognitive 54) · ×1
  • FixProcessor._addFromProducers (cognitive 54) pkg/analysis_server_plugin/lib/src/correction/fix_processor.dart:132 — FixProcessor._addFromProducers has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (30 pts), ternaries 4 (13 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.resolveArgumentsToParameters (cognitive 54) · ×1
  • TypeAnalyzer.resolveArgumentsToParameters (cognitive 54) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5826 — TypeAnalyzer.resolveArgumentsToParameters has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (36 pts), ternaries 3 (10 pts), boolean chains 5, loops 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaPhiConditioning.handlePhi (cognitive 54) · ×1
  • SsaPhiConditioning.handlePhi (cognitive 54) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1485 — SsaPhiConditioning.handlePhi has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 7 (15 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodegenWorldBuilder._getMemberUsage (cognitive 54) · ×1
  • CodegenWorldBuilder._getMemberUsage (cognitive 54) pkg/compiler/lib/src/universe/codegen_world_builder.dart:495 — CodegenWorldBuilder._getMemberUsage has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (47 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BodyBuilderImpl.endSwitchCase (cognitive 54) · ×1
  • BodyBuilderImpl.endSwitchCase (cognitive 54) pkg/front_end/lib/src/kernel/body_builder.dart:5447 — BodyBuilderImpl.endSwitchCase has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 6 (14 pts), boolean chains 9 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._tryFixingMethodInvocation (cognitive 53) · ×1
  • _Visitor._tryFixingMethodInvocation (cognitive 53) pkg/analyzer_utilities/tool/messages/use_literate_api_in_analyzer.dart:211 — _Visitor._tryFixingMethodInvocation has cognitive complexity 53 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · int._parseRadix (cognitive 53) · ×1
  • int._parseRadix (cognitive 53) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:157 — int._parseRadix has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (36 pts), ternaries 3 (8 pts), boolean chains 5, loops 4 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Utf8Decoder.decodeGeneral (cognitive 53) · ×1
  • _Utf8Decoder.decodeGeneral (cognitive 53) sdk/lib/convert/utf.dart:575 — _Utf8Decoder.decodeGeneral has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 4 (10 pts), match/switch 1 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseLiteralSetOrMapSuffix (cognitive 53) · ×1
  • Parser.parseLiteralSetOrMapSuffix (cognitive 53) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8574 — Parser.parseLiteralSetOrMapSuffix has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (45 pts), loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResultMerger.mergeNavigation (cognitive 53) · ×1
  • ResultMerger.mergeNavigation (cognitive 53) pkg/analysis_server/lib/src/plugin/result_merger.dart:198 — ResultMerger.mergeNavigation has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 7 (13 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertNullCheckToNullAwareElementOrEntry.compute (cognitive 53) · ×1
  • ConvertNullCheckToNullAwareElementOrEntry.compute (cognitive 53) pkg/analysis_server/lib/src/services/correction/dart/convert_null_check_to_null_aware_element_or_entry.dart:29 — ConvertNullCheckToNullAwareElementOrEntry.compute has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (35 pts), ternaries 3 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InlineTypedef.compute (cognitive 53) · ×1
  • InlineTypedef.compute (cognitive 53) pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart:32 — InlineTypedef.compute has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (49 pts), boolean chains 3, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodInvocationResolver.resolveUnqualified (cognitive 53) · ×1
  • MethodInvocationResolver.resolveUnqualified (cognitive 53) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:215 — MethodInvocationResolver.resolveUnqualified has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 17, ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DillLibraryBuilder.ensureLoaded (cognitive 53) · ×1
  • DillLibraryBuilder.ensureLoaded (cognitive 53) pkg/front_end/lib/src/dill/dill_library_builder.dart:182 — DillLibraryBuilder.ensureLoaded has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 8, loops 7, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitRecordLiteral (cognitive 53) · ×1
  • InferenceVisitorImpl.visitRecordLiteral (cognitive 53) pkg/front_end/lib/src/type_inference/inference_visitor.dart:11098 — InferenceVisitorImpl.visitRecordLiteral has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 5 (10 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstanceViewElement._createMembers (cognitive 53) · ×1
  • InstanceViewElement._createMembers (cognitive 53) pkg/observatory/lib/src/elements/instance_view.dart:220 — InstanceViewElement._createMembers has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (39 pts), ternaries 4 (8 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Base64Codec.normalize (cognitive 52) · ×1
  • Base64Codec.normalize (cognitive 52) sdk/lib/convert/base64.dart:85 — Base64Codec.normalize has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner._spacesAtStartOfLogicalLineOf (cognitive 52) · ×1
  • AbstractScanner._spacesAtStartOfLogicalLineOf (cognitive 52) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:403 — AbstractScanner._spacesAtStartOfLogicalLineOf has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 11, loops 2 (4 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Features.getText (cognitive 52) · ×1
  • Features.getText (cognitive 52) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:80 — Features.getText has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (48 pts), loops 2 (4 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Features.fromText (cognitive 52) · ×1
  • Features.fromText (cognitive 52) pkg/_fe_analyzer_shared/lib/src/testing/features.dart:155 — Features.fromText has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartUnitHoverComputer.compute (cognitive 52) · ×1
  • DartUnitHoverComputer.compute (cognitive 52) pkg/analysis_server/lib/src/computer/computer_hover.dart:31 — DartUnitHoverComputer.compute has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 25, if/else 11 (24 pts), loops 1 (3 pts) (nesting depth added 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.
D2 · Cognitive Complexity · _MinimalEditComputer.computeMinimalEdits (cognitive 52) · ×1
  • _MinimalEditComputer.computeMinimalEdits (cognitive 52) pkg/analysis_server/lib/src/lsp/source_edits.dart:297 — _MinimalEditComputer.computeMinimalEdits has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToNamedArguments.compute (cognitive 52) · ×1
  • ConvertToNamedArguments.compute (cognitive 52) pkg/analysis_server/lib/src/services/correction/dart/convert_to_named_arguments.dart:25 — ConvertToNamedArguments.compute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RemoveUnusedParameter.compute (cognitive 52) · ×1
  • RemoveUnusedParameter.compute (cognitive 52) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_parameter.dart:27 — RemoveUnusedParameter.compute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 25 (44 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementUsageDetector.checkUsage (cognitive 52) · ×1
  • ElementUsageDetector.checkUsage (cognitive 52) pkg/analyzer/lib/src/error/element_usage_detector.dart:73 — ElementUsageDetector.checkUsage has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Finder._visit (cognitive 52) · ×1
  • _Finder._visit (cognitive 52) pkg/analyzer/lib/src/summary2/type_alias.dart:83 — _Finder._visit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 1 (2 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResolutionWorldBuilder._processMemberInUsedClass (cognitive 52) · ×1
  • ResolutionWorldBuilder._processMemberInUsedClass (cognitive 52) pkg/compiler/lib/src/universe/resolution_world_builder.dart:886 — ResolutionWorldBuilder._processMemberInUsedClass has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (45 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.tokenizeFractionPart (cognitive 51) · ×1
  • AbstractScanner.tokenizeFractionPart (cognitive 51) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:1095 — AbstractScanner.tokenizeFractionPart has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Configuration.parse (cognitive 51) · ×1
  • Configuration.parse (cognitive 51) pkg/smith/lib/configuration.dart:107 — Configuration.parse has cognitive complexity 51 (threshold 15). Drivers by points: if/else 35 (43 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _Utf8Decoder._convertChunkInternal (cognitive 51) · ×1
  • _Utf8Decoder._convertChunkInternal (cognitive 51) sdk/lib/_internal/wasm/common/convert_patch.dart:2415 — _Utf8Decoder._convertChunkInternal has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (31 pts), ternaries 4 (13 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitBinaryIntOp (cognitive 51) · ×1
  • Arm64CodeGenerator.visitBinaryIntOp (cognitive 51) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2731 — Arm64CodeGenerator.visitBinaryIntOp has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (35 pts), match/switch 5 (12 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Stdin.readLineSync (cognitive 51) · ×1
  • Stdin.readLineSync (cognitive 51) sdk/lib/io/stdio.dart:46 — Stdin.readLineSync has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 4 (10 pts), boolean chains 5 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColorComputer._getDartUiColor (cognitive 51) · ×1
  • ColorComputer._getDartUiColor (cognitive 51) pkg/analysis_server/lib/src/computer/computer_color.dart:269 — ColorComputer._getDartUiColor has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 15 (32 pts), boolean chains 9, if/else 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterOutlineComputer._createOutline (cognitive 51) · ×1
  • FlutterOutlineComputer._createOutline (cognitive 51) pkg/analysis_server/lib/src/flutter/flutter_outline_computer.dart:137 — FlutterOutlineComputer._createOutline has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (41 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToFunctionDeclaration.compute (cognitive 51) · ×1
  • ConvertToFunctionDeclaration.compute (cognitive 51) pkg/analysis_server/lib/src/services/correction/dart/convert_to_function_declaration.dart:30 — ConvertToFunctionDeclaration.compute has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (47 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisDriver._produceErrors (cognitive 51) · ×1
  • AnalysisDriver._produceErrors (cognitive 51) pkg/analyzer/lib/src/dart/analysis/driver.dart:2153 — AnalysisDriver._produceErrors has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 5 (17 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores (cognitive 51) · ×1
  • IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores (cognitive 51) pkg/analyzer/lib/src/error/ignore_validator.dart:198 — IgnoreValidator._reportUnnecessaryOrRemovedOrDeprecatedIgnores has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (39 pts), ternaries 2 (8 pts), loops 2 (4 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReturnTypeVerifier._checkReturnExpression (cognitive 51) · ×1
  • ReturnTypeVerifier._checkReturnExpression (cognitive 51) pkg/analyzer/lib/src/error/return_type_verifier.dart:122 — ReturnTypeVerifier._checkReturnExpression has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 4 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForConflictingInitializerErrorCodes (cognitive 51) · ×1
  • ErrorVerifier._checkForConflictingInitializerErrorCodes (cognitive 51) pkg/analyzer/lib/src/generated/error_verifier.dart:4257 — ErrorVerifier._checkForConflictingInitializerErrorCodes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (45 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Linker._computeRedirectingConstructorCycles (cognitive 51) · ×1
  • Linker._computeRedirectingConstructorCycles (cognitive 51) pkg/analyzer/lib/src/summary2/link.dart:342 — Linker._computeRedirectingConstructorCycles has cognitive complexity 51 (threshold 15). Drivers by points: if/else 6 (32 pts), loops 5 (18 pts), boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassHierarchyImpl.commonSubclasses (cognitive 51) · ×1
  • ClassHierarchyImpl.commonSubclasses (cognitive 51) pkg/compiler/lib/src/universe/class_hierarchy.dart:449 — ClassHierarchyImpl.commonSubclasses has cognitive complexity 51 (threshold 15). Drivers by points: if/else 27 (47 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLibraryBuilder.computeFieldPromotability (cognitive 51) · ×1
  • SourceLibraryBuilder.computeFieldPromotability (cognitive 51) pkg/front_end/lib/src/source/source_library_builder.dart:826 — SourceLibraryBuilder.computeFieldPromotability has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 6 (9 pts), ternaries 2 (8 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceTypeAliasBuilder.buildTypedefTearOffs (cognitive 51) · ×1
  • SourceTypeAliasBuilder.buildTypedefTearOffs (cognitive 51) pkg/front_end/lib/src/source/source_type_alias_builder.dart:467 — SourceTypeAliasBuilder.buildTypedefTearOffs has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (37 pts), boolean chains 7, loops 2 (6 pts), match/switch 1 (nesting depth added 32). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InferenceVisitorBase.inferLocalFunction (cognitive 51) · ×1
  • InferenceVisitorBase.inferLocalFunction (cognitive 51) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2225 — InferenceVisitorBase.inferLocalFunction has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 10 (14 pts), boolean chains 7 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiDefinitionTransformer._findFields (cognitive 50) · ×1
  • _FfiDefinitionTransformer._findFields (cognitive 50) pkg/vm/lib/modular/transformations/ffi/definitions.dart:705 — _FfiDefinitionTransformer._findFields has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parseTypedef (cognitive 50) · ×1
  • Parser.parseTypedef (cognitive 50) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:1449 — Parser.parseTypedef has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 8 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ComplexTypeInfo.computeRecordType (cognitive 50) · ×1
  • ComplexTypeInfo.computeRecordType (cognitive 50) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:759 — ComplexTypeInfo.computeRecordType has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 28, if/else 12 (22 pts) (nesting depth added 10). 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.
D2 · Cognitive Complexity · TypeConstraintGenerator._handleNonGenericFunctionTypes (cognitive 50) · ×1
  • TypeConstraintGenerator._handleNonGenericFunctionTypes (cognitive 50) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:2571 — TypeConstraintGenerator._handleNonGenericFunctionTypes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SymlinksPerformanceComponent.render (cognitive 50) · ×1
  • _SymlinksPerformanceComponent.render (cognitive 50) pkg/analysis_server/lib/src/status/pages/performance_page.dart:592 — _SymlinksPerformanceComponent.render has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 8 (19 pts), loops 2 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseResultVerifier._isUsed (cognitive 50) · ×1
  • UseResultVerifier._isUsed (cognitive 50) pkg/analyzer/lib/src/error/use_result_verifier.dart:140 — UseResultVerifier._isUsed has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 45, if/else 5. 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.
D2 · Cognitive Complexity · ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary (cognitive 50) · ×1
  • ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary (cognitive 50) pkg/analyzer/lib/src/generated/error_verifier.dart:5598 — ErrorVerifier._checkForFinalSupertypeOutsideOfLibrary has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 13, loops 3 (8 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProtocolConverter.convertVmInstanceToVariablesList (cognitive 50) · ×1
  • ProtocolConverter.convertVmInstanceToVariablesList (cognitive 50) pkg/dap_adapters/lib/src/protocol_converter.dart:128 — ProtocolConverter.convertVmInstanceToVariablesList has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 7 (16 pts), boolean chains 15, error handling 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._defineClass (cognitive 50) · ×1
  • LibraryCompiler._defineClass (cognitive 50) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1792 — LibraryCompiler._defineClass has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 5 (11 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordTypeBuilderImpl.buildAliased (cognitive 50) · ×1
  • RecordTypeBuilderImpl.buildAliased (cognitive 50) pkg/front_end/lib/src/builder/record_type_builder.dart:118 — RecordTypeBuilderImpl.buildAliased has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase._findExtensionMember (cognitive 50) · ×1
  • InferenceVisitorBase._findExtensionMember (cognitive 50) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1184 — InferenceVisitorBase._findExtensionMember has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (41 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Transform.transformMemberSignature (cognitive 50) · ×1
  • _Transform.transformMemberSignature (cognitive 50) pkg/vm/lib/transformations/type_flow/signature_shaking.dart:405 — _Transform.transformMemberSignature has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (44 pts), loops 4, boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WebSocketOutgoingTransformer.createFrame (cognitive 49) · ×1
  • _WebSocketOutgoingTransformer.createFrame (cognitive 49) sdk/lib/_http/websocket_impl.dart:1107 — _WebSocketOutgoingTransformer.createFrame has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 5 (17 pts), ternaries 3, boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Future.wait (cognitive 49) · ×1
  • Future.wait (cognitive 49) sdk/lib/async/future.dart:475 — Future.wait has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 3 (10 pts), boolean chains 5, error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Algorithm._filterUserConstraints (cognitive 49) · ×1
  • _Algorithm._filterUserConstraints (cognitive 49) pkg/dart2wasm/lib/deferred_load/partition.dart:318 — _Algorithm._filterUserConstraints has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseArgumentsRest (cognitive 49) · ×1
  • Parser.parseArgumentsRest (cognitive 49) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9538 — Parser.parseArgumentsRest has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractScanner.bigSwitch (cognitive 49) · ×1
  • AbstractScanner.bigSwitch (cognitive 49) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091 — AbstractScanner.bigSwitch has cognitive complexity 49 (threshold 15). Drivers by points: if/else 39 (41 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SharedInteropTransformer._createIsACheck (cognitive 49) · ×1
  • SharedInteropTransformer._createIsACheck (cognitive 49) pkg/_js_interop_checks/lib/src/transformations/shared_interop_transformer.dart:728 — SharedInteropTransformer._createIsACheck has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 12 (20 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginWatcher._addPlugins (cognitive 49) · ×1
  • PluginWatcher._addPlugins (cognitive 49) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:180 — PluginWatcher._addPlugins has cognitive complexity 49 (threshold 15). Drivers by points: loops 9 (24 pts), if/else 8 (21 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 29). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · InScopeCompletionPass.visitExpressionStatement (cognitive 49) · ×1
  • InScopeCompletionPass.visitExpressionStatement (cognitive 49) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1168 — InScopeCompletionPass.visitExpressionStatement has cognitive complexity 49 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier._validateSwitchExhaustiveness (cognitive 49) · ×1
  • ConstantVerifier._validateSwitchExhaustiveness (cognitive 49) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1073 — ConstantVerifier._validateSwitchExhaustiveness has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 2 (10 pts), loops 4 (7 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _IRInterpreter.run (cognitive 49) · ×1
  • _IRInterpreter.run (cognitive 49) pkg/analyzer/lib/src/wolf/ir/interpreter.dart:260 — _IRInterpreter.run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 4 (10 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaAssignmentChaining.tryChainAssignment (cognitive 49) · ×1
  • SsaAssignmentChaining.tryChainAssignment (cognitive 49) pkg/compiler/lib/src/ssa/codegen_helpers.dart:687 — SsaAssignmentChaining.tryChainAssignment has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 10, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetupFlutterCommand.run (cognitive 49) · ×1
  • SetupFlutterCommand.run (cognitive 49) pkg/dartpad/lib/src/setup/flutter.dart:81 — SetupFlutterCommand.run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 4 (9 pts), boolean chains 4, error handling 1 (4 pts), match/switch 3, loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitBinaryOperator (cognitive 49) · ×1
  • ProgramCompiler._emitBinaryOperator (cognitive 49) pkg/dev_compiler/lib/src/kernel/compiler.dart:6338 — ProgramCompiler._emitBinaryOperator has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (29 pts), ternaries 3 (12 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitBinaryOperator (cognitive 49) · ×1
  • LibraryCompiler._emitBinaryOperator (cognitive 49) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7027 — LibraryCompiler._emitBinaryOperator has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (29 pts), ternaries 3 (12 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryVirtualFieldModel.build (cognitive 49) · ×1
  • _LibraryVirtualFieldModel.build (cognitive 49) pkg/dev_compiler/lib/src/kernel/property_model.dart:61 — _LibraryVirtualFieldModel.build has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 10, loops 5 (7 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CodeGenerator.extractIdl (cognitive 48) · ×1
  • _CodeGenerator.extractIdl (cognitive 48) pkg/analyzer/tool/summary/generate.dart:583 — _CodeGenerator.extractIdl has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 4 (10 pts), boolean chains 7 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BytecodeGenerator._genPrologue (cognitive 48) · ×1
  • BytecodeGenerator._genPrologue (cognitive 48) pkg/dart2bytecode/lib/bytecode_generator.dart:2157 — BytecodeGenerator._genPrologue has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 4 (10 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder._decodeGeneral (cognitive 48) · ×1
  • _Utf8Decoder._decodeGeneral (cognitive 48) sdk/lib/_internal/wasm/common/convert_patch.dart:2742 — _Utf8Decoder._decodeGeneral has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 4 (9 pts), match/switch 1 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.parseIPv6Address (cognitive 48) · ×1
  • Uri.parseIPv6Address (cognitive 48) sdk/lib/core/uri.dart:1611 — Uri.parseIPv6Address has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (45 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parseStatementX (cognitive 48) · ×1
  • Parser.parseStatementX (cognitive 48) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6728 — Parser.parseStatementX has cognitive complexity 48 (threshold 15). Drivers by points: if/else 31 (42 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor.compute (cognitive 48) · ×1
  • StatementCompletionProcessor.compute (cognitive 48) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:169 — StatementCompletionProcessor.compute has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 17, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FullInvocationInferrer.resolveInvocation (cognitive 48) · ×1
  • FullInvocationInferrer.resolveInvocation (cognitive 48) pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart:267 — FullInvocationInferrer.resolveInvocation has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 6, loops 2 (6 pts), ternaries 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder.build (cognitive 48) · ×1
  • KernelSsaGraphBuilder.build (cognitive 48) pkg/compiler/lib/src/ssa/builder.dart:461 — KernelSsaGraphBuilder.build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 5, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaConditionMerger.visitBasicBlock (cognitive 48) · ×1
  • SsaConditionMerger.visitBasicBlock (cognitive 48) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1303 — SsaConditionMerger.visitBasicBlock has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 4, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler.updateNeededDillLibrariesWithHierarchy (cognitive 48) · ×1
  • IncrementalCompiler.updateNeededDillLibrariesWithHierarchy (cognitive 48) pkg/front_end/lib/src/base/incremental_compiler.dart:1632 — IncrementalCompiler.updateNeededDillLibrariesWithHierarchy has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NameSection.deserialize (cognitive 48) · ×1
  • NameSection.deserialize (cognitive 48) pkg/wasm_builder/lib/src/serialize/sections.dart:1044 — NameSection.deserialize has cognitive complexity 48 (threshold 15). Drivers by points: loops 9 (31 pts), if/else 6 (15 pts), match/switch 1 (2 pts) (nesting depth added 32). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WidgetCreatorTracker._resolveWellKnownClasses (cognitive 48) · ×1
  • WidgetCreatorTracker._resolveWellKnownClasses (cognitive 48) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:397 — WidgetCreatorTracker._resolveWellKnownClasses has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (13 pts), boolean chains 5 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PRESUBMIT._CheckPackagePublish (cognitive 48) · ×1
  • PRESUBMIT._CheckPackagePublish (cognitive 48) PRESUBMIT.py:693 — PRESUBMIT._CheckPackagePublish has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 6, ternaries 1 (4 pts), loops 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionResolveHandler.resolveDartCompletion (cognitive 47) · ×1
  • CompletionResolveHandler.resolveDartCompletion (cognitive 47) pkg/analysis_server/lib/src/lsp/handlers/handler_completion_resolve.dart:59 — CompletionResolveHandler.resolveDartCompletion has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (27 pts), ternaries 2 (7 pts), boolean chains 6, loops 2 (5 pts), error handling 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.visitAnonymousMethodInvocation (cognitive 47) · ×1
  • TypeAnalyzer.visitAnonymousMethodInvocation (cognitive 47) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:1913 — TypeAnalyzer.visitAnonymousMethodInvocation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 3 (8 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NativeBehavior.processSpecString (cognitive 47) · ×1
  • NativeBehavior.processSpecString (cognitive 47) pkg/compiler/lib/src/native/behavior.dart:221 — NativeBehavior.processSpecString has cognitive complexity 47 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 4, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompileWasmCommand.run (cognitive 47) · ×1
  • CompileWasmCommand.run (cognitive 47) pkg/dartdev/lib/src/commands/compile.dart:949 — CompileWasmCommand.run has cognitive complexity 47 (threshold 15). Drivers by points: if/else 30 (37 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IncrementalCompiler._computeTransitiveClosure (cognitive 47) · ×1
  • IncrementalCompiler._computeTransitiveClosure (cognitive 47) pkg/front_end/lib/src/base/incremental_compiler.dart:1800 — IncrementalCompiler._computeTransitiveClosure has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 8 (15 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InitializationFromExperimentalCache.loadLibrariesFromCache (cognitive 47) · ×1
  • _InitializationFromExperimentalCache.loadLibrariesFromCache (cognitive 47) pkg/front_end/lib/src/base/incremental_compiler.dart:3690 — _InitializationFromExperimentalCache.loadLibrariesFromCache has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 7 (16 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChainContext.run (cognitive 47) · ×1
  • ChainContext.run (cognitive 47) pkg/testing/lib/src/chain.dart:149 — ChainContext.run has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 9, loops 3 (5 pts), error handling 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSNumber._binaryGcd (cognitive 46) · ×1
  • JSNumber._binaryGcd (cognitive 46) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:533 — JSNumber._binaryGcd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSInt._binaryGcd (cognitive 46) · ×1
  • JSInt._binaryGcd (cognitive 46) sdk/lib/_internal/js_runtime/lib/js_number.dart:624 — JSInt._binaryGcd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _IntegerImplementation._binaryGcd (cognitive 46) · ×1
  • _IntegerImplementation._binaryGcd (cognitive 46) sdk/lib/_internal/vm/lib/integers.dart:444 — _IntegerImplementation._binaryGcd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BoxedInt._binaryGcd (cognitive 46) · ×1
  • BoxedInt._binaryGcd (cognitive 46) sdk/lib/_internal/wasm/common/boxed_int.dart:338 — BoxedInt._binaryGcd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parse (cognitive 46) · ×1
  • _ChunkedJsonParser.parse (cognitive 46) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:772 — _ChunkedJsonParser.parse has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (43 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstToIr._translateConstructorInitializers (cognitive 46) · ×1
  • AstToIr._translateConstructorInitializers (cognitive 46) pkg/cfg/lib/front_end/ast_to_ir.dart:366 — AstToIr._translateConstructorInitializers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (43 pts), loops 2 (3 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DeclarationHelper._addStaticMembers (cognitive 46) · ×1
  • DeclarationHelper._addStaticMembers (cognitive 46) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1638 — DeclarationHelper._addStaticMembers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 18, loops 5 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddAsync.compute (cognitive 46) · ×1
  • AddAsync.compute (cognitive 46) pkg/analysis_server/lib/src/services/correction/dart/add_async.dart:35 — AddAsync.compute has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AddMissingRequiredArgument.compute (cognitive 46) · ×1
  • AddMissingRequiredArgument.compute (cognitive 46) pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart:48 — AddMissingRequiredArgument.compute has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (39 pts), boolean chains 6, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReferenceProcessor._process (cognitive 46) · ×1
  • _ReferenceProcessor._process (cognitive 46) pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart:980 — _ReferenceProcessor._process has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (45 pts), boolean chains 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ConstLiteralVerifier.verify (cognitive 46) · ×1
  • _ConstLiteralVerifier.verify (cognitive 46) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1301 — _ConstLiteralVerifier.verify has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseOrFinalTypeVerifier._reportRestrictionError (cognitive 46) · ×1
  • BaseOrFinalTypeVerifier._reportRestrictionError (cognitive 46) pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart:174 — BaseOrFinalTypeVerifier._reportRestrictionError has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 5 (15 pts), boolean chains 11 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultTypesBuilder._findRawTypePathsToDeclaration (cognitive 46) · ×1
  • DefaultTypesBuilder._findRawTypePathsToDeclaration (cognitive 46) pkg/analyzer/lib/src/summary2/default_types_builder.dart:203 — DefaultTypesBuilder._findRawTypePathsToDeclaration has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 5 (18 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DillClassBuilder.DillClassBuilder (cognitive 46) · ×1
  • DillClassBuilder.DillClassBuilder (cognitive 46) pkg/front_end/lib/src/dill/dill_class_builder.dart:40 — DillClassBuilder.DillClassBuilder has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 4, loops 4, match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartScopeBuilder2._looksLikeLateLoweredField (cognitive 46) · ×1
  • DartScopeBuilder2._looksLikeLateLoweredField (cognitive 46) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:889 — DartScopeBuilder2._looksLikeLateLoweredField has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 23, if/else 7 (15 pts), loops 3 (8 pts) (nesting depth added 13). 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.
D2 · Cognitive Complexity · _Overrides.collectOverrides (cognitive 46) · ×1
  • _Overrides.collectOverrides (cognitive 46) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:2913 — _Overrides.collectOverrides has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (10 pts), boolean chains 3 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OutlineBuilder.endMethod (cognitive 46) · ×1
  • OutlineBuilder.endMethod (cognitive 46) pkg/front_end/lib/src/source/outline_builder.dart:2371 — OutlineBuilder.endMethod has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 4, loops 1 (4 pts), match/switch 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._visitVariableDeclarationList (cognitive 46) · ×1
  • _Visitor._visitVariableDeclarationList (cognitive 46) pkg/linter/lib/src/rules/specify_nonobvious_property_types.dart:59 — _Visitor._visitVariableDeclarationList has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 3 (9 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VarianceChecker.check (cognitive 46) · ×1
  • VarianceChecker.check (cognitive 46) pkg/linter/lib/src/util/variance_checker.dart:37 — VarianceChecker.check has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 5 (15 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Class.test (cognitive 45) · ×1
  • Class.test (cognitive 45) pkg/front_end/testcases/general/for_in.dart:295 — Class.test has cognitive complexity 45 (threshold 15). Drivers by points: loops 45. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AstToIr._buildPrologue (cognitive 45) · ×1
  • AstToIr._buildPrologue (cognitive 45) pkg/cfg/lib/front_end/ast_to_ir.dart:143 — AstToIr._buildPrologue has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeeplyImmutableValidator._validateDeeplyImmutable (cognitive 45) · ×1
  • DeeplyImmutableValidator._validateDeeplyImmutable (cognitive 45) pkg/vm/lib/modular/transformations/deeply_immutable.dart:129 — DeeplyImmutableValidator._validateDeeplyImmutable has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 12, loops 4 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexTypeParamOrArgInfo.parseUnexpectedEnd (cognitive 45) · ×1
  • ComplexTypeParamOrArgInfo.parseUnexpectedEnd (cognitive 45) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1613 — ComplexTypeParamOrArgInfo.parseUnexpectedEnd has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 9, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckNameResponse.computeRenameRanges2 (cognitive 45) · ×1
  • CheckNameResponse.computeRenameRanges2 (cognitive 45) pkg/analysis_server/lib/src/cider/rename.dart:125 — CheckNameResponse.computeRenameRanges2 has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 5 (12 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._addExtensionMembers (cognitive 45) · ×1
  • DeclarationHelper._addExtensionMembers (cognitive 45) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:858 — DeclarationHelper._addExtensionMembers has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 4 (9 pts), boolean chains 3, ternaries 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveAsync.compute (cognitive 45) · ×1
  • RemoveAsync.compute (cognitive 45) pkg/analysis_server/lib/src/services/correction/dart/remove_async.dart:38 — RemoveAsync.compute has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 6, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GreatestLowerBoundHelper._functionType (cognitive 45) · ×1
  • GreatestLowerBoundHelper._functionType (cognitive 45) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:251 — GreatestLowerBoundHelper._functionType has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 2 (9 pts), boolean chains 4, loops 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DynamicCallSiteTypeInformation.handleIntrinsifiedSelector (cognitive 45) · ×1
  • DynamicCallSiteTypeInformation.handleIntrinsifiedSelector (cognitive 45) pkg/compiler/lib/src/inferrer/type_graph_nodes.dart:1321 — DynamicCallSiteTypeInformation.handleIntrinsifiedSelector has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 6, ternaries 2 (3 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicCallSiteTypeInformation.computeType (cognitive 45) · ×1
  • DynamicCallSiteTypeInformation.computeType (cognitive 45) pkg/compiler/lib/src/inferrer/type_graph_nodes.dart:1431 — DynamicCallSiteTypeInformation.computeType has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 5 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DillLibraryBuilder.finalizeExports (cognitive 45) · ×1
  • DillLibraryBuilder.finalizeExports (cognitive 45) pkg/front_end/lib/src/dill/dill_library_builder.dart:437 — DillLibraryBuilder.finalizeExports has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 11, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceClassBuilder.checkOverride (cognitive 45) · ×1
  • SourceClassBuilder.checkOverride (cognitive 45) pkg/front_end/lib/src/source/source_class_builder.dart:1438 — SourceClassBuilder.checkOverride has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 18 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardBounds._getLegacyLeastUpperBound (cognitive 45) · ×1
  • StandardBounds._getLegacyLeastUpperBound (cognitive 45) pkg/kernel/lib/src/standard_bounds.dart:978 — StandardBounds._getLegacyLeastUpperBound has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._check (cognitive 45) · ×1
  • _Visitor._check (cognitive 45) pkg/linter/lib/src/rules/prefer_is_empty.dart:66 — _Visitor._check has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 11 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.bigSwitch (cognitive 44) · ×1
  • AbstractScanner.bigSwitch (cognitive 44) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:429 — AbstractScanner.bigSwitch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MutationRunner._runChain (cognitive 44) · ×1
  • MutationRunner._runChain (cognitive 44) pkg/analyzer/tool/fine/ab_mutate.dart:250 — MutationRunner._runChain has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 8 (11 pts), ternaries 3 (9 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator.visitSwitchStatement (cognitive 44) · ×1
  • AstCodeGenerator.visitSwitchStatement (cognitive 44) pkg/dart2wasm/lib/code_generator.dart:1443 — AstCodeGenerator.visitSwitchStatement has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 9 (16 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantCreator._makeWasmArrayLiteral (cognitive 44) · ×1
  • ConstantCreator._makeWasmArrayLiteral (cognitive 44) pkg/dart2wasm/lib/constants.dart:1010 — ConstantCreator._makeWasmArrayLiteral has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 8 (20 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Analysis.transitiveGraph (cognitive 44) · ×1
  • Analysis.transitiveGraph (cognitive 44) pkg/heap_snapshot/lib/analysis.dart:259 — Analysis.transitiveGraph has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (32 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatusFile._parse (cognitive 44) · ×1
  • StatusFile._parse (cognitive 44) pkg/status_file/lib/canonical_status_file.dart:93 — StatusFile._parse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 7, error handling 2 (6 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiBinaryLoader.load (cognitive 44) · ×1
  • MultiBinaryLoader.load (cognitive 44) pkg/kernel/lib/binary/multi_binary_loader.dart:53 — MultiBinaryLoader.load has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 8 (13 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseDeclarationHeaderRecoveryInternal (cognitive 44) · ×1
  • Parser.parseDeclarationHeaderRecoveryInternal (cognitive 44) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3184 — Parser.parseDeclarationHeaderRecoveryInternal has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 3 (7 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseExtensionDeclaration (cognitive 44) · ×1
  • Parser.parseExtensionDeclaration (cognitive 44) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3653 — Parser.parseExtensionDeclaration has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticInteropMockValidator.validateCreateStaticInteropMock (cognitive 44) · ×1
  • StaticInteropMockValidator.validateCreateStaticInteropMock (cognitive 44) pkg/_js_interop_checks/lib/src/transformations/static_interop_mock_validator.dart:100 — StaticInteropMockValidator.validateCreateStaticInteropMock has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 3 (15 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResultMerger.mergeRefactoringFeedbacks (cognitive 44) · ×1
  • ResultMerger.mergeRefactoringFeedbacks (cognitive 44) pkg/analysis_server/lib/src/plugin/result_merger.dart:547 — ResultMerger.mergeRefactoringFeedbacks has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (12 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._visitStatements (cognitive 44) · ×1
  • DeclarationHelper._visitStatements (cognitive 44) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3129 — DeclarationHelper._visitStatements has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (39 pts), loops 2 (5 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _EnumDescription.applyChanges (cognitive 44) · ×1
  • _EnumDescription.applyChanges (cognitive 44) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:193 — _EnumDescription.applyChanges has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParsedPluginsData.parse (cognitive 44) · ×1
  • _ParsedPluginsData.parse (cognitive 44) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1510 — _ParsedPluginsData.parse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator.evaluate (cognitive 44) · ×1
  • _ConstructorInvocationEvaluator.evaluate (cognitive 44) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3562 — _ConstructorInvocationEvaluator.evaluate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 4 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodInvocationResolver._resolveInstanceInvocation (cognitive 44) · ×1
  • MethodInvocationResolver._resolveInstanceInvocation (cognitive 44) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:578 — MethodInvocationResolver._resolveInstanceInvocation has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 14, ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForMissingEnumConstantInSwitch (cognitive 44) · ×1
  • ErrorVerifier._checkForMissingEnumConstantInSwitch (cognitive 44) pkg/analyzer/lib/src/generated/error_verifier.dart:6238 — ErrorVerifier._checkForMissingEnumConstantInSwitch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FfiVerifier._checkFfiNativeFunction (cognitive 44) · ×1
  • FfiVerifier._checkFfiNativeFunction (cognitive 44) pkg/analyzer/lib/src/generated/ffi_verifier.dart:811 — FfiVerifier._checkFfiNativeFunction has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 9, match/switch 2 (5 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 44) · ×1
  • ListTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 44) pkg/compiler/lib/src/inferrer/list_tracer.dart:175 — ListTracerVisitor.visitDynamicCallSiteTypeInformation has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 5 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceFile.getLocationMessage (cognitive 44) · ×1
  • SourceFile.getLocationMessage (cognitive 44) pkg/compiler/lib/src/io/source_file.dart:97 — SourceFile.getLocationMessage has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (12 pts), boolean chains 2, error handling 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MiniJsParser.parseStatement (cognitive 44) · ×1
  • MiniJsParser.parseStatement (cognitive 44) pkg/dev_compiler/lib/src/js_ast/builder.dart:1421 — MiniJsParser.parseStatement has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompilerOptions.equivalent (cognitive 44) · ×1
  • CompilerOptions.equivalent (cognitive 44) pkg/front_end/lib/src/api_prototype/compiler_options.dart:257 — CompilerOptions.equivalent has cognitive complexity 44 (threshold 15). Drivers by points: if/else 35 (44 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ScriptInsetElement._refreshSourceReport (cognitive 44) · ×1
  • ScriptInsetElement._refreshSourceReport (cognitive 44) pkg/observatory/lib/src/elements/script_inset.dart:227 — ScriptInsetElement._refreshSourceReport has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Instructions.printTo (cognitive 44) · ×1
  • Instructions.printTo (cognitive 44) pkg/wasm_builder/lib/src/ir/instructions.dart:129 — Instructions.printTo has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 20, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DispatchableInvocation.process (cognitive 44) · ×1
  • _DispatchableInvocation.process (cognitive 44) pkg/vm/lib/transformations/type_flow/analysis.dart:518 — _DispatchableInvocation.process has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VmServiceInterfaceApi.generate (cognitive 43) · ×1
  • VmServiceInterfaceApi.generate (cognitive 43) pkg/vm_service/tool/dart/generate_dart_interface.dart:29 — VmServiceInterfaceApi.generate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 3 (7 pts), ternaries 1 (4 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Uri._makeHttpUri (cognitive 43) · ×1
  • _Uri._makeHttpUri (cognitive 43) sdk/lib/core/uri.dart:2053 — _Uri._makeHttpUri has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Evaluator._visitElement (cognitive 43) · ×1
  • Evaluator._visitElement (cognitive 43) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:552 — Evaluator._visitElement has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 7 (18 pts), ternaries 1 (3 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Parser.parseUnaryExpression (cognitive 43) · ×1
  • Parser.parseUnaryExpression (cognitive 43) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7889 — Parser.parseUnaryExpression has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DeclarationHelper._suggestStaticField (cognitive 43) · ×1
  • DeclarationHelper._suggestStaticField (cognitive 43) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2734 — DeclarationHelper._suggestStaticField has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (35 pts), boolean chains 8 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PropertyDescription._changeCode (cognitive 43) · ×1
  • PropertyDescription._changeCode (cognitive 43) pkg/analysis_server/lib/src/services/flutter/property.dart:177 — PropertyDescription._changeCode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantVerifier._reportError (cognitive 43) · ×1
  • ConstantVerifier._reportError (cognitive 43) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:775 — ConstantVerifier._reportError has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 40, if/else 3. 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.
D2 · Cognitive Complexity · TypeSystemImpl._refineNumericInvocationTypeNullSafe (cognitive 43) · ×1
  • TypeSystemImpl._refineNumericInvocationTypeNullSafe (cognitive 43) pkg/analyzer/lib/src/dart/element/type_system.dart:2050 — TypeSystemImpl._refineNumericInvocationTypeNullSafe has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 10 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _TodoFinder.moveNext (cognitive 43) · ×1
  • _TodoFinder.moveNext (cognitive 43) pkg/analyzer/lib/src/error/todo_finder.dart:163 — _TodoFinder.moveNext has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 18, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnusedLocalElementsVerifier._isUsedElement (cognitive 43) · ×1
  • UnusedLocalElementsVerifier._isUsedElement (cognitive 43) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:1141 — UnusedLocalElementsVerifier._isUsedElement has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 6 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkForConflictingClassMembers (cognitive 43) · ×1
  • ErrorVerifier._checkForConflictingClassMembers (cognitive 43) pkg/analyzer/lib/src/generated/error_verifier.dart:3858 — ErrorVerifier._checkForConflictingClassMembers has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForMixinClassErrorCodes (cognitive 43) · ×1
  • ErrorVerifier._checkForMixinClassErrorCodes (cognitive 43) pkg/analyzer/lib/src/generated/error_verifier.dart:6335 — ErrorVerifier._checkForMixinClassErrorCodes has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (38 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _OpTypeAstVisitor.visitArgumentList (cognitive 43) · ×1
  • _OpTypeAstVisitor.visitArgumentList (cognitive 43) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:211 — _OpTypeAstVisitor.visitArgumentList has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25 (41 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DillExtensionBuilder.DillExtensionBuilder (cognitive 43) · ×1
  • DillExtensionBuilder.DillExtensionBuilder (cognitive 43) pkg/front_end/lib/src/dill/dill_extension_builder.dart:35 — DillExtensionBuilder.DillExtensionBuilder has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncStateVisitor.visitBinaryExpression (cognitive 43) · ×1
  • AsyncStateVisitor.visitBinaryExpression (cognitive 43) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:187 — AsyncStateVisitor.visitBinaryExpression has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 6, match/switch 3 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionLogAnalyzer.printReport (cognitive 42) · ×1
  • SessionLogAnalyzer.printReport (cognitive 42) pkg/analysis_server/.agents/skills/improve-performance-with-session-log/scripts/analyze_session_log.dart:116 — SessionLogAnalyzer.printReport has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 6 (15 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase (cognitive 42) · ×1
  • _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase (cognitive 42) pkg/dart2wasm/lib/translator.dart:3364 — _ClosureArgumentsToVtableEntryDispatcherGenerator._handleOptionalNamedCase has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ImportExportVerifierMixin._checkImportExportPragmas (cognitive 42) · ×1
  • _ImportExportVerifierMixin._checkImportExportPragmas (cognitive 42) pkg/dart2wasm/lib/wasm_library_checks.dart:518 — _ImportExportVerifierMixin._checkImportExportPragmas has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 19, if/else 9 (15 pts), ternaries 2 (6 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal (cognitive 42) · ×1
  • ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal (cognitive 42) pkg/kernel/lib/class_hierarchy.dart:961 — ClosedWorldClassHierarchy._getLegacyLeastUpperBoundInternal has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (31 pts), ternaries 2 (8 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormatException.toString (cognitive 42) · ×1
  • FormatException.toString (cognitive 42) sdk/lib/core/exceptions.dart:75 — FormatException.toString has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiTransformer.convertNativeTypeToDartType (cognitive 42) · ×1
  • FfiTransformer.convertNativeTypeToDartType (cognitive 42) pkg/vm/lib/modular/transformations/ffi/common.dart:1088 — FfiTransformer.convertNativeTypeToDartType has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (27 pts), match/switch 3 (8 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ReorderBlocks.run (cognitive 42) · ×1
  • ReorderBlocks.run (cognitive 42) pkg/native_compiler/lib/passes/reorder_blocks.dart:21 — ReorderBlocks.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionSerializationCluster.trace (cognitive 42) · ×1
  • FunctionSerializationCluster.trace (cognitive 42) pkg/native_compiler/lib/snapshot/snapshot.dart:1407 — FunctionSerializationCluster.trace has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 9 (19 pts), if/else 7 (10 pts), boolean chains 8, match/switch 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexTypeParamOrArgInfo.compute (cognitive 42) · ×1
  • ComplexTypeParamOrArgInfo.compute (cognitive 42) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1345 — ComplexTypeParamOrArgInfo.compute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitForStatement (cognitive 42) · ×1
  • InScopeCompletionPass.visitForStatement (cognitive 42) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1601 — InScopeCompletionPass.visitForStatement has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UriHelper._addFileSuggestions (cognitive 42) · ×1
  • UriHelper._addFileSuggestions (cognitive 42) pkg/analysis_server/lib/src/services/completion/dart/uri_helper.dart:82 — UriHelper._addFileSuggestions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 4, loops 1 (3 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YamlCompletionGenerator._siblingsOnPath (cognitive 42) · ×1
  • YamlCompletionGenerator._siblingsOnPath (cognitive 42) pkg/analysis_server/lib/src/services/completion/yaml/yaml_completion_generator.dart:220 — YamlCompletionGenerator._siblingsOnPath has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AddSuperParameter._addToConstructor (cognitive 42) · ×1
  • AddSuperParameter._addToConstructor (cognitive 42) pkg/analysis_server/lib/src/services/correction/dart/add_super_parameter.dart:62 — AddSuperParameter._addToConstructor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToCascade.compute (cognitive 42) · ×1
  • ConvertToCascade.compute (cognitive 42) pkg/analysis_server/lib/src/services/correction/dart/convert_to_cascade.dart:26 — ConvertToCascade.compute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _EdgeInsetsProperty.changeValue (cognitive 42) · ×1
  • _EdgeInsetsProperty.changeValue (cognitive 42) pkg/analysis_server/lib/src/services/flutter/property.dart:514 — _EdgeInsetsProperty.changeValue has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractMethodRefactoringImpl._checkSelection (cognitive 42) · ×1
  • ExtractMethodRefactoringImpl._checkSelection (cognitive 42) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:488 — ExtractMethodRefactoringImpl._checkSelection has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExtractWidgetRefactoringImpl._initializeParameters (cognitive 42) · ×1
  • ExtractWidgetRefactoringImpl._initializeParameters (cognitive 42) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:276 — ExtractWidgetRefactoringImpl._initializeParameters has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (12 pts), ternaries 1 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameRefactoring.getElementToRename (cognitive 42) · ×1
  • RenameRefactoring.getElementToRename (cognitive 42) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart:591 — RenameRefactoring.getElementToRename has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39 (42 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConstantVisitor._buildListConstant (cognitive 42) · ×1
  • ConstantVisitor._buildListConstant (cognitive 42) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1370 — ConstantVisitor._buildListConstant has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConstantVisitor._buildSetConstant) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ConstantVisitor._buildSetConstant (cognitive 42) · ×1
  • ConstantVisitor._buildSetConstant (cognitive 42) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1612 — ConstantVisitor._buildSetConstant has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConstantVisitor._buildListConstant) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment (cognitive 42) · ×1
  • LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment (cognitive 42) pkg/analyzer/lib/src/error/language_version_override_verifier.dart:37 — LanguageVersionOverrideVerifier._findLanguageVersionOverrideComment has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 14, loops 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _TodoFinder._check (cognitive 42) · ×1
  • _TodoFinder._check (cognitive 42) pkg/analyzer/lib/src/error/todo_finder.dart:224 — _TodoFinder._check has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 16, loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferrerEngine.analyze (cognitive 42) · ×1
  • InferrerEngine.analyze (cognitive 42) pkg/compiler/lib/src/inferrer/engine.dart:676 — InferrerEngine.analyze has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 5 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitParameterValue (cognitive 42) · ×1
  • SsaInstructionSimplifier.visitParameterValue (cognitive 42) pkg/compiler/lib/src/ssa/optimize.dart:676 — SsaInstructionSimplifier.visitParameterValue has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExecutableCompiler._compileToSnapshot (cognitive 42) · ×1
  • ExecutableCompiler._compileToSnapshot (cognitive 42) pkg/dartdev/lib/src/executable_compiler.dart:335 — ExecutableCompiler._compileToSnapshot has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 5 (11 pts), loops 2 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase.createPropertyGet (cognitive 42) · ×1
  • InferenceVisitorBase.createPropertyGet (cognitive 42) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5358 — InferenceVisitorBase.createPropertyGet has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModulePrinter.enqueueElementSegment (cognitive 42) · ×1
  • ModulePrinter.enqueueElementSegment (cognitive 42) pkg/wasm_builder/lib/src/serialize/printer.dart:157 — ModulePrinter.enqueueElementSegment has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (16 pts), ternaries 1 (6 pts), match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Transform.transformCall (cognitive 42) · ×1
  • _Transform.transformCall (cognitive 42) pkg/vm/lib/transformations/type_flow/signature_shaking.dart:608 — _Transform.transformCall has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 11, loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ErrorCodeDocumentationParser.processCodeBlock (cognitive 41) · ×1
  • _ErrorCodeDocumentationParser.processCodeBlock (cognitive 41) pkg/analyzer/tool/messages/error_code_documentation_info.dart:173 — _ErrorCodeDocumentationParser.processCodeBlock has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Intrinsifier.generateMemberIntrinsic (cognitive 41) · ×1
  • Intrinsifier.generateMemberIntrinsic (cognitive 41) pkg/dart2wasm/lib/intrinsics.dart:3741 — Intrinsifier.generateMemberIntrinsic has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 2 (4 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MixinApplicationCloner._findSuperMember (cognitive 41) · ×1
  • MixinApplicationCloner._findSuperMember (cognitive 41) pkg/kernel/lib/clone.dart:1801 — MixinApplicationCloner._findSuperMember has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HttpDate._parse (cognitive 41) · ×1
  • HttpDate._parse (cognitive 41) sdk/lib/_http/http_date.dart:129 — HttpDate._parse has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 7, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpClientResponse._authenticate (cognitive 41) · ×1
  • _HttpClientResponse._authenticate (cognitive 41) sdk/lib/_http/http_impl.dart:805 — _HttpClientResponse._authenticate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 4, ternaries 2, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._makeWindowsFileUrl (cognitive 41) · ×1
  • _Uri._makeWindowsFileUrl (cognitive 41) sdk/lib/core/uri.dart:2208 — _Uri._makeWindowsFileUrl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 9, ternaries 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._normalizeRegName (cognitive 41) · ×1
  • _Uri._normalizeRegName (cognitive 41) sdk/lib/core/uri.dart:2550 — _Uri._normalizeRegName has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 4, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor._complete_forStatement (cognitive 41) · ×1
  • StatementCompletionProcessor._complete_forStatement (cognitive 41) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:626 — StatementCompletionProcessor._complete_forStatement has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementDescriptor._matchesMethod (cognitive 41) · ×1
  • ElementDescriptor._matchesMethod (cognitive 41) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart:124 — ElementDescriptor._matchesMethod has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TopMergeHelper.topMerge (cognitive 41) · ×1
  • TopMergeHelper.topMerge (cognitive 41) pkg/analyzer/lib/src/dart/element/top_merge.dart:22 — TopMergeHelper.topMerge has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 23, if/else 17 (18 pts) (nesting depth added 1). 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.
D2 · Cognitive Complexity · ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes (cognitive 41) · ×1
  • ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes (cognitive 41) pkg/analyzer/lib/src/generated/error_verifier.dart:5350 — ErrorVerifier._checkForExtensionTypeRepresentationErrorCodes has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl._writeType (cognitive 41) · ×1
  • DartEditBuilderImpl._writeType (cognitive 41) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1598 — DartEditBuilderImpl._writeType has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._pushDynamicInvocation (cognitive 41) · ×1
  • KernelSsaGraphBuilder._pushDynamicInvocation (cognitive 41) pkg/compiler/lib/src/ssa/builder.dart:6830 — KernelSsaGraphBuilder._pushDynamicInvocation has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 13, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SsaInstructionSimplifier.handleInterceptedCall (cognitive 41) · ×1
  • SsaInstructionSimplifier.handleInterceptedCall (cognitive 41) pkg/compiler/lib/src/ssa/optimize.dart:851 — SsaInstructionSimplifier.handleInterceptedCall has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 6 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endFormalParameter (cognitive 41) · ×1
  • BodyBuilderImpl.endFormalParameter (cognitive 41) pkg/front_end/lib/src/kernel/body_builder.dart:3754 — BodyBuilderImpl.endFormalParameter has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 6, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatternConverter.dispatchPattern (cognitive 41) · ×1
  • PatternConverter.dispatchPattern (cognitive 41) pkg/front_end/lib/src/kernel/exhaustiveness.dart:624 — PatternConverter.dispatchPattern has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 4 (8 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ExtensionTypeHierarchyNodeBuilder.build (cognitive 41) · ×1
  • ExtensionTypeHierarchyNodeBuilder.build (cognitive 41) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart:428 — ExtensionTypeHierarchyNodeBuilder.build has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (20 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Covariance.== (cognitive 41) · ×1
  • Covariance.== (cognitive 41) pkg/front_end/lib/src/kernel/member_covariance.dart:366 — Covariance.== has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Covariance.toString (cognitive 41) · ×1
  • Covariance.toString (cognitive 41) pkg/front_end/lib/src/kernel/member_covariance.dart:419 — Covariance.toString has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (10 pts), loops 3 (9 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceCompilationUnitImpl._includePartIfValid (cognitive 41) · ×1
  • SourceCompilationUnitImpl._includePartIfValid (cognitive 41) pkg/front_end/lib/src/source/source_compilation_unit.dart:905 — SourceCompilationUnitImpl._includePartIfValid has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (38 pts), boolean chains 2, match/switch 1 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _ObjectAccessDescriptor._findNonExtensionTargetInternal (cognitive 41) · ×1
  • _ObjectAccessDescriptor._findNonExtensionTargetInternal (cognitive 41) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:6365 — _ObjectAccessDescriptor._findNonExtensionTargetInternal has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 4 (11 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PragmaEntryPointsVisitor.visitProcedure (cognitive 41) · ×1
  • PragmaEntryPointsVisitor.visitProcedure (cognitive 41) pkg/vm/lib/transformations/type_flow/native_code.dart:146 — PragmaEntryPointsVisitor.visitProcedure has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (37 pts), match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnboxingInfoManager.analyzeComponent (cognitive 41) · ×1
  • UnboxingInfoManager.analyzeComponent (cognitive 41) pkg/vm/lib/transformations/type_flow/unboxing_info.dart:52 — UnboxingInfoManager.analyzeComponent has cognitive complexity 41 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 5 (11 pts), boolean chains 6, ternaries 4 (5 pts) (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JsInteropChecks.visitClass (cognitive 40) · ×1
  • JsInteropChecks.visitClass (cognitive 40) pkg/_js_interop_checks/lib/js_interop_checks.dart:174 — JsInteropChecks.visitClass has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator._genConstructorInitializers (cognitive 40) · ×1
  • BytecodeGenerator._genConstructorInitializers (cognitive 40) pkg/dart2bytecode/lib/bytecode_generator.dart:1281 — BytecodeGenerator._genConstructorInitializers has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SelectorInfo._computeSignature (cognitive 40) · ×1
  • SelectorInfo._computeSignature (cognitive 40) pkg/dart2wasm/lib/dispatch_table.dart:111 — SelectorInfo._computeSignature has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 6 (15 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parsePrimaryConstructorOpt (cognitive 40) · ×1
  • Parser.parsePrimaryConstructorOpt (cognitive 40) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3794 — Parser.parsePrimaryConstructorOpt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 3 (9 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseSwitchBlock (cognitive 40) · ×1
  • Parser.parseSwitchBlock (cognitive 40) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:10913 — Parser.parseSwitchBlock has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (15 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseSwitchExpression (cognitive 40) · ×1
  • Parser.parseSwitchExpression (cognitive 40) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:12433 — Parser.parseSwitchExpression has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConvertToDeclaringParameter._getRefactorData (cognitive 40) · ×1
  • ConvertToDeclaringParameter._getRefactorData (cognitive 40) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:388 — ConvertToDeclaringParameter._getRefactorData has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody (cognitive 40) · ×1
  • ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody (cognitive 40) pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:101 — ConvertToInBodyConstructor._convertPrimaryConstructorInBlockBody has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluationEngine.computeConstantValue (cognitive 40) · ×1
  • ConstantEvaluationEngine.computeConstantValue (cognitive 40) pkg/analyzer/lib/src/dart/constant/evaluation.dart:82 — ConstantEvaluationEngine.computeConstantValue has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GenericInferrer.tryChooseFinalTypes (cognitive 40) · ×1
  • GenericInferrer.tryChooseFinalTypes (cognitive 40) pkg/analyzer/lib/src/dart/element/generic_inferrer.dart:300 — GenericInferrer.tryChooseFinalTypes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 4, loops 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver.resolveCascadeIndex (cognitive 40) · ×1
  • PropertyElementResolver.resolveCascadeIndex (cognitive 40) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:53 — PropertyElementResolver.resolveCascadeIndex has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 11 (15 pts), boolean chains 6, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClassVerifier._reportConcreteClassWithAbstractMember (cognitive 40) · ×1
  • _ClassVerifier._reportConcreteClassWithAbstractMember (cognitive 40) pkg/analyzer/lib/src/error/inheritance_override.dart:907 — _ClassVerifier._reportConcreteClassWithAbstractMember has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GatherUsedLocalElementsVisitor._useNamedReadResolution (cognitive 40) · ×1
  • GatherUsedLocalElementsVisitor._useNamedReadResolution (cognitive 40) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:513 — GatherUsedLocalElementsVisitor._useNamedReadResolution has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 5, loops 1 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FfiVerifier._validateFieldsInCompound (cognitive 40) · ×1
  • FfiVerifier._validateFieldsInCompound (cognitive 40) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1729 — FfiVerifier._validateFieldsInCompound has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManifestParser._parseAttribute (cognitive 40) · ×1
  • ManifestParser._parseAttribute (cognitive 40) pkg/analyzer/lib/src/manifest/manifest_validator.dart:145 — ManifestParser._parseAttribute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Builder.build (cognitive 40) · ×1
  • _Builder.build (cognitive 40) pkg/compiler/lib/src/deferred_load/program_split_constraints/builder.dart:79 — _Builder.build has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 9 (19 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DominatedUses._compute (cognitive 40) · ×1
  • DominatedUses._compute (cognitive 40) pkg/compiler/lib/src/ssa/nodes.dart:1655 — DominatedUses._compute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassPropertyModel.build (cognitive 40) · ×1
  • ClassPropertyModel.build (cognitive 40) pkg/dev_compiler/lib/src/kernel/property_model.dart:224 — ClassPropertyModel.build has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 11, loops 3 (4 pts), ternaries 1 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl._validateTypeParameterUseInternal (cognitive 40) · ×1
  • BodyBuilderImpl._validateTypeParameterUseInternal (cognitive 40) pkg/front_end/lib/src/kernel/body_builder.dart:11424 — BodyBuilderImpl._validateTypeParameterUseInternal has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (15 pts), boolean chains 5, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitPatternSwitchStatement (cognitive 40) · ×1
  • InferenceVisitorImpl.visitPatternSwitchStatement (cognitive 40) pkg/front_end/lib/src/type_inference/inference_visitor.dart:10377 — InferenceVisitorImpl.visitPatternSwitchStatement has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 6 (15 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.parseStatement (cognitive 40) · ×1
  • MiniJsParser.parseStatement (cognitive 40) pkg/js_ast/lib/src/builder.dart:1236 — MiniJsParser.parseStatement has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotateKernel._annotateMember (cognitive 40) · ×1
  • AnnotateKernel._annotateMember (cognitive 40) pkg/vm/lib/transformations/type_flow/transformer.dart:876 — AnnotateKernel._annotateMember has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (9 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createTreemapTile (cognitive 40) · ×1
  • createTreemapTile (cognitive 40) runtime/tools/graphexplorer/graphexplorer.js:1279 — createTreemapTile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 15). Of this number, 34 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogPage._writeEntry (cognitive 39) · ×1
  • LogPage._writeEntry (cognitive 39) pkg/analysis_server/tool/instrumentation/page/log_page.dart:115 — LogPage._writeEntry has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (38 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImplGenerator._generateBeginToken (cognitive 39) · ×1
  • AstNodeImplGenerator._generateBeginToken (cognitive 39) pkg/analyzer/tool/generators/ast_generator.dart:315 — AstNodeImplGenerator._generateBeginToken has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ScopeBuilder._visitFunction (cognitive 39) · ×1
  • _ScopeBuilder._visitFunction (cognitive 39) pkg/dart2bytecode/lib/local_vars.dart:344 — _ScopeBuilder._visitFunction has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Recorder.record (cognitive 39) · ×1
  • _Recorder.record (cognitive 39) pkg/perf_witness/lib/recorder.dart:117 — _Recorder.record has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (12 pts), error handling 3 (9 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpClientConnection.send (cognitive 39) · ×1
  • _HttpClientConnection.send (cognitive 39) sdk/lib/_http/http_impl.dart:2330 — _HttpClientConnection.send has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 10 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BigIntImpl._divRem (cognitive 39) · ×1
  • _BigIntImpl._divRem (cognitive 39) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1477 — _BigIntImpl._divRem has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (9 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.allocateBlockedRegister (cognitive 39) · ×1
  • LinearScanRegisterAllocator.allocateBlockedRegister (cognitive 39) pkg/native_compiler/lib/back_end/register_allocator.dart:755 — LinearScanRegisterAllocator.allocateBlockedRegister has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmInstructionLowerer.visitComparison (cognitive 39) · ×1
  • WasmInstructionLowerer.visitComparison (cognitive 39) pkg/dart2wasm/lib/cfg/to_wasm.dart:310 — WasmInstructionLowerer.visitComparison has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 2 (8 pts), boolean chains 2, match/switch 2 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _Uri._normalize (cognitive 39) · ×1
  • _Uri._normalize (cognitive 39) sdk/lib/core/uri.dart:2885 — _Uri._normalize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Checker._unmatched (cognitive 39) · ×1
  • _Checker._unmatched (cognitive 39) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart:112 — _Checker._unmatched has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PromotionModel._tryPromoteToTypeOfInterest (cognitive 39) · ×1
  • PromotionModel._tryPromoteToTypeOfInterest (cognitive 39) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:5029 — PromotionModel._tryPromoteToTypeOfInterest has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 3 (6 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseTopLevelDeclarationImpl (cognitive 39) · ×1
  • Parser.parseTopLevelDeclarationImpl (cognitive 39) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:554 — Parser.parseTopLevelDeclarationImpl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 18, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TypeConstraintGenerator.performSubtypeConstraintGenerationInternal (cognitive 39) · ×1
  • TypeConstraintGenerator.performSubtypeConstraintGenerationInternal (cognitive 39) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:2170 — TypeConstraintGenerator.performSubtypeConstraintGenerationInternal has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28 (35 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AbstractNotificationManager.setSubscriptions (cognitive 39) · ×1
  • AbstractNotificationManager.setSubscriptions (cognitive 39) pkg/analysis_server/lib/src/plugin/notification_manager.dart:302 — AbstractNotificationManager.setSubscriptions has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (17 pts), match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeywordHelper.addExpressionKeywords (cognitive 39) · ×1
  • KeywordHelper.addExpressionKeywords (cognitive 39) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:312 — KeywordHelper.addExpressionKeywords has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 13 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ConvertToFlutterStyleTodo.compute (cognitive 39) · ×1
  • ConvertToFlutterStyleTodo.compute (cognitive 39) pkg/analysis_server/lib/src/services/correction/dart/convert_to_flutter_style_todo.dart:26 — ConvertToFlutterStyleTodo.compute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveLeadingUnderscore.compute (cognitive 39) · ×1
  • RemoveLeadingUnderscore.compute (cognitive 39) pkg/analysis_server/lib/src/services/correction/dart/remove_leading_underscore.dart:28 — RemoveLeadingUnderscore.compute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplaceWithDecoratedBox.compute (cognitive 39) · ×1
  • ReplaceWithDecoratedBox.compute (cognitive 39) pkg/analysis_server/lib/src/services/correction/dart/replace_with_decorated_box.dart:28 — ReplaceWithDecoratedBox.compute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 5 (8 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplaceWithIsEmpty._analyzeBinaryExpression (cognitive 39) · ×1
  • ReplaceWithIsEmpty._analyzeBinaryExpression (cognitive 39) pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_empty.dart:94 — ReplaceWithIsEmpty._analyzeBinaryExpression has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RefactoringManager._createRefactoringFromKind (cognitive 39) · ×1
  • RefactoringManager._createRefactoringFromKind (cognitive 39) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_manager.dart:220 — RefactoringManager._createRefactoringFromKind has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginsPage._emitIsolateInfo (cognitive 39) · ×1
  • PluginsPage._emitIsolateInfo (cognitive 39) pkg/analysis_server/lib/src/status/pages/plugins_page.dart:146 — PluginsPage._emitIsolateInfo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParsedLinterData._parseLocalRules (cognitive 39) · ×1
  • _ParsedLinterData._parseLocalRules (cognitive 39) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1209 — _ParsedLinterData._parseLocalRules has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConstantVisitor._buildMapConstant (cognitive 39) · ×1
  • ConstantVisitor._buildMapConstant (cognitive 39) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1492 — ConstantVisitor._buildMapConstant has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GetterSetterTypesVerifier.checkInterface (cognitive 39) · ×1
  • GetterSetterTypesVerifier.checkInterface (cognitive 39) pkg/analyzer/lib/src/error/getter_setter_types_verifier.dart:59 — GetterSetterTypesVerifier.checkInterface has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (36 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResolutionEnqueuerListener._processClass (cognitive 39) · ×1
  • ResolutionEnqueuerListener._processClass (cognitive 39) pkg/compiler/lib/src/js_backend/resolution_listener.dart:387 — ResolutionEnqueuerListener._processClass has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, boolean chains 13. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._buildConstructor (cognitive 39) · ×1
  • KernelSsaGraphBuilder._buildConstructor (cognitive 39) pkg/compiler/lib/src/ssa/builder.dart:788 — KernelSsaGraphBuilder._buildConstructor has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger._pauseHandler (cognitive 39) · ×1
  • Debugger._pauseHandler (cognitive 39) pkg/dwds/lib/src/debugging/debugger.dart:544 — Debugger._pauseHandler has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ForwardingNode._createForwardingImplIfNeeded (cognitive 39) · ×1
  • ForwardingNode._createForwardingImplIfNeeded (cognitive 39) pkg/front_end/lib/src/kernel/forwarding_node.dart:299 — ForwardingNode._createForwardingImplIfNeeded has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 2, match/switch 1, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader._checkMainMethods (cognitive 39) · ×1
  • SourceLoader._checkMainMethods (cognitive 39) pkg/front_end/lib/src/source/source_loader.dart:3065 — SourceLoader._checkMainMethods has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (39 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FunctionType.equals (cognitive 39) · ×1
  • FunctionType.equals (cognitive 39) pkg/kernel/lib/src/ast/types.dart:1466 — FunctionType.equals has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (13 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitCompilationUnit (cognitive 39) · ×1
  • _Visitor.visitCompilationUnit (cognitive 39) pkg/linter/lib/src/rules/unreachable_from_main.dart:503 — _Visitor.visitCompilationUnit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 6 (7 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TreeMap._createTreemapTile (cognitive 39) · ×1
  • TreeMap._createTreemapTile (cognitive 39) pkg/observatory/lib/src/elements/tree_map.dart:32 — TreeMap._createTreemapTile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Instance.toJson (cognitive 39) · ×1
  • Instance.toJson (cognitive 39) pkg/vm_service/lib/src/vm_service.dart:5796 — Instance.toJson has cognitive complexity 39 (threshold 15). Drivers by points: if/else 39. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SummaryCollector._visitCondition (cognitive 39) · ×1
  • SummaryCollector._visitCondition (cognitive 39) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1792 — SummaryCollector._visitCondition has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 13, match/switch 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SimpleUri._simpleMerge (cognitive 38) · ×1
  • _SimpleUri._simpleMerge (cognitive 38) sdk/lib/core/uri.dart:4862 — _SimpleUri._simpleMerge has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseImportRecovery (cognitive 38) · ×1
  • Parser.parseImportRecovery (cognitive 38) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:994 — Parser.parseImportRecovery has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseFields (cognitive 38) · ×1
  • Parser.parseFields (cognitive 38) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4450 — Parser.parseFields has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 9, loops 1, match/switch 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeFinal.compute (cognitive 38) · ×1
  • MakeFinal.compute (cognitive 38) pkg/analysis_server/lib/src/services/correction/dart/make_final.dart:26 — MakeFinal.compute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryAnalyzer._checkForInconsistentLanguageVersionOverride (cognitive 38) · ×1
  • LibraryAnalyzer._checkForInconsistentLanguageVersionOverride (cognitive 38) pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart:198 — LibraryAnalyzer._checkForInconsistentLanguageVersionOverride has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 2, boolean chains 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassElementImpl.directSubtypesOfSealed (cognitive 38) · ×1
  • ClassElementImpl.directSubtypesOfSealed (cognitive 38) pkg/analyzer/lib/src/dart/element/element.dart:208 — ClassElementImpl.directSubtypesOfSealed has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryMatch.compareStructures (cognitive 38) · ×1
  • _LibraryMatch.compareStructures (cognitive 38) pkg/analyzer/lib/src/fine/library_manifest.dart:1814 — _LibraryMatch.compareStructures has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (35 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormattingDiagnosticHandler.report (cognitive 38) · ×1
  • FormattingDiagnosticHandler.report (cognitive 38) pkg/compiler/lib/src/source_file_provider.dart:246 — FormattingDiagnosticHandler.report has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodegenWorldBuilder.generateParameterStubs (cognitive 38) · ×1
  • CodegenWorldBuilder.generateParameterStubs (cognitive 38) pkg/compiler/lib/src/universe/codegen_world_builder.dart:674 — CodegenWorldBuilder.generateParameterStubs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 4, loops 2, ternaries 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TestAdapter.sendTestTextOutput (cognitive 38) · ×1
  • TestAdapter.sendTestTextOutput (cognitive 38) pkg/dap_adapters/lib/src/adapters/mixins.dart:97 — TestAdapter.sendTestTextOutput has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ProgramCompiler._directCastMethod (cognitive 38) · ×1
  • ProgramCompiler._directCastMethod (cognitive 38) pkg/dev_compiler/lib/src/kernel/compiler.dart:7824 — ProgramCompiler._directCastMethod has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._directCastMethod (cognitive 38) · ×1
  • LibraryCompiler._directCastMethod (cognitive 38) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8692 — LibraryCompiler._directCastMethod has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._computeExpressionCompilationScopeData (cognitive 38) · ×1
  • IncrementalCompiler._computeExpressionCompilationScopeData (cognitive 38) pkg/front_end/lib/src/base/incremental_compiler.dart:2503 — IncrementalCompiler._computeExpressionCompilationScopeData has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 13, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAliasBuilderImpl.unaliasDeclaration (cognitive 38) · ×1
  • TypeAliasBuilderImpl.unaliasDeclaration (cognitive 38) pkg/front_end/lib/src/builder/type_alias_builder.dart:325 — TypeAliasBuilderImpl.unaliasDeclaration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 3 (10 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FactoryEncoding.resolveRedirectingFactory (cognitive 38) · ×1
  • FactoryEncoding.resolveRedirectingFactory (cognitive 38) pkg/front_end/lib/src/fragment/factory/encoding.dart:368 — FactoryEncoding.resolveRedirectingFactory has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 6 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLibraryBuilder._buildOutlineNodes (cognitive 38) · ×1
  • SourceLibraryBuilder._buildOutlineNodes (cognitive 38) pkg/front_end/lib/src/source/source_library_builder.dart:1064 — SourceLibraryBuilder._buildOutlineNodes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 2 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandardBounds._getFunctionStandardLowerBound (cognitive 38) · ×1
  • StandardBounds._getFunctionStandardLowerBound (cognitive 38) pkg/kernel/lib/src/standard_bounds.dart:1098 — StandardBounds._getFunctionStandardLowerBound has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 8 (12 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeclarationGatherer._addMembers (cognitive 38) · ×1
  • _DeclarationGatherer._addMembers (cognitive 38) pkg/linter/lib/src/rules/unreachable_from_main.dart:97 — _DeclarationGatherer._addMembers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 10, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkForConvertiblePositionalParams (cognitive 38) · ×1
  • _Visitor._checkForConvertiblePositionalParams (cognitive 38) pkg/linter/lib/src/rules/use_super_parameters.dart:157 — _Visitor._checkForConvertiblePositionalParams has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelevanceMetricsComputer._computeInContext (cognitive 37) · ×1
  • RelevanceMetricsComputer._computeInContext (cognitive 37) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2422 — RelevanceMetricsComputer._computeInContext has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (10 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartdevRunner.runCommand (cognitive 37) · ×1
  • DartdevRunner.runCommand (cognitive 37) pkg/dartdev/lib/dartdev.dart:212 — DartdevRunner.runCommand has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 8, error handling 5 (8 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevToolsServer.serveDevTools (cognitive 37) · ×1
  • DevToolsServer.serveDevTools (cognitive 37) pkg/dds/lib/devtools_server.dart:260 — DevToolsServer.serveDevTools has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Expect._deepEquals (cognitive 37) · ×1
  • Expect._deepEquals (cognitive 37) pkg/expect/lib/expect.dart:729 — Expect._deepEquals has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (10 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SplayTree._splay (cognitive 37) · ×1
  • _SplayTree._splay (cognitive 37) sdk/lib/collection/splay_tree.dart:67 — _SplayTree._splay has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer._finishJoinedPatternVariables (cognitive 37) · ×1
  • TypeAnalyzer._finishJoinedPatternVariables (cognitive 37) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:3220 — TypeAnalyzer._finishJoinedPatternVariables has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedOptions.parse (cognitive 37) · ×1
  • ParsedOptions.parse (cognitive 37) pkg/_fe_analyzer_shared/lib/src/util/options.dart:39 — ParsedOptions.parse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticInteropMockValidator._computeImplementableExtensionMembers (cognitive 37) · ×1
  • StaticInteropMockValidator._computeImplementableExtensionMembers (cognitive 37) pkg/_js_interop_checks/lib/src/transformations/static_interop_mock_validator.dart:328 — StaticInteropMockValidator._computeImplementableExtensionMembers has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (9 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageScheduler._processDocumentChange (cognitive 37) · ×1
  • MessageScheduler._processDocumentChange (cognitive 37) pkg/analysis_server/lib/src/scheduler/message_scheduler.dart:442 — MessageScheduler._processDocumentChange has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._suggestMethod (cognitive 37) · ×1
  • DeclarationHelper._suggestMethod (cognitive 37) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2395 — DeclarationHelper._suggestMethod has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 11 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ContextTypeVisitor.visitArgumentList (cognitive 37) · ×1
  • _ContextTypeVisitor.visitArgumentList (cognitive 37) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:558 — _ContextTypeVisitor.visitArgumentList has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InScopeCompletionPass.visitRegularFormalParameter (cognitive 37) · ×1
  • InScopeCompletionPass.visitRegularFormalParameter (cognitive 37) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2887 — InScopeCompletionPass.visitRegularFormalParameter has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 9 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _EnumDescription._removeUnnamedConstructor (cognitive 37) · ×1
  • _EnumDescription._removeUnnamedConstructor (cognitive 37) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:369 — _EnumDescription._removeUnnamedConstructor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (31 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CreateClass.compute (cognitive 37) · ×1
  • _CreateClass.compute (cognitive 37) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:171 — _CreateClass.compute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, error handling 1 (5 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveTypeAnnotation._removeFromDeclarationList (cognitive 37) · ×1
  • RemoveTypeAnnotation._removeFromDeclarationList (cognitive 37) pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:72 — RemoveTypeAnnotation._removeFromDeclarationList has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformSetParser._translateElement (cognitive 37) · ×1
  • TransformSetParser._translateElement (cognitive 37) pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart:856 — TransformSetParser._translateElement has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (37 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryFragmentImpl.shouldIgnoreUndefined (cognitive 37) · ×1
  • LibraryFragmentImpl.shouldIgnoreUndefined (cognitive 37) pkg/analyzer/lib/src/dart/element/element.dart:8311 — LibraryFragmentImpl.shouldIgnoreUndefined has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 4 (10 pts), boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotationVerifier._checkVisibility (cognitive 37) · ×1
  • AnnotationVerifier._checkVisibility (cognitive 37) pkg/analyzer/lib/src/error/annotation_verifier.dart:554 — AnnotationVerifier._checkVisibility has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier.visitTopLevelVariablesDeclaration (cognitive 37) · ×1
  • ErrorVerifier.visitTopLevelVariablesDeclaration (cognitive 37) pkg/analyzer/lib/src/generated/error_verifier.dart:2428 — ErrorVerifier.visitTopLevelVariablesDeclaration has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JsKernelToElementMap._ensureSupertypes (cognitive 37) · ×1
  • JsKernelToElementMap._ensureSupertypes (cognitive 37) pkg/compiler/lib/src/js_model/element_map_impl.dart:683 — JsKernelToElementMap._ensureSupertypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaLoadElimination.visitBasicBlock (cognitive 37) · ×1
  • SsaLoadElimination.visitBasicBlock (cognitive 37) pkg/compiler/lib/src/ssa/optimize.dart:4435 — SsaLoadElimination.visitBasicBlock has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegularFieldDeclaration.createFieldEncoding (cognitive 37) · ×1
  • RegularFieldDeclaration.createFieldEncoding (cognitive 37) pkg/front_end/lib/src/fragment/field/declaration.dart:492 — RegularFieldDeclaration.createFieldEncoding has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 11 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceExtensionTypeDeclarationBuilder.checkSupertypes (cognitive 37) · ×1
  • SourceExtensionTypeDeclarationBuilder.checkSupertypes (cognitive 37) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:693 — SourceExtensionTypeDeclarationBuilder.checkSupertypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceLoader.checkClassSupertypes (cognitive 37) · ×1
  • SourceLoader.checkClassSupertypes (cognitive 37) pkg/front_end/lib/src/source/source_loader.dart:2085 — SourceLoader.checkClassSupertypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 3 (11 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartTypeEquivalence.visitFunctionType (cognitive 37) · ×1
  • DartTypeEquivalence.visitFunctionType (cognitive 37) pkg/kernel/lib/src/dart_type_equivalence.dart:43 — DartTypeEquivalence.visitFunctionType has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Module.printAsWat (cognitive 37) · ×1
  • Module.printAsWat (cognitive 37) pkg/wasm_builder/lib/src/ir/module.dart:371 — Module.printAsWat has cognitive complexity 37 (threshold 15). Drivers by points: loops 10 (24 pts), if/else 7 (13 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _DirectInvocation._processFunction (cognitive 37) · ×1
  • _DirectInvocation._processFunction (cognitive 37) pkg/vm/lib/transformations/type_flow/analysis.dart:372 — _DirectInvocation._processFunction has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NativeCodeOracle.handleNativeProcedure (cognitive 37) · ×1
  • NativeCodeOracle.handleNativeProcedure (cognitive 37) pkg/vm/lib/transformations/type_flow/native_code.dart:433 — NativeCodeOracle.handleNativeProcedure has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 2 (10 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DynamicForwarderCodeGenerator._generateDynamicMethodForwarder (cognitive 36) · ×1
  • DynamicForwarderCodeGenerator._generateDynamicMethodForwarder (cognitive 36) pkg/dart2wasm/lib/code_generator.dart:3925 — DynamicForwarderCodeGenerator._generateDynamicMethodForwarder has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (10 pts), ternaries 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevToolsServer.serveDevTools (cognitive 36) · ×1
  • DevToolsServer.serveDevTools (cognitive 36) pkg/dart_runtime_service_dds/lib/devtools_server.dart:274 — DevToolsServer.serveDevTools has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseStringToBuffer (cognitive 36) · ×1
  • _ChunkedJsonParser.parseStringToBuffer (cognitive 36) sdk/lib/_internal/wasm/common/convert_patch.dart:1291 — _ChunkedJsonParser.parseStringToBuffer has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _JsonStringifier.writeStringContent (cognitive 36) · ×1
  • _JsonStringifier.writeStringContent (cognitive 36) sdk/lib/convert/json.dart:714 — _JsonStringifier.writeStringContent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UriData._parse (cognitive 36) · ×1
  • UriData._parse (cognitive 36) sdk/lib/core/uri.dart:4254 — UriData._parse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstToIr._translateConditionForValue (cognitive 36) · ×1
  • AstToIr._translateConditionForValue (cognitive 36) pkg/cfg/lib/front_end/ast_to_ir.dart:2124 — AstToIr._translateConditionForValue has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 3 (9 pts), loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ScopeBuilder.allocateContexts (cognitive 36) · ×1
  • _ScopeBuilder.allocateContexts (cognitive 36) pkg/cfg/lib/front_end/computed_scopes.dart:194 — _ScopeBuilder.allocateContexts has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantPragmaAnnotationParser.parsePragma (cognitive 36) · ×1
  • ConstantPragmaAnnotationParser.parsePragma (cognitive 36) pkg/vm/lib/modular/transformations/pragma.dart:165 — ConstantPragmaAnnotationParser.parsePragma has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (33 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColorComputer.getExpressionColorObject (cognitive 36) · ×1
  • ColorComputer.getExpressionColorObject (cognitive 36) pkg/analysis_server/lib/src/computer/computer_color.dart:115 — ColorComputer.getExpressionColorObject has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 3 (7 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitMethodInvocation (cognitive 36) · ×1
  • InScopeCompletionPass.visitMethodInvocation (cognitive 36) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2120 — InScopeCompletionPass.visitMethodInvocation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddExplicitCast.compute (cognitive 36) · ×1
  • AddExplicitCast.compute (cognitive 36) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:31 — AddExplicitCast.compute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 9 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveIfNullOperator.compute (cognitive 36) · ×1
  • RemoveIfNullOperator.compute (cognitive 36) pkg/analysis_server/lib/src/services/correction/dart/remove_if_null_operator.dart:26 — RemoveIfNullOperator.compute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementWriter._computeProperties (cognitive 36) · ×1
  • ElementWriter._computeProperties (cognitive 36) pkg/analysis_server/lib/src/status/utilities/element_writer.dart:35 — ElementWriter._computeProperties has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (35 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVisitor._getConstantValue (cognitive 36) · ×1
  • ConstantVisitor._getConstantValue (cognitive 36) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1882 — ConstantVisitor._getConstantValue has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4, match/switch 1 (3 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier.visitClassDeclaration2 (cognitive 36) · ×1
  • FfiVerifier.visitClassDeclaration2 (cognitive 36) pkg/analyzer/lib/src/generated/ffi_verifier.dart:266 — FfiVerifier.visitClassDeclaration2 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelInfoCollector.visitFunction (cognitive 36) · ×1
  • KernelInfoCollector.visitFunction (cognitive 36) pkg/compiler/lib/src/dump_info.dart:1010 — KernelInfoCollector.visitFunction has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 22, if/else 9 (10 pts), ternaries 3 (4 pts) (nesting depth added 2). 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.
D2 · Cognitive Complexity · SsaCodeGenerator._shouldRecordMethodUses (cognitive 36) · ×1
  • SsaCodeGenerator._shouldRecordMethodUses (cognitive 36) pkg/compiler/lib/src/ssa/codegen.dart:2432 — SsaCodeGenerator._shouldRecordMethodUses has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (33 pts), boolean chains 3 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionSelection.visitFieldSet (cognitive 36) · ×1
  • SsaInstructionSelection.visitFieldSet (cognitive 36) pkg/compiler/lib/src/ssa/codegen_helpers.dart:351 — SsaInstructionSelection.visitFieldSet has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeMotion.visitBasicBlock (cognitive 36) · ×1
  • SsaCodeMotion.visitBasicBlock (cognitive 36) pkg/compiler/lib/src/ssa/optimize.dart:3984 — SsaCodeMotion.visitBasicBlock has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (12 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitClassMethods (cognitive 36) · ×1
  • ProgramCompiler._emitClassMethods (cognitive 36) pkg/dev_compiler/lib/src/kernel/compiler.dart:2480 — ProgramCompiler._emitClassMethods has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5, loops 3, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CombinedMemberSignatureBase.CombinedMemberSignatureBase (cognitive 36) · ×1
  • CombinedMemberSignatureBase.CombinedMemberSignatureBase (cognitive 36) pkg/front_end/lib/src/kernel/combined_member_signature.dart:102 — CombinedMemberSignatureBase.CombinedMemberSignatureBase has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceClassBuilder._computeInterfaceSubstitution (cognitive 36) · ×1
  • SourceClassBuilder._computeInterfaceSubstitution (cognitive 36) pkg/front_end/lib/src/source/source_class_builder.dart:1572 — SourceClassBuilder._computeInterfaceSubstitution has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VerifyingAnalysis.run (cognitive 36) · ×1
  • VerifyingAnalysis.run (cognitive 36) pkg/front_end/lib/src/testing/verifying_analysis.dart:29 — VerifyingAnalysis.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 4 (11 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalJavaScriptBundler.compile (cognitive 36) · ×1
  • IncrementalJavaScriptBundler.compile (cognitive 36) pkg/frontend_server/lib/src/javascript_bundle.dart:252 — IncrementalJavaScriptBundler.compile has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 8 (16 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._visitInvocationExpression (cognitive 36) · ×1
  • _Visitor._visitInvocationExpression (cognitive 36) pkg/linter/lib/src/rules/unnecessary_lambdas.dart:228 — _Visitor._visitInvocationExpression has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DwarfStackTraceDecoder.bind (cognitive 36) · ×1
  • DwarfStackTraceDecoder.bind (cognitive 36) pkg/native_stack_traces/lib/src/convert.dart:544 — DwarfStackTraceDecoder.bind has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChainContext.list (cognitive 36) · ×1
  • ChainContext.list (cognitive 36) pkg/testing/lib/src/chain.dart:368 — ChainContext.list has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Summary.apply (cognitive 36) · ×1
  • Summary.apply (cognitive 36) pkg/vm/lib/transformations/type_flow/summary.dart:1222 — Summary.apply has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 4, boolean chains 3, ternaries 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartDevelopmentServiceLauncher.start (cognitive 35) · ×1
  • DartDevelopmentServiceLauncher.start (cognitive 35) pkg/dds/lib/dds_launcher.dart:52 — DartDevelopmentServiceLauncher.start has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 4 (8 pts), match/switch 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy.applyTreeChanges (cognitive 35) · ×1
  • ClosedWorldClassHierarchy.applyTreeChanges (cognitive 35) pkg/kernel/lib/class_hierarchy.dart:1264 — ClosedWorldClassHierarchy.applyTreeChanges has cognitive complexity 35 (threshold 15). Drivers by points: loops 12 (17 pts), if/else 11 (16 pts), boolean chains 2 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · double._tryParseDouble (cognitive 35) · ×1
  • double._tryParseDouble (cognitive 35) sdk/lib/_internal/vm/lib/double_patch.dart:16 — double._tryParseDouble has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser._parseStringInternal (cognitive 35) · ×1
  • _ChunkedJsonParser._parseStringInternal (cognitive 35) sdk/lib/_internal/wasm/common/convert_patch.dart:1155 — _ChunkedJsonParser._parseStringInternal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TypeUniverse.isSubtype (cognitive 35) · ×1
  • _TypeUniverse.isSubtype (cognitive 35) sdk/lib/_internal/wasm/common/type.dart:1360 — _TypeUniverse.isSubtype has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument (cognitive 35) · ×1
  • _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument (cognitive 35) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:2271 — _FfiUseSiteTransformer._replaceNativeCallParameterAndArgument has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameHandler.handle (cognitive 35) · ×1
  • RenameHandler.handle (cognitive 35) pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:127 — RenameHandler.handle has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitNamedArgument (cognitive 35) · ×1
  • InScopeCompletionPass.visitNamedArgument (cognitive 35) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2236 — InScopeCompletionPass.visitNamedArgument has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StatementCompletionProcessor._complete_doStatement (cognitive 35) · ×1
  • StatementCompletionProcessor._complete_doStatement (cognitive 35) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:462 — StatementCompletionProcessor._complete_doStatement has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddDiagnosticPropertyReference.compute (cognitive 35) · ×1
  • AddDiagnosticPropertyReference.compute (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:37 — AddDiagnosticPropertyReference.compute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26 (32 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AddKeyToConstructors._updateSuper (cognitive 35) · ×1
  • AddKeyToConstructors._updateSuper (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart:254 — AddKeyToConstructors._updateSuper has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToDeclaringParameter._resolveParameterFromFieldNode (cognitive 35) · ×1
  • ConvertToDeclaringParameter._resolveParameterFromFieldNode (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/convert_to_declaring_parameter.dart:476 — ConvertToDeclaringParameter._resolveParameterFromFieldNode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToNullAware.compute (cognitive 35) · ×1
  • ConvertToNullAware.compute (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/convert_to_null_aware.dart:32 — ConvertToNullAware.compute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EncapsulateField._updateReferencesInConstructor (cognitive 35) · ×1
  • EncapsulateField._updateReferencesInConstructor (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart:299 — EncapsulateField._updateReferencesInConstructor has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractLocalVariable._rewriteProperty (cognitive 35) · ×1
  • ExtractLocalVariable._rewriteProperty (cognitive 35) pkg/analysis_server/lib/src/services/correction/dart/extract_local_variable.dart:79 — ExtractLocalVariable._rewriteProperty has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (8 pts), boolean chains 3 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MoveTopLevelToFile._membersToMove (cognitive 35) · ×1
  • MoveTopLevelToFile._membersToMove (cognitive 35) pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart:270 — MoveTopLevelToFile._membersToMove has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FindDeclarations.compute (cognitive 35) · ×1
  • _FindDeclarations.compute (cognitive 35) pkg/analyzer/lib/src/dart/analysis/search.dart:1408 — _FindDeclarations.compute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlowAnalysisHelper.getLabelTarget (cognitive 35) · ×1
  • FlowAnalysisHelper.getLabelTarget (cognitive 35) pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart:480 — FlowAnalysisHelper.getLabelTarget has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds (cognitive 35) · ×1
  • TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds (cognitive 35) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:336 — TypeArgumentsVerifier._checkForTypeArgumentNotMatchingBounds has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OpTypeAstVisitor.visitExpressionFunctionBody (cognitive 35) · ×1
  • _OpTypeAstVisitor.visitExpressionFunctionBody (cognitive 35) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:661 — _OpTypeAstVisitor.visitExpressionFunctionBody has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (33 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LocalDeclarationVisitor._addVariables (cognitive 35) · ×1
  • LocalDeclarationVisitor._addVariables (cognitive 35) pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:310 — LocalDeclarationVisitor._addVariables has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 4 (8 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamManager.streamListen (cognitive 35) · ×1
  • StreamManager.streamListen (cognitive 35) pkg/dds/lib/src/stream_manager.dart:189 — StreamManager.streamListen has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (7 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppInspector._populateScriptCaches (cognitive 35) · ×1
  • AppInspector._populateScriptCaches (cognitive 35) pkg/dwds/lib/src/debugging/inspector.dart:131 — AppInspector._populateScriptCaches has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator._evaluateSubexpression (cognitive 35) · ×1
  • ConstantEvaluator._evaluateSubexpression (cognitive 35) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3113 — ConstantEvaluator._evaluateSubexpression has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 8 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.computeLibraryScopes (cognitive 35) · ×1
  • SourceLoader.computeLibraryScopes (cognitive 35) pkg/front_end/lib/src/source/source_loader.dart:1738 — SourceLoader.computeLibraryScopes has cognitive complexity 35 (threshold 15). Drivers by points: loops 11 (22 pts), if/else 5 (13 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · InferenceVisitorImpl._checkElement (cognitive 35) · ×1
  • InferenceVisitorImpl._checkElement (cognitive 35) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4151 — InferenceVisitorImpl._checkElement has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 2 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitSpreadElement (cognitive 35) · ×1
  • InferenceVisitorImpl.visitSpreadElement (cognitive 35) pkg/front_end/lib/src/type_inference/inference_visitor.dart:4552 — InferenceVisitorImpl.visitSpreadElement has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (23 pts), match/switch 3 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitUnary (cognitive 35) · ×1
  • InferenceVisitorImpl.visitUnary (cognitive 35) pkg/front_end/lib/src/type_inference/inference_visitor.dart:10994 — InferenceVisitorImpl.visitUnary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (35 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitDotShorthandInvocation (cognitive 35) · ×1
  • InferenceVisitorImpl.visitDotShorthandInvocation (cognitive 35) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13849 — InferenceVisitorImpl.visitDotShorthandInvocation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 10, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendServerClient._compile (cognitive 35) · ×1
  • FrontendServerClient._compile (cognitive 35) pkg/frontend_server_client/lib/src/frontend_server_client.dart:199 — FrontendServerClient._compile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (6 pts), match/switch 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncStateVisitor._visitIfLike (cognitive 35) · ×1
  • AsyncStateVisitor._visitIfLike (cognitive 35) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:813 — AsyncStateVisitor._visitIfLike has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 4 (7 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VirtualCollectionElement.render (cognitive 35) · ×1
  • VirtualCollectionElement.render (cognitive 35) pkg/observatory/lib/src/elements/containers/virtual_collection.dart:142 — VirtualCollectionElement.render has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotateKernel._convertType (cognitive 35) · ×1
  • AnnotateKernel._convertType (cognitive 35) pkg/vm/lib/transformations/type_flow/transformer.dart:498 — AnnotateKernel._convertType has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 9, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassConcreteType.isSubtypeOfRuntimeType (cognitive 35) · ×1
  • ClassConcreteType.isSubtypeOfRuntimeType (cognitive 35) pkg/vm/lib/transformations/type_flow/types.dart:1392 — ClassConcreteType.isSubtypeOfRuntimeType has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatsPage._processEntries (cognitive 34) · ×1
  • StatsPage._processEntries (cognitive 34) pkg/analysis_server/tool/instrumentation/page/stats_page.dart:73 — StatsPage._processEntries has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _BuilderGenerator._generateFinish (cognitive 34) · ×1
  • _BuilderGenerator._generateFinish (cognitive 34) pkg/analyzer/tool/summary/generate.dart:283 — _BuilderGenerator._generateFinish has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 4, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassInfoCollector._createStructForClass (cognitive 34) · ×1
  • ClassInfoCollector._createStructForClass (cognitive 34) pkg/dart2wasm/lib/class_info.dart:381 — ClassInfoCollector._createStructForClass has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (9 pts), ternaries 4 (9 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstructorInitializerCodeGenerator.generateInitializerList (cognitive 34) · ×1
  • ConstructorInitializerCodeGenerator.generateInitializerList (cognitive 34) pkg/dart2wasm/lib/code_generator.dart:4376 — ConstructorInitializerCodeGenerator.generateInitializerList has cognitive complexity 34 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 7 (12 pts), boolean chains 2, ternaries 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DynamicDispatchTable._lookupTarget (cognitive 34) · ×1
  • DynamicDispatchTable._lookupTarget (cognitive 34) pkg/dart2wasm/lib/dynamic_dispatch_table.dart:141 — DynamicDispatchTable._lookupTarget has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 9, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCheckingVisitor.handleCall (cognitive 34) · ×1
  • TypeCheckingVisitor.handleCall (cognitive 34) pkg/kernel/lib/type_checker.dart:388 — TypeCheckingVisitor.handleCall has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (12 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProxyConfiguration._ProxyConfiguration (cognitive 34) · ×1
  • _ProxyConfiguration._ProxyConfiguration (cognitive 34) sdk/lib/_http/http_impl.dart:3754 — _ProxyConfiguration._ProxyConfiguration has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 5, error handling 1 (4 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RegisterAllocationChecker.verifyInstructions (cognitive 34) · ×1
  • RegisterAllocationChecker.verifyInstructions (cognitive 34) pkg/native_compiler/lib/back_end/regalloc_checker.dart:282 — RegisterAllocationChecker.verifyInstructions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 5 (15 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExhaustivenessCache.getShapeForType (cognitive 34) · ×1
  • ExhaustivenessCache.getShapeForType (cognitive 34) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart:189 — ExhaustivenessCache.getShapeForType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexTypeInfo.parseType (cognitive 34) · ×1
  • ComplexTypeInfo.parseType (cognitive 34) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:618 — ComplexTypeInfo.parseType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 7, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CodeFragmentScanner.scan (cognitive 34) · ×1
  • _CodeFragmentScanner.scan (cognitive 34) pkg/analysis_server/lib/src/services/correction/fix/data_driven/code_fragment_parser.dart:387 — _CodeFragmentScanner.scan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReferenceProcessor._inlineMethodInvocation (cognitive 34) · ×1
  • _ReferenceProcessor._inlineMethodInvocation (cognitive 34) pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart:793 — _ReferenceProcessor._inlineMethodInvocation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _LinterRuleDiagnostics.reportIncompatibleIncluded (cognitive 34) · ×1
  • _LinterRuleDiagnostics.reportIncompatibleIncluded (cognitive 34) pkg/analyzer/lib/src/analysis_options/linter_rule_options_validator.dart:99 — _LinterRuleDiagnostics.reportIncompatibleIncluded has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 8 (17 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier._checkForConstWithTypeParameters (cognitive 34) · ×1
  • ConstantVerifier._checkForConstWithTypeParameters (cognitive 34) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:613 — ConstantVerifier._checkForConstWithTypeParameters has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver.resolveReceiverPropertyExtraction (cognitive 34) · ×1
  • PropertyElementResolver.resolveReceiverPropertyExtraction (cognitive 34) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:815 — PropertyElementResolver.resolveReceiverPropertyExtraction has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PropertyElementResolver._resolveTargetSuperReference (cognitive 34) · ×1
  • PropertyElementResolver._resolveTargetSuperReference (cognitive 34) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:2041 — PropertyElementResolver._resolveTargetSuperReference has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 2 (8 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorHandlerVerifier._verifyInvocation (cognitive 34) · ×1
  • ErrorHandlerVerifier._verifyInvocation (cognitive 34) pkg/analyzer/lib/src/error/error_handler_verifier.dart:287 — ErrorHandlerVerifier._verifyInvocation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemberDuplicateDefinitionVerifier._checkClassStatic (cognitive 34) · ×1
  • MemberDuplicateDefinitionVerifier._checkClassStatic (cognitive 34) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:179 — MemberDuplicateDefinitionVerifier._checkClassStatic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 2 (5 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DocCommentBuilder._parseReferences (cognitive 34) · ×1
  • DocCommentBuilder._parseReferences (cognitive 34) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:764 — DocCommentBuilder._parseReferences has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ManifestParser._parseNormalTag (cognitive 34) · ×1
  • ManifestParser._parseNormalTag (cognitive 34) pkg/analyzer/lib/src/manifest/manifest_validator.dart:287 — ManifestParser._parseNormalTag has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandLineOptions._parse (cognitive 34) · ×1
  • CommandLineOptions._parse (cognitive 34) pkg/analyzer_cli/lib/src/options.dart:350 — CommandLineOptions._parse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 1 (4 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PubPackageResolutionTest.missingExpectedMessage (cognitive 34) · ×1
  • PubPackageResolutionTest.missingExpectedMessage (cognitive 34) pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart:408 — PubPackageResolutionTest.missingExpectedMessage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (12 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeferredHolderExpressionFinalizerImpl.initializeHolders (cognitive 34) · ×1
  • DeferredHolderExpressionFinalizerImpl.initializeHolders (cognitive 34) pkg/compiler/lib/src/js_backend/deferred_holder_expression.dart:742 — DeferredHolderExpressionFinalizerImpl.initializeHolders has cognitive complexity 34 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 5 (12 pts), ternaries 1 (2 pts) (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SpecializedChecks.findIsTestSpecialization (cognitive 34) · ×1
  • SpecializedChecks.findIsTestSpecialization (cognitive 34) pkg/compiler/lib/src/js_backend/specialized_checks.dart:32 — SpecializedChecks.findIsTestSpecialization has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 11 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitArrayFlagsCheck (cognitive 34) · ×1
  • SsaInstructionSimplifier.visitArrayFlagsCheck (cognitive 34) pkg/compiler/lib/src/ssa/optimize.dart:3026 — SsaInstructionSimplifier.visitArrayFlagsCheck has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartDebugAdapter.evaluateRequest (cognitive 34) · ×1
  • DartDebugAdapter.evaluateRequest (cognitive 34) pkg/dap_adapters/lib/src/adapters/dart.dart:1052 — DartDebugAdapter.evaluateRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 14, ternaries 2 (3 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitInstanceGet (cognitive 34) · ×1
  • ConstantEvaluator.visitInstanceGet (cognitive 34) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4730 — ConstantEvaluator.visitInstanceGet has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Covariance.applyCovariance (cognitive 34) · ×1
  • Covariance.applyCovariance (cognitive 34) pkg/front_end/lib/src/kernel/member_covariance.dart:292 — Covariance.applyCovariance has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (9 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserASTListener.seen (cognitive 34) · ×1
  • ParserASTListener.seen (cognitive 34) pkg/front_end/lib/src/util/parser_ast.dart:1755 — ParserASTListener.seen has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 13, loops 2 (4 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _Visitor.visitNamedType (cognitive 34) · ×1
  • _Visitor.visitNamedType (cognitive 34) pkg/linter/lib/src/rules/prefer_void_to_null.dart:58 — _Visitor.visitNamedType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstructionsBuilder.forceBuild (cognitive 34) · ×1
  • InstructionsBuilder.forceBuild (cognitive 34) pkg/wasm_builder/lib/src/builder/instructions.dart:287 — InstructionsBuilder.forceBuild has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (9 pts), ternaries 6 (7 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _KernelFromParsedType.visitNamedType (cognitive 34) · ×1
  • _KernelFromParsedType.visitNamedType (cognitive 34) pkg/kernel/lib/testing/type_parser_environment.dart:360 — _KernelFromParsedType.visitNamedType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WidgetCreatorTracker._getPragmaName (cognitive 34) · ×1
  • WidgetCreatorTracker._getPragmaName (cognitive 34) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:674 — WidgetCreatorTracker._getPragmaName has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Join.simplify (cognitive 34) · ×1
  • Join.simplify (cognitive 34) pkg/vm/lib/transformations/type_flow/summary.dart:270 — Join.simplify has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MoveFieldInitializers.transformClass (cognitive 34) · ×1
  • MoveFieldInitializers.transformClass (cognitive 34) pkg/vm/lib/transformations/type_flow/transformer.dart:221 — MoveFieldInitializers.transformClass has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 6 (8 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotateKernel._annotateCallSite (cognitive 34) · ×1
  • AnnotateKernel._annotateCallSite (cognitive 34) pkg/vm/lib/transformations/type_flow/transformer.dart:789 — AnnotateKernel._annotateCallSite has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (13 pts), ternaries 2 (3 pts) (nesting depth added 5). 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.
D2 · Cognitive Complexity · onRcpMessage (cognitive 34) · ×1
  • onRcpMessage (cognitive 34) REDACTED:76 — onRcpMessage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (6 pts), boolean chains 2, error handling 2, other 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelevanceDataCollector._recordMemberDepth (cognitive 33) · ×1
  • RelevanceDataCollector._recordMemberDepth (cognitive 33) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:1793 — RelevanceDataCollector._recordMemberDepth has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (10 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFuzz.pickScalarVar (cognitive 33) · ×1
  • DartFuzz.pickScalarVar (cognitive 33) runtime/tools/dartfuzz/dartfuzz.dart:2128 — DartFuzz.pickScalarVar has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 4 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncStarIterator.moveNext (cognitive 33) · ×1
  • _SyncStarIterator.moveNext (cognitive 33) sdk/lib/_internal/vm/lib/async_patch.dart:583 — _SyncStarIterator.moveNext has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 3 (9 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BigIntImpl._remDigits (cognitive 33) · ×1
  • _BigIntImpl._remDigits (cognitive 33) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1634 — _BigIntImpl._remDigits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Base64Decoder.decodeChunk (cognitive 33) · ×1
  • _Base64Decoder.decodeChunk (cognitive 33) sdk/lib/convert/base64.dart:693 — _Base64Decoder.decodeChunk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 4, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._normalizeZoneID (cognitive 33) · ×1
  • _Uri._normalizeZoneID (cognitive 33) sdk/lib/core/uri.dart:2468 — _Uri._normalizeZoneID has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SSAComputation.insertPhis (cognitive 33) · ×1
  • SSAComputation.insertPhis (cognitive 33) pkg/cfg/lib/ir/ssa_computation.dart:41 — SSAComputation.insertPhis has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 4 (8 pts), match/switch 1 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiTransformer.ensureArraySizeAnnotation (cognitive 33) · ×1
  • FfiTransformer.ensureArraySizeAnnotation (cognitive 33) pkg/vm/lib/modular/transformations/ffi/common.dart:1483 — FfiTransformer.ensureArraySizeAnnotation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parsePrimaryPattern (cognitive 33) · ×1
  • Parser.parsePrimaryPattern (cognitive 33) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11675 — Parser.parsePrimaryPattern has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedInteropTransformer.visitStaticInvocation (cognitive 33) · ×1
  • SharedInteropTransformer.visitStaticInvocation (cognitive 33) pkg/_js_interop_checks/lib/src/transformations/shared_interop_transformer.dart:211 — SharedInteropTransformer.visitStaticInvocation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, ternaries 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisServer.reportAnalysisAnalytics (cognitive 33) · ×1
  • AnalysisServer.reportAnalysisAnalytics (cognitive 33) pkg/analysis_server/lib/src/analysis_server.dart:1222 — AnalysisServer.reportAnalysisAnalytics has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (9 pts), match/switch 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitHighlightsComputer._addIdentifierRegion_field (cognitive 33) · ×1
  • DartUnitHighlightsComputer._addIdentifierRegion_field (cognitive 33) pkg/analysis_server/lib/src/computer/computer_highlights.dart:262 — DartUnitHighlightsComputer._addIdentifierRegion_field has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (25 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DartUnitHighlightsComputerVisitor._findEscapes (cognitive 33) · ×1
  • _DartUnitHighlightsComputerVisitor._findEscapes (cognitive 33) pkg/analysis_server/lib/src/computer/computer_highlights.dart:2102 — _DartUnitHighlightsComputerVisitor._findEscapes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 7, loops 2, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartCompletionRequest.targetPrefix (cognitive 33) · ×1
  • DartCompletionRequest.targetPrefix (cognitive 33) pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart:451 — DartCompletionRequest.targetPrefix has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 11, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._canAccessInstanceMember (cognitive 33) · ×1
  • DeclarationHelper._canAccessInstanceMember (cognitive 33) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1814 — DeclarationHelper._canAccessInstanceMember has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddExplicitCast._computeTargetAndTypes (cognitive 33) · ×1
  • AddExplicitCast._computeTargetAndTypes (cognitive 33) pkg/analysis_server/lib/src/services/correction/dart/add_explicit_cast.dart:122 — AddExplicitCast._computeTargetAndTypes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 11 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateSetter.compute (cognitive 33) · ×1
  • CreateSetter.compute (cognitive 33) pkg/analysis_server/lib/src/services/correction/dart/create_setter.dart:32 — CreateSetter.compute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RemoveConst.compute (cognitive 33) · ×1
  • _RemoveConst.compute (cognitive 33) pkg/analysis_server/lib/src/services/correction/dart/remove_const.dart:164 — _RemoveConst.compute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 3 (8 pts), loops 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisOptionsFixGenerator._createScalarDeletionBuilder (cognitive 33) · ×1
  • AnalysisOptionsFixGenerator._createScalarDeletionBuilder (cognitive 33) pkg/analysis_server/lib/src/services/correction/fix/analysis_options/fix_generator.dart:218 — AnalysisOptionsFixGenerator._createScalarDeletionBuilder has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ElementMapper.visitIdentifier (cognitive 33) · ×1
  • _ElementMapper.visitIdentifier (cognitive 33) pkg/analyzer/lib/src/dart/ast/element_locator.dart:108 — _ElementMapper.visitIdentifier has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 7 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstructorTearOffResolver.resolve (cognitive 33) · ×1
  • ConstructorTearOffResolver.resolve (cognitive 33) pkg/analyzer/lib/src/dart/resolver/constructor_tear_off_resolver.dart:23 — ConstructorTearOffResolver.resolve has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 3 (8 pts), boolean chains 4 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartdocDirectiveInfo.extractTemplate (cognitive 33) · ×1
  • DartdocDirectiveInfo.extractTemplate (cognitive 33) pkg/analyzer/lib/src/dartdoc/dartdoc_directive_info.dart:48 — DartdocDirectiveInfo.extractTemplate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BestPracticesVerifier._visitMethodDeclaration (cognitive 33) · ×1
  • BestPracticesVerifier._visitMethodDeclaration (cognitive 33) pkg/analyzer/lib/src/error/best_practices_verifier.dart:1695 — BestPracticesVerifier._visitMethodDeclaration has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForEachParts (cognitive 33) · ×1
  • ErrorVerifier._checkForEachParts (cognitive 33) pkg/analyzer/lib/src/generated/error_verifier.dart:4881 — ErrorVerifier._checkForEachParts has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 4 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._validateAbiSpecificIntegerMappingAnnotation (cognitive 33) · ×1
  • FfiVerifier._validateAbiSpecificIntegerMappingAnnotation (cognitive 33) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1233 — FfiVerifier._validateAbiSpecificIntegerMappingAnnotation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 4 (7 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SuperContext.of (cognitive 33) · ×1
  • SuperContext.of (cognitive 33) pkg/analyzer/lib/src/generated/super_context.dart:38 — SuperContext.of has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl.writeOverride (cognitive 33) · ×1
  • DartEditBuilderImpl.writeOverride (cognitive 33) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:663 — DartEditBuilderImpl.writeOverride has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeferredLoadTask.dump (cognitive 33) · ×1
  • DeferredLoadTask.dump (cognitive 33) pkg/compiler/lib/src/deferred_load/deferred_load.dart:585 — DeferredLoadTask.dump has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 5 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompileNativeCommand.run (cognitive 33) · ×1
  • CompileNativeCommand.run (cognitive 33) pkg/dartdev/lib/src/commands/compile.dart:638 — CompileNativeCommand.run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitImports (cognitive 33) · ×1
  • ProgramCompiler._emitImports (cognitive 33) pkg/dev_compiler/lib/src/kernel/compiler.dart:8913 — ProgramCompiler._emitImports has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeLabeler.visitFunctionType (cognitive 33) · ×1
  • TypeLabeler.visitFunctionType (cognitive 33) pkg/front_end/lib/src/codes/type_labeler.dart:214 — TypeLabeler.visitFunctionType has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicInterfaceSpecification.findNodes (cognitive 33) · ×1
  • DynamicInterfaceSpecification.findNodes (cognitive 33) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:216 — DynamicInterfaceSpecification.findNodes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (9 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTarget._finishClassConstruction (cognitive 33) · ×1
  • KernelTarget._finishClassConstruction (cognitive 33) pkg/front_end/lib/src/kernel/kernel_target.dart:1449 — KernelTarget._finishClassConstruction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Parameter.processOutlineExpressions (cognitive 33) · ×1
  • _Parameter.processOutlineExpressions (cognitive 33) pkg/front_end/lib/src/source/parameters.dart:183 — _Parameter.processOutlineExpressions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceLoader._createSourceCompilationUnit (cognitive 33) · ×1
  • SourceLoader._createSourceCompilationUnit (cognitive 33) pkg/front_end/lib/src/source/source_loader.dart:487 — SourceLoader._createSourceCompilationUnit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerLocation._completeFile (cognitive 33) · ×1
  • DebuggerLocation._completeFile (cognitive 33) pkg/observatory/lib/src/debugger/debugger_location.dart:374 — DebuggerLocation._completeFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (8 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NameSection.serializeContents (cognitive 33) · ×1
  • NameSection.serializeContents (cognitive 33) pkg/wasm_builder/lib/src/serialize/sections.dart:910 — NameSection.serializeContents has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImplGenerator._generateFields (cognitive 32) · ×1
  • AstNodeImplGenerator._generateFields (cognitive 32) pkg/analyzer/tool/generators/ast_generator.dart:777 — AstNodeImplGenerator._generateFields has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 4 (11 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Types.emitIsTest (cognitive 32) · ×1
  • Types.emitIsTest (cognitive 32) pkg/dart2wasm/lib/types.dart:435 — Types.emitIsTest has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Analysis.parseTraverseFilter (cognitive 32) · ×1
  • Analysis.parseTraverseFilter (cognitive 32) pkg/heap_snapshot/lib/analysis.dart:437 — Analysis.parseTraverseFilter has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (8 pts), ternaries 2 (8 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NaiveTypeChecker.checkOverride (cognitive 32) · ×1
  • NaiveTypeChecker.checkOverride (cognitive 32) pkg/kernel/lib/naive_type_checker.dart:50 — NaiveTypeChecker.checkOverride has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemberType.parse (cognitive 32) · ×1
  • MemberType.parse (cognitive 32) pkg/vm_service/tool/dart/generate_dart_common.dart:338 — MemberType.parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TraceReader.readTrace (cognitive 32) · ×1
  • _TraceReader.readTrace (cognitive 32) pkg/vm_snapshot_analysis/lib/precompiler_trace.dart:210 — _TraceReader.readTrace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugInfoWriter._flushPending (cognitive 32) · ×1
  • DebugInfoWriter._flushPending (cognitive 32) pkg/wasm_builder/lib/debug_info.dart:371 — DebugInfoWriter._flushPending has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 12, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncStarIterator.moveNext (cognitive 32) · ×1
  • _SyncStarIterator.moveNext (cognitive 32) sdk/lib/_internal/wasm/common/sync_star_patch.dart:111 — _SyncStarIterator.moveNext has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 3 (9 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TypeUniverse.isFunctionSubtype (cognitive 32) · ×1
  • _TypeUniverse.isFunctionSubtype (cognitive 32) sdk/lib/_internal/wasm/common/type.dart:1221 — _TypeUniverse.isFunctionSubtype has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitTypeCast (cognitive 32) · ×1
  • Arm64CodeGenerator.visitTypeCast (cognitive 32) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1670 — Arm64CodeGenerator.visitTypeCast has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Encoder._fillBuffer (cognitive 32) · ×1
  • _Utf8Encoder._fillBuffer (cognitive 32) sdk/lib/convert/utf.dart:188 — _Utf8Encoder._fillBuffer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseLiteralListSuffix (cognitive 32) · ×1
  • Parser.parseLiteralListSuffix (cognitive 32) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8479 — Parser.parseLiteralListSuffix has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseVariablePattern (cognitive 32) · ×1
  • Parser.parseVariablePattern (cognitive 32) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:11907 — Parser.parseVariablePattern has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._addMembersOfEnclosingNode (cognitive 32) · ×1
  • DeclarationHelper._addMembersOfEnclosingNode (cognitive 32) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1573 — DeclarationHelper._addMembersOfEnclosingNode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DeclarationHelper._addTopLevelDeclarations (cognitive 32) · ×1
  • DeclarationHelper._addTopLevelDeclarations (cognitive 32) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1715 — DeclarationHelper._addTopLevelDeclarations has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 10 (15 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._suggestProperty (cognitive 32) · ×1
  • DeclarationHelper._suggestProperty (cognitive 32) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2556 — DeclarationHelper._suggestProperty has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitPrimaryConstructorDeclaration (cognitive 32) · ×1
  • InScopeCompletionPass.visitPrimaryConstructorDeclaration (cognitive 32) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2576 — InScopeCompletionPass.visitPrimaryConstructorDeclaration has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 12 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddConst.compute (cognitive 32) · ×1
  • AddConst.compute (cognitive 32) pkg/analysis_server/lib/src/services/correction/dart/add_const.dart:32 — AddConst.compute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMissingEnumCaseClauses.compute (cognitive 32) · ×1
  • AddMissingEnumCaseClauses.compute (cognitive 32) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:26 — AddMissingEnumCaseClauses.compute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CreateMixin.compute (cognitive 32) · ×1
  • _CreateMixin.compute (cognitive 32) pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:134 — _CreateMixin.compute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, error handling 1 (5 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateContext._getInvocation (cognitive 32) · ×1
  • TemplateContext._getInvocation (cognitive 32) pkg/analysis_server/lib/src/services/correction/fix/data_driven/code_template.dart:81 — TemplateContext._getInvocation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextsPage.generateContent (cognitive 32) · ×1
  • ContextsPage.generateContent (cognitive 32) pkg/analysis_server/lib/src/status/pages/contexts_page.dart:37 — ContextsPage.generateContent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 5 (7 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisDriver._analyzeFileImpl (cognitive 32) · ×1
  • AnalysisDriver._analyzeFileImpl (cognitive 32) pkg/analyzer/lib/src/dart/analysis/driver.dart:1364 — AnalysisDriver._analyzeFileImpl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (10 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstLiteralVerifier._validateMapLiteralEntry (cognitive 32) · ×1
  • _ConstLiteralVerifier._validateMapLiteralEntry (cognitive 32) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1530 — _ConstLiteralVerifier._validateMapLiteralEntry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator._checkParameters (cognitive 32) · ×1
  • _ConstructorInvocationEvaluator._checkParameters (cognitive 32) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3353 — _ConstructorInvocationEvaluator._checkParameters has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (29 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UnknownInferredType.isUnknown (cognitive 32) · ×1
  • UnknownInferredType.isUnknown (cognitive 32) pkg/analyzer/lib/src/dart/element/type_schema.dart:84 — UnknownInferredType.isUnknown has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionReferenceResolver.resolveInstantiation (cognitive 32) · ×1
  • FunctionReferenceResolver.resolveInstantiation (cognitive 32) pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart:31 — FunctionReferenceResolver.resolveInstantiation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (8 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementUsageDetector._visitParametersAndArguments (cognitive 32) · ×1
  • ElementUsageDetector._visitParametersAndArguments (cognitive 32) pkg/analyzer/lib/src/error/element_usage_detector.dart:433 — ElementUsageDetector._visitParametersAndArguments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ElementUsageDetectorV2._visitParametersAndArguments) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ElementUsageDetectorV2._visitParametersAndArguments (cognitive 32) · ×1
  • ElementUsageDetectorV2._visitParametersAndArguments (cognitive 32) pkg/analyzer/lib/src/error/element_usage_detector.dart:914 — ElementUsageDetectorV2._visitParametersAndArguments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ElementUsageDetector._visitParametersAndArguments) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · IgnoreValidator.reportErrors (cognitive 32) · ×1
  • IgnoreValidator.reportErrors (cognitive 32) pkg/analyzer/lib/src/error/ignore_validator.dart:72 — IgnoreValidator.reportErrors has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._validateConstructorBodyAllowed (cognitive 32) · ×1
  • ErrorVerifier._validateConstructorBodyAllowed (cognitive 32) pkg/analyzer/lib/src/generated/error_verifier.dart:8529 — ErrorVerifier._validateConstructorBodyAllowed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 2 (8 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._validateNativeCallable (cognitive 32) · ×1
  • FfiVerifier._validateNativeCallable (cognitive 32) pkg/analyzer/lib/src/generated/ffi_verifier.dart:2098 — FfiVerifier._validateNativeCallable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimplyBoundedNode._visitType (cognitive 32) · ×1
  • SimplyBoundedNode._visitType (cognitive 32) pkg/analyzer/lib/src/summary2/simply_bounded.dart:269 — SimplyBoundedNode._visitType has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (7 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ElementSuggestionBuilder.addSuggestion (cognitive 32) · ×1
  • ElementSuggestionBuilder.addSuggestion (cognitive 32) pkg/analyzer_plugin/lib/src/utilities/completion/element_suggestion_builder.dart:35 — ElementSuggestionBuilder.addSuggestion has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 2 (10 pts), boolean chains 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FragmentEmitter.emitNativeSupport (cognitive 32) · ×1
  • FragmentEmitter.emitNativeSupport (cognitive 32) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:2274 — FragmentEmitter.emitNativeSupport has cognitive complexity 32 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 6 (13 pts), boolean chains 3 (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._buildParameterStub (cognitive 32) · ×1
  • KernelSsaGraphBuilder._buildParameterStub (cognitive 32) pkg/compiler/lib/src/ssa/builder.dart:1383 — KernelSsaGraphBuilder._buildParameterStub has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (26 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LibraryCompiler._emitClassProperties (cognitive 32) · ×1
  • LibraryCompiler._emitClassProperties (cognitive 32) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2796 — LibraryCompiler._emitClassProperties has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 3, loops 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler.compileExpression (cognitive 32) · ×1
  • IncrementalCompiler.compileExpression (cognitive 32) pkg/front_end/lib/src/base/incremental_compiler.dart:2027 — IncrementalCompiler.compileExpression has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl._buildConstructorInvocation (cognitive 32) · ×1
  • BodyBuilderImpl._buildConstructorInvocation (cognitive 32) pkg/front_end/lib/src/kernel/body_builder.dart:10765 — BodyBuilderImpl._buildConstructorInvocation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartScopeBuilder2._looksLikePatternMatching (cognitive 32) · ×1
  • DartScopeBuilder2._looksLikePatternMatching (cognitive 32) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:946 — DartScopeBuilder2._looksLikePatternMatching has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 13, loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InitializerBuilder.processInitializers (cognitive 32) · ×1
  • _InitializerBuilder.processInitializers (cognitive 32) pkg/front_end/lib/src/kernel/resolver_helpers.dart:230 — _InitializerBuilder.processInitializers has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.checkMixinSuperAccesses (cognitive 32) · ×1
  • SourceLoader.checkMixinSuperAccesses (cognitive 32) pkg/front_end/lib/src/source/source_loader.dart:2898 — SourceLoader.checkMixinSuperAccesses has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (19 pts), loops 4 (13 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperationsCfe.lookupMemberTypeInternal (cognitive 32) · ×1
  • OperationsCfe.lookupMemberTypeInternal (cognitive 32) pkg/front_end/lib/src/type_inference/type_inference_engine.dart:1190 — OperationsCfe.lookupMemberTypeInternal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 1 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResidentFrontendServer._generateCompilerOptions (cognitive 32) · ×1
  • ResidentFrontendServer._generateCompilerOptions (cognitive 32) pkg/frontend_server/lib/src/resident_frontend_server.dart:512 — ResidentFrontendServer._generateCompilerOptions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (23 pts), loops 5 (9 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · JsInteropChecks._checkDisallowedTearoff (cognitive 31) · ×1
  • JsInteropChecks._checkDisallowedTearoff (cognitive 31) pkg/_js_interop_checks/lib/js_interop_checks.dart:685 — JsInteropChecks._checkDisallowedTearoff has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionResult.group (cognitive 31) · ×1
  • CompletionResult.group (cognitive 31) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1777 — CompletionResult.group has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImplGenerator._generateConstructor (cognitive 31) · ×1
  • AstNodeImplGenerator._generateConstructor (cognitive 31) pkg/analyzer/tool/generators/ast_generator.dart:616 — AstNodeImplGenerator._generateConstructor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 2 (4 pts), loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ImplGenerator.generate (cognitive 31) · ×1
  • _ImplGenerator.generate (cognitive 31) pkg/analyzer/tool/summary/generate.dart:953 — _ImplGenerator.generate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Application._printOutput (cognitive 31) · ×1
  • Application._printOutput (cognitive 31) pkg/front_end/tool/parser_direct_ast/console_helper.dart:108 — Application._printOutput has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Analysis._calculateRetainers (cognitive 31) · ×1
  • Analysis._calculateRetainers (cognitive 31) pkg/heap_snapshot/lib/analysis.dart:720 — Analysis._calculateRetainers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy._buildDeclaredMembers (cognitive 31) · ×1
  • ClosedWorldClassHierarchy._buildDeclaredMembers (cognitive 31) pkg/kernel/lib/class_hierarchy.dart:1636 — ClosedWorldClassHierarchy._buildDeclaredMembers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VerifyingVisitor.visitFunctionNode (cognitive 31) · ×1
  • _VerifyingVisitor.visitFunctionNode (cognitive 31) pkg/kernel/lib/verifier.dart:1061 — _VerifyingVisitor.visitFunctionNode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 7, loops 2 (6 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _HttpClientResponse.redirect (cognitive 31) · ×1
  • _HttpClientResponse.redirect (cognitive 31) sdk/lib/_http/http_impl.dart:660 — _HttpClientResponse.redirect has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, error handling 1 (3 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder.convertChunked (cognitive 31) · ×1
  • _Utf8Decoder.convertChunked (cognitive 31) sdk/lib/_internal/vm/lib/convert_patch.dart:1869 — _Utf8Decoder.convertChunked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 4 (10 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegisterAllocationChecker.verifyConstraints (cognitive 31) · ×1
  • RegisterAllocationChecker.verifyConstraints (cognitive 31) pkg/native_compiler/lib/back_end/regalloc_checker.dart:45 — RegisterAllocationChecker.verifyConstraints has cognitive complexity 31 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 4 (11 pts), match/switch 1 (5 pts) (nesting depth added 21). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _Uri._makeHost (cognitive 31) · ×1
  • _Uri._makeHost (cognitive 31) sdk/lib/core/uri.dart:2397 — _Uri._makeHost has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 2 (9 pts), loops 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.parseEnum (cognitive 31) · ×1
  • Parser.parseEnum (cognitive 31) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:2605 — Parser.parseEnum has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseInitializer (cognitive 31) · ×1
  • Parser.parseInitializer (cognitive 31) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4817 — Parser.parseInitializer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextManagerImpl._createAnalysisContexts (cognitive 31) · ×1
  • ContextManagerImpl._createAnalysisContexts (cognitive 31) pkg/analysis_server/lib/src/context_manager.dart:691 — ContextManagerImpl._createAnalysisContexts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (10 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartCodeActionsProducer.getFixActions (cognitive 31) · ×1
  • DartCodeActionsProducer.getFixActions (cognitive 31) pkg/analysis_server/lib/src/lsp/handlers/code_actions/dart.dart:206 — DartCodeActionsProducer.getFixActions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._addMembersOfEnclosingInstance (cognitive 31) · ×1
  • DeclarationHelper._addMembersOfEnclosingInstance (cognitive 31) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1463 — DeclarationHelper._addMembersOfEnclosingInstance has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 11, loops 4, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitIfStatement (cognitive 31) · ×1
  • InScopeCompletionPass.visitIfStatement (cognitive 31) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1815 — InScopeCompletionPass.visitIfStatement has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkFixProcessor._computeFixes (cognitive 31) · ×1
  • BulkFixProcessor._computeFixes (cognitive 31) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:436 — BulkFixProcessor._computeFixes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToInitializingFormal.compute (cognitive 31) · ×1
  • ConvertToInitializingFormal.compute (cognitive 31) pkg/analysis_server/lib/src/services/correction/dart/convert_to_initializing_formal.dart:40 — ConvertToInitializingFormal.compute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 4 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeFieldPublic.compute (cognitive 31) · ×1
  • MakeFieldPublic.compute (cognitive 31) pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart:33 — MakeFieldPublic.compute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InitializeParametersVisitor.visitSimpleIdentifier (cognitive 31) · ×1
  • _InitializeParametersVisitor.visitSimpleIdentifier (cognitive 31) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:1478 — _InitializeParametersVisitor.visitSimpleIdentifier has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget (cognitive 31) · ×1
  • PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget (cognitive 31) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1023 — PropertyElementResolver.resolveReceiverPropertyReadWriteAssignmentTarget has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ImportsVerifier.generateUnusedShownNameHints (cognitive 31) · ×1
  • ImportsVerifier.generateUnusedShownNameHints (cognitive 31) pkg/analyzer/lib/src/error/imports_verifier.dart:302 — ImportsVerifier.generateUnusedShownNameHints has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportsVerifier._findAncestorDuplicate (cognitive 31) · ×1
  • ImportsVerifier._findAncestorDuplicate (cognitive 31) pkg/analyzer/lib/src/error/imports_verifier.dart:491 — ImportsVerifier._findAncestorDuplicate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (7 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DumpInfoTask.buildDumpInfoDataNew (cognitive 31) · ×1
  • DumpInfoTask.buildDumpInfoDataNew (cognitive 31) pkg/compiler/lib/src/dump_info.dart:1913 — DumpInfoTask.buildDumpInfoDataNew has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 6 (9 pts), ternaries 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeMask.getNotNormalizedReason (cognitive 31) · ×1
  • TypeMask.getNotNormalizedReason (cognitive 31) pkg/compiler/lib/src/inferrer/typemasks/type_mask.dart:526 — TypeMask.getNotNormalizedReason has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeTypesImpl.computeRequiredChecks (cognitive 31) · ×1
  • RuntimeTypesImpl.computeRequiredChecks (cognitive 31) pkg/compiler/lib/src/js_backend/runtime_types.dart:534 — RuntimeTypesImpl.computeRequiredChecks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 9 (12 pts), boolean chains 2, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelToElementMap._ensureSupertypes (cognitive 31) · ×1
  • KernelToElementMap._ensureSupertypes (cognitive 31) pkg/compiler/lib/src/kernel/element_map_impl.dart:355 — KernelToElementMap._ensureSupertypes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (10 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitInvokeStatic (cognitive 31) · ×1
  • SsaCodeGenerator.visitInvokeStatic (cognitive 31) pkg/compiler/lib/src/ssa/codegen.dart:2323 — SsaCodeGenerator.visitInvokeStatic has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitInvokeExternal (cognitive 31) · ×1
  • SsaCodeGenerator.visitInvokeExternal (cognitive 31) pkg/compiler/lib/src/ssa/codegen.dart:2901 — SsaCodeGenerator.visitInvokeExternal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassSet.addSubtype (cognitive 31) · ×1
  • ClassSet.addSubtype (cognitive 31) pkg/compiler/lib/src/universe/class_set.dart:780 — ClassSet.addSubtype has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecutableCompiler.isSnapshotFresh (cognitive 31) · ×1
  • ExecutableCompiler.isSnapshotFresh (cognitive 31) pkg/dartdev/lib/src/executable_compiler.dart:131 — ExecutableCompiler.isSnapshotFresh has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 8, error handling 2 (3 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.parsePrimary (cognitive 31) · ×1
  • MiniJsParser.parsePrimary (cognitive 31) pkg/dev_compiler/lib/src/js_ast/builder.dart:866 — MiniJsParser.parsePrimary has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.parseCall (cognitive 31) · ×1
  • MiniJsParser.parseCall (cognitive 31) pkg/dev_compiler/lib/src/js_ast/builder.dart:1104 — MiniJsParser.parseCall has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._computeExpressionCompilationExtensionData (cognitive 31) · ×1
  • IncrementalCompiler._computeExpressionCompilationExtensionData (cognitive 31) pkg/front_end/lib/src/base/incremental_compiler.dart:2420 — IncrementalCompiler._computeExpressionCompilationExtensionData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantEvaluator._handleFromEnvironment (cognitive 31) · ×1
  • ConstantEvaluator._handleFromEnvironment (cognitive 31) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5109 — ConstantEvaluator._handleFromEnvironment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (29 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstMapLiteralBuilder.translate (cognitive 31) · ×1
  • _ConstMapLiteralBuilder.translate (cognitive 31) pkg/front_end/lib/src/type_inference/collection_encoding.dart:333 — _ConstMapLiteralBuilder.translate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 2 (4 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cache.createExpression (cognitive 31) · ×1
  • Cache.createExpression (cognitive 31) pkg/front_end/lib/src/type_inference/matching_cache.dart:1249 — Cache.createExpression has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BestEffortParserAstVisitor.accept (cognitive 31) · ×1
  • BestEffortParserAstVisitor.accept (cognitive 31) pkg/front_end/lib/src/util/parser_ast.dart:124 — BestEffortParserAstVisitor.accept has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _Visitor.visitInstanceCreationExpression (cognitive 31) · ×1
  • _Visitor.visitInstanceCreationExpression (cognitive 31) pkg/linter/lib/src/rules/prefer_collection_literals.dart:40 — _Visitor.visitInstanceCreationExpression has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitDeclaredVariablePattern (cognitive 31) · ×1
  • _Visitor.visitDeclaredVariablePattern (cognitive 31) pkg/linter/lib/src/rules/prefer_final_locals.dart:78 — _Visitor.visitDeclaredVariablePattern has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkConstructor (cognitive 31) · ×1
  • _Visitor._checkConstructor (cognitive 31) pkg/linter/lib/src/rules/tighten_type_of_initializing_formals.dart:69 — _Visitor._checkConstructor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BulkFixDetails.collectOverrides (cognitive 30) · ×1
  • BulkFixDetails.collectOverrides (cognitive 30) pkg/analysis_server/tool/bulk_fix/parse_utils.dart:14 — BulkFixDetails.collectOverrides has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (22 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Analysis.examine (cognitive 30) · ×1
  • Analysis.examine (cognitive 30) pkg/heap_snapshot/lib/analysis.dart:127 — Analysis.examine has cognitive complexity 30 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 8 (13 pts), boolean chains 3 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Primitives.applyFunction (cognitive 30) · ×1
  • Primitives.applyFunction (cognitive 30) sdk/lib/_internal/js_runtime/lib/js_helper.dart:980 — Primitives.applyFunction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseStringToBuffer (cognitive 30) · ×1
  • _ChunkedJsonParser.parseStringToBuffer (cognitive 30) sdk/lib/_internal/vm/lib/convert_patch.dart:1125 — _ChunkedJsonParser.parseStringToBuffer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64Assembler.loadImmediate (cognitive 30) · ×1
  • Arm64Assembler.loadImmediate (cognitive 30) pkg/native_compiler/lib/back_end/arm64/assembler.dart:631 — Arm64Assembler.loadImmediate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 4 (6 pts), ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitSimdOp (cognitive 30) · ×1
  • Arm64CodeGenerator.visitSimdOp (cognitive 30) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2649 — Arm64CodeGenerator.visitSimdOp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _Base64Decoder._checkPadding (cognitive 30) · ×1
  • _Base64Decoder._checkPadding (cognitive 30) sdk/lib/convert/base64.dart:846 — _Base64Decoder._checkPadding has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CorrectionUtils._invertCondition0 (cognitive 30) · ×1
  • CorrectionUtils._invertCondition0 (cognitive 30) pkg/analysis_server_plugin/lib/edit/correction_utils.dart:346 — CorrectionUtils._invertCondition0 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (30 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReducedWitnesses._computeDefaultWitnesses (cognitive 30) · ×1
  • ReducedWitnesses._computeDefaultWitnesses (cognitive 30) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart:765 — ReducedWitnesses._computeDefaultWitnesses has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionIdentifierContext.ensureIdentifier (cognitive 30) · ×1
  • ExpressionIdentifierContext.ensureIdentifier (cognitive 30) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:390 — ExpressionIdentifierContext.ensureIdentifier has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 18, if/else 8 (12 pts) (nesting depth added 4). 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.
D2 · Cognitive Complexity · Parser.parseRecordType (cognitive 30) · ×1
  • Parser.parseRecordType (cognitive 30) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:1738 — Parser.parseRecordType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered (cognitive 30) · ×1
  • ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered (cognitive 30) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:882 — ComplexTypeInfo._checkIfRecordTypeParenthesisAreRecovered has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StringCanonicalizer.pruneTo (cognitive 30) · ×1
  • _StringCanonicalizer.pruneTo (cognitive 30) pkg/_fe_analyzer_shared/lib/src/scanner/string_canonicalizer.dart:304 — _StringCanonicalizer.pruneTo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzerOperationsMixin.chooseTypeFromConstraint (cognitive 30) · ×1
  • TypeAnalyzerOperationsMixin.chooseTypeFromConstraint (cognitive 30) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1014 — TypeAnalyzerOperationsMixin.chooseTypeFromConstraint has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (12 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitHighlightsComputer._addCommentRanges (cognitive 30) · ×1
  • DartUnitHighlightsComputer._addCommentRanges (cognitive 30) pkg/analysis_server/lib/src/computer/computer_highlights.dart:69 — DartUnitHighlightsComputer._addCommentRanges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditBulkFixes.handle (cognitive 30) · ×1
  • EditBulkFixes.handle (cognitive 30) pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart:22 — EditBulkFixes.handle has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerformRefactorCommandHandler.execute (cognitive 30) · ×1
  • PerformRefactorCommandHandler.execute (cognitive 30) pkg/analysis_server/lib/src/lsp/handlers/commands/perform_refactor.dart:32 — PerformRefactorCommandHandler.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _DebounceRequests._filterRequests (cognitive 30) · ×1
  • _DebounceRequests._filterRequests (cognitive 30) pkg/analysis_server/lib/src/server/debounce_requests.dart:65 — _DebounceRequests._filterRequests has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkFixProcessor._fixErrorsInLibraryUnit (cognitive 30) · ×1
  • BulkFixProcessor._fixErrorsInLibraryUnit (cognitive 30) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:612 — BulkFixProcessor._fixErrorsInLibraryUnit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 10, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddSuperConstructorInvocation._producersFromPrimary (cognitive 30) · ×1
  • AddSuperConstructorInvocation._producersFromPrimary (cognitive 30) pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart:86 — AddSuperConstructorInvocation._producersFromPrimary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertMapFromIterableToForLiteral._extractClosure (cognitive 30) · ×1
  • ConvertMapFromIterableToForLiteral._extractClosure (cognitive 30) pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart:179 — ConvertMapFromIterableToForLiteral._extractClosure has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (28 pts), boolean chains 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _MatcherBuilder._buildFromSimpleIdentifier (cognitive 30) · ×1
  • _MatcherBuilder._buildFromSimpleIdentifier (cognitive 30) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:643 — _MatcherBuilder._buildFromSimpleIdentifier has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 9 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MoveFileRefactoringImpl._collectSourceReferences (cognitive 30) · ×1
  • MoveFileRefactoringImpl._collectSourceReferences (cognitive 30) pkg/analysis_server/lib/src/services/refactoring/legacy/move_file.dart:195 — MoveFileRefactoringImpl._collectSourceReferences has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (11 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginsPage._emitIncompatibleInfo (cognitive 30) · ×1
  • PluginsPage._emitIncompatibleInfo (cognitive 30) pkg/analysis_server/lib/src/status/pages/plugins_page.dart:83 — PluginsPage._emitIncompatibleInfo has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 4 (12 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ExpressionImpl.constantContext2 (cognitive 30) · ×1
  • ExpressionImpl.constantContext2 (cognitive 30) pkg/analyzer/lib/src/dart/ast/ast.dart:19653 — ExpressionImpl.constantContext2 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._checkFfiNative (cognitive 30) · ×1
  • FfiVerifier._checkFfiNative (cognitive 30) pkg/analyzer/lib/src/generated/ffi_verifier.dart:634 — FfiVerifier._checkFfiNative has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LocalDeclarationVisitor._visitStatements (cognitive 30) · ×1
  • LocalDeclarationVisitor._visitStatements (cognitive 30) pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:449 — LocalDeclarationVisitor._visitStatements has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (5 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · KClassEnv._ensureMaps (cognitive 30) · ×1
  • KClassEnv._ensureMaps (cognitive 30) pkg/compiler/lib/src/kernel/env.dart:243 — KClassEnv._ensureMaps has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelAnnotationProcessor.extractJsInteropAnnotations (cognitive 30) · ×1
  • KernelAnnotationProcessor.extractJsInteropAnnotations (cognitive 30) pkg/compiler/lib/src/kernel/native_basic_data.dart:75 — KernelAnnotationProcessor.extractJsInteropAnnotations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Maplet.[]= (cognitive 30) · ×1
  • Maplet.[]= (cognitive 30) pkg/compiler/lib/src/util/maplet.dart:95 — Maplet.[]= has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProtocolConverter.convertVmInstanceRefToDisplayString (cognitive 30) · ×1
  • ProtocolConverter.convertVmInstanceRefToDisplayString (cognitive 30) pkg/dap_adapters/lib/src/protocol_converter.dart:45 — ProtocolConverter.convertVmInstanceRefToDisplayString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartRuntimeServiceDdsBackend.initialize (cognitive 30) · ×1
  • DartRuntimeServiceDdsBackend.initialize (cognitive 30) pkg/dart_runtime_service_dds/lib/src/dds_backend.dart:169 — DartRuntimeServiceDdsBackend.initialize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (6 pts), ternaries 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsBuilder.escapedString (cognitive 30) · ×1
  • JsBuilder.escapedString (cognitive 30) pkg/dev_compiler/lib/src/js_ast/builder.dart:288 — JsBuilder.escapedString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 11, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._is31BitUnsigned (cognitive 30) · ×1
  • ProgramCompiler._is31BitUnsigned (cognitive 30) pkg/dev_compiler/lib/src/kernel/compiler.dart:6280 — ProgramCompiler._is31BitUnsigned has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryCompiler._is31BitUnsigned (cognitive 30) · ×1
  • LibraryCompiler._is31BitUnsigned (cognitive 30) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6969 — LibraryCompiler._is31BitUnsigned has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExpressionCompiler._findScopeAt (cognitive 30) · ×1
  • ExpressionCompiler._findScopeAt (cognitive 30) pkg/dev_compiler/lib/src/kernel/expression_compiler.dart:328 — ExpressionCompiler._findScopeAt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endFormalParameters (cognitive 30) · ×1
  • BodyBuilderImpl.endFormalParameters (cognitive 30) pkg/front_end/lib/src/kernel/body_builder.dart:3951 — BodyBuilderImpl.endFormalParameters has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endRecordLiteral (cognitive 30) · ×1
  • BodyBuilderImpl.endRecordLiteral (cognitive 30) pkg/front_end/lib/src/kernel/body_builder.dart:5102 — BodyBuilderImpl.endRecordLiteral has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantsTransformer.visitRecordLiteral (cognitive 30) · ×1
  • ConstantsTransformer.visitRecordLiteral (cognitive 30) pkg/front_end/lib/src/kernel/constant_evaluator.dart:2344 — ConstantsTransformer.visitRecordLiteral has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.buildOutlines (cognitive 30) · ×1
  • SourceLoader.buildOutlines (cognitive 30) pkg/front_end/lib/src/source/source_loader.dart:1346 — SourceLoader.buildOutlines has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (9 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReferenceName.fromNamedNode (cognitive 30) · ×1
  • ReferenceName.fromNamedNode (cognitive 30) pkg/kernel/lib/src/equivalence_helpers.dart:253 — ReferenceName.fromNamedNode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (30 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkTopLevelFragment (cognitive 30) · ×1
  • _Visitor._checkTopLevelFragment (cognitive 30) pkg/linter/lib/src/rules/analyzer_public_api.dart:162 — _Visitor._checkTopLevelFragment has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 6 (10 pts), boolean chains 3, match/switch 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DebuggerLocation._parseFunction (cognitive 30) · ×1
  • DebuggerLocation._parseFunction (cognitive 30) pkg/observatory/lib/src/debugger/debugger_location.dart:243 — DebuggerLocation._parseFunction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (7 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceEvent._update (cognitive 30) · ×1
  • ServiceEvent._update (cognitive 30) pkg/observatory/lib/src/service/object.dart:2342 — ServiceEvent._update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Event.toJson (cognitive 30) · ×1
  • Event.toJson (cognitive 30) pkg/vm_service/lib/src/vm_service.dart:4183 — Event.toJson has cognitive complexity 30 (threshold 15). Drivers by points: if/else 30. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConfigurationFilesMixin.writePackageConfig2 (cognitive 29) · ×1
  • ConfigurationFilesMixin.writePackageConfig2 (cognitive 29) pkg/analyzer_testing/lib/configuration_files_mixin.dart:54 — ConfigurationFilesMixin.writePackageConfig2 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TextFormatter.add (cognitive 29) · ×1
  • _TextFormatter.add (cognitive 29) pkg/analyzer_utilities/lib/text_formatter.dart:58 — _TextFormatter.add has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 2 (6 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Translator.translateExternalStorageType (cognitive 29) · ×1
  • Translator.translateExternalStorageType (cognitive 29) pkg/dart2wasm/lib/translator.dart:1236 — Translator.translateExternalStorageType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 5, loops 1 (4 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Translator.convertType (cognitive 29) · ×1
  • Translator.convertType (cognitive 29) pkg/dart2wasm/lib/translator.dart:1598 — Translator.convertType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendCompiler.writePackagesToSinkAndTrimComponent (cognitive 29) · ×1
  • FrontendCompiler.writePackagesToSinkAndTrimComponent (cognitive 29) pkg/frontend_server/lib/frontend_server.dart:1631 — FrontendCompiler.writePackagesToSinkAndTrimComponent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 8 (14 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VerifyingVisitor._computeExtensionMembers (cognitive 29) · ×1
  • _VerifyingVisitor._computeExtensionMembers (cognitive 29) pkg/kernel/lib/verifier.dart:579 — _VerifyingVisitor._computeExtensionMembers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_VerifyingVisitor._computeExtensionTypeMembers) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _VerifyingVisitor._computeExtensionTypeMembers (cognitive 29) · ×1
  • _VerifyingVisitor._computeExtensionTypeMembers (cognitive 29) pkg/kernel/lib/verifier.dart:643 — _VerifyingVisitor._computeExtensionTypeMembers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_VerifyingVisitor._computeExtensionMembers) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _HttpOutgoing.addStream (cognitive 29) · ×1
  • _HttpOutgoing.addStream (cognitive 29) sdk/lib/_http/http_impl.dart:1884 — _HttpOutgoing.addStream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _GrowableList.addAll (cognitive 29) · ×1
  • _GrowableList.addAll (cognitive 29) sdk/lib/_internal/vm/lib/growable_array.dart:296 — _GrowableList.addAll has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Timer._runTimers (cognitive 29) · ×1
  • _Timer._runTimers (cognitive 29) sdk/lib/_internal/vm/lib/timer_impl.dart:377 — _Timer._runTimers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BinaryPrinter.writeStringTable (cognitive 29) · ×1
  • BinaryPrinter.writeStringTable (cognitive 29) pkg/kernel/lib/binary/ast_to_binary.dart:146 — BinaryPrinter.writeStringTable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryPrinter.writeConstantTableEntry (cognitive 29) · ×1
  • BinaryPrinter.writeConstantTableEntry (cognitive 29) pkg/kernel/lib/binary/ast_to_binary.dart:232 — BinaryPrinter.writeConstantTableEntry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, loops 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _SimpleUri.replace (cognitive 29) · ×1
  • _SimpleUri.replace (cognitive 29) sdk/lib/core/uri.dart:4746 — _SimpleUri.replace has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _FfiDefinitionTransformer._checkFieldAnnotations (cognitive 29) · ×1
  • _FfiDefinitionTransformer._checkFieldAnnotations (cognitive 29) pkg/vm/lib/modular/transformations/ffi/definitions.dart:462 — _FfiDefinitionTransformer._checkFieldAnnotations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, error handling 1 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeTypeCfe.NativeTypeCfe (cognitive 29) · ×1
  • NativeTypeCfe.NativeTypeCfe (cognitive 29) pkg/vm/lib/modular/transformations/ffi/native_type_cfe.dart:19 — NativeTypeCfe.NativeTypeCfe has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiUseSiteTransformer._verifyAndReplaceNativeCallable (cognitive 29) · ×1
  • _FfiUseSiteTransformer._verifyAndReplaceNativeCallable (cognitive 29) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:1316 — _FfiUseSiteTransformer._verifyAndReplaceNativeCallable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lowering.visitComparison (cognitive 29) · ×1
  • Lowering.visitComparison (cognitive 29) pkg/native_compiler/lib/passes/lowering.dart:95 — Lowering.visitComparison has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 8, ternaries 2 (8 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ComplexTypeParamOrArgInfo.parseVariables (cognitive 29) · ×1
  • ComplexTypeParamOrArgInfo.parseVariables (cognitive 29) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1481 — ComplexTypeParamOrArgInfo.parseVariables has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.analyzeSwitchStatement (cognitive 29) · ×1
  • TypeAnalyzer.analyzeSwitchStatement (cognitive 29) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:2508 — TypeAnalyzer.analyzeSwitchStatement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DependencyWalker.walk (cognitive 29) · ×1
  • DependencyWalker.walk (cognitive 29) pkg/_fe_analyzer_shared/lib/src/util/dependency_walker.dart:24 — DependencyWalker.walk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember (cognitive 29) · ×1
  • JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember (cognitive 29) pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart:301 — JsUtilOptimizer._getPrefixSelectorsForStaticallyResolvableMember has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryElementSuggestionBuilder._visitInterfaceElement (cognitive 29) · ×1
  • LibraryElementSuggestionBuilder._visitInterfaceElement (cognitive 29) pkg/analysis_server/lib/src/cider/local_library_contributor.dart:207 — LibraryElementSuggestionBuilder._visitInterfaceElement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CodeActionComputer._computeActions (cognitive 29) · ×1
  • CodeActionComputer._computeActions (cognitive 29) pkg/analysis_server/lib/src/lsp/handlers/code_actions/code_action_computer.dart:210 — CodeActionComputer._computeActions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._addInstanceMembers (cognitive 29) · ×1
  • DeclarationHelper._addInstanceMembers (cognitive 29) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1207 — DeclarationHelper._addInstanceMembers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitPrefixedIdentifier (cognitive 29) · ×1
  • InScopeCompletionPass.visitPrefixedIdentifier (cognitive 29) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2512 — InScopeCompletionPass.visitPrefixedIdentifier has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 4 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · KeywordHelper.addImportDirectiveKeywords (cognitive 29) · ×1
  • KeywordHelper.addImportDirectiveKeywords (cognitive 29) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:543 — KeywordHelper.addImportDirectiveKeywords has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AmbiguousImportFix._getImportDirectives (cognitive 29) · ×1
  • AmbiguousImportFix._getImportDirectives (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:84 — AmbiguousImportFix._getImportDirectives has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertIntoGetter.compute (cognitive 29) · ×1
  • ConvertIntoGetter.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart:41 — ConvertIntoGetter.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToBooleanExpression.compute (cognitive 29) · ×1
  • ConvertToBooleanExpression.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/convert_to_boolean_expression.dart:28 — ConvertToBooleanExpression.compute has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 5 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CreateConstructor._computeWithoutSuperParameters (cognitive 29) · ×1
  • _CreateConstructor._computeWithoutSuperParameters (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:96 — _CreateConstructor._computeWithoutSuperParameters has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreateExtensionOperator.compute (cognitive 29) · ×1
  • CreateExtensionOperator.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:354 — CreateExtensionOperator.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreateGetter.compute (cognitive 29) · ×1
  • CreateGetter.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart:131 — CreateGetter.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateOperator.compute (cognitive 29) · ×1
  • CreateOperator.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/create_operator.dart:33 — CreateOperator.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImportLibrary._otherUnresolvedNames (cognitive 29) · ×1
  • ImportLibrary._otherUnresolvedNames (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/import_library.dart:820 — ImportLibrary._otherUnresolvedNames has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveIgnoredDiagnostic.compute (cognitive 29) · ×1
  • RemoveIgnoredDiagnostic.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/remove_ignored_diagnostic.dart:31 — RemoveIgnoredDiagnostic.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveThisAlias.compute (cognitive 29) · ×1
  • RemoveThisAlias.compute (cognitive 29) pkg/analysis_server/lib/src/services/correction/dart/remove_this_alias.dart:33 — RemoveThisAlias.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MoveTopLevelToFile.compute (cognitive 29) · ×1
  • MoveTopLevelToFile.compute (cognitive 29) pkg/analysis_server/lib/src/services/refactoring/move_top_level_to_file.dart:84 — MoveTopLevelToFile.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 9 (14 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogSanitizer._sanitizeParams (cognitive 29) · ×1
  • LogSanitizer._sanitizeParams (cognitive 29) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:675 — LogSanitizer._sanitizeParams has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _ParsedExpressionBuilder.build (cognitive 29) · ×1
  • _ParsedExpressionBuilder.build (cognitive 29) pkg/analyzer/lib/src/dart/ast/ast.dart:64690 — _ParsedExpressionBuilder.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer._reportNotEnoughPositionalArguments (cognitive 29) · ×1
  • TypeAnalyzer._reportNotEnoughPositionalArguments (cognitive 29) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5982 — TypeAnalyzer._reportNotEnoughPositionalArguments has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InvalidAccessVerifier._checkForOtherInvalidAccess (cognitive 29) · ×1
  • _InvalidAccessVerifier._checkForOtherInvalidAccess (cognitive 29) pkg/analyzer/lib/src/error/best_practices_verifier.dart:2081 — _InvalidAccessVerifier._checkForOtherInvalidAccess has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LanguageVersionOverrideVerifier._verifyMisplaced (cognitive 29) · ×1
  • LanguageVersionOverrideVerifier._verifyMisplaced (cognitive 29) pkg/analyzer/lib/src/error/language_version_override_verifier.dart:301 — LanguageVersionOverrideVerifier._verifyMisplaced has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (8 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeArgumentsVerifier._checkTypeArgumentConst (cognitive 29) · ×1
  • TypeArgumentsVerifier._checkTypeArgumentConst (cognitive 29) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:612 — TypeArgumentsVerifier._checkTypeArgumentConst has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (7 pts), match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DocCommentBuilder._parseOneCommentReference (cognitive 29) · ×1
  • DocCommentBuilder._parseOneCommentReference (cognitive 29) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:605 — DocCommentBuilder._parseOneCommentReference has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MissingDependencyValidator.validate (cognitive 29) · ×1
  • MissingDependencyValidator.validate (cognitive 29) pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart:60 — MissingDependencyValidator.validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (9 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl.writeFormalParameters (cognitive 29) · ×1
  • DartEditBuilderImpl.writeFormalParameters (cognitive 29) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:405 — DartEditBuilderImpl.writeFormalParameters has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommonMasks._createFromStaticType (cognitive 29) · ×1
  • CommonMasks._createFromStaticType (cognitive 29) pkg/compiler/lib/src/inferrer/typemasks/masks.dart:332 — CommonMasks._createFromStaticType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SizeEstimator.visitAssignment (cognitive 29) · ×1
  • SizeEstimator.visitAssignment (cognitive 29) pkg/compiler/lib/src/js/size_estimator.dart:566 — SizeEstimator.visitAssignment has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 6 (12 pts) (nesting depth added 6). 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.
D2 · Cognitive Complexity · ResolutionEnqueuerListener.registerUsedElement (cognitive 29) · ×1
  • ResolutionEnqueuerListener.registerUsedElement (cognitive 29) pkg/compiler/lib/src/js_backend/resolution_listener.dart:293 — ResolutionEnqueuerListener.registerUsedElement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._handleCreateInvocationMirror (cognitive 29) · ×1
  • KernelSsaGraphBuilder._handleCreateInvocationMirror (cognitive 29) pkg/compiler/lib/src/ssa/builder.dart:5579 — KernelSsaGraphBuilder._handleCreateInvocationMirror has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (12 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitBitOr (cognitive 29) · ×1
  • SsaInstructionSimplifier.visitBitOr (cognitive 29) pkg/compiler/lib/src/ssa/optimize.dart:2858 — SsaInstructionSimplifier.visitBitOr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 5 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaGlobalValueNumberer.visitBasicBlock (cognitive 29) · ×1
  • SsaGlobalValueNumberer.visitBasicBlock (cognitive 29) pkg/compiler/lib/src/ssa/optimize.dart:3813 — SsaGlobalValueNumberer.visitBasicBlock has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setlet.add (cognitive 29) · ×1
  • Setlet.add (cognitive 29) pkg/compiler/lib/src/util/setlet.dart:88 — Setlet.add has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixCommand.run (cognitive 29) · ×1
  • FixCommand.run (cognitive 29) pkg/dartdev/lib/src/commands/fix.dart:97 — FixCommand.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, ternaries 5 (7 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NamedTypeBuilderImpl.substituteRange (cognitive 29) · ×1
  • NamedTypeBuilderImpl.substituteRange (cognitive 29) pkg/front_end/lib/src/builder/named_type_builder.dart:998 — NamedTypeBuilderImpl.substituteRange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.checkAssert (cognitive 29) · ×1
  • ConstantEvaluator.checkAssert (cognitive 29) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3917 — ConstantEvaluator.checkAssert has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (29 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitLogicalExpression (cognitive 29) · ×1
  • ConstantEvaluator.visitLogicalExpression (cognitive 29) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4613 — ConstantEvaluator.visitLogicalExpression has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 2, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DynamicModuleValidator._expandNode (cognitive 29) · ×1
  • _DynamicModuleValidator._expandNode (cognitive 29) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:503 — _DynamicModuleValidator._expandNode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 5 (10 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · OutlineBuilder.endConstructor (cognitive 29) · ×1
  • OutlineBuilder.endConstructor (cognitive 29) pkg/front_end/lib/src/source/outline_builder.dart:2589 — OutlineBuilder.endConstructor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MiniJsParser.parsePrimary (cognitive 29) · ×1
  • MiniJsParser.parsePrimary (cognitive 29) pkg/js_ast/lib/src/builder.dart:790 — MiniJsParser.parsePrimary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (27 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.visitAssignment (cognitive 29) · ×1
  • Printer.visitAssignment (cognitive 29) pkg/js_ast/lib/src/printer.dart:922 — Printer.visitAssignment has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 6 (12 pts) (nesting depth added 6). 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.
D2 · Cognitive Complexity · StandardBounds.getStandardUpperBoundInternal (cognitive 29) · ×1
  • StandardBounds.getStandardUpperBoundInternal (cognitive 29) pkg/kernel/lib/src/standard_bounds.dart:593 — StandardBounds.getStandardUpperBoundInternal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (8 pts), match/switch 2 (4 pts), loops 1 (3 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Pdb._read (cognitive 29) · ×1
  • Pdb._read (cognitive 29) pkg/native_stack_traces/lib/src/pdb.dart:812 — Pdb._read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (9 pts), boolean chains 3, ternaries 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VmServerConnection._delegateRequest (cognitive 29) · ×1
  • VmServerConnection._delegateRequest (cognitive 29) pkg/vm_service_interface/lib/src/vm_service_interface.dart:1403 — VmServerConnection._delegateRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (9 pts), error handling 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DFilterExpression.evaluate (cognitive 29) · ×1
  • DFilterExpression.evaluate (cognitive 29) runtime/tools/heapsnapshot/lib/src/expression.dart:53 — DFilterExpression.evaluate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SummaryNormalizer._normalizeExpr (cognitive 29) · ×1
  • _SummaryNormalizer._normalizeExpr (cognitive 29) pkg/vm/lib/transformations/type_flow/summary_collector.dart:202 — _SummaryNormalizer._normalizeExpr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox (cognitive 29) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox (cognitive 29) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:774 — D3SymbolTreeMap.D3SymbolTreeMap._showInfoBox has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 13). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · graphexplorer.Graph.rewriteEdgesForOwners (cognitive 29) · ×1
  • graphexplorer.Graph.rewriteEdgesForOwners (cognitive 29) runtime/tools/graphexplorer/graphexplorer.js:381 — graphexplorer.Graph.rewriteEdgesForOwners has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 6 (9 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImpliedTypeComputer._computeInContext (cognitive 28) · ×1
  • ImpliedTypeComputer._computeInContext (cognitive 28) pkg/analysis_server/tool/code_completion/implicit_type_declarations.dart:164 — ImpliedTypeComputer._computeInContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (7 pts), error handling 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelevanceMetricsComputer._computeInContext (cognitive 28) · ×1
  • RelevanceMetricsComputer._computeInContext (cognitive 28) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:2187 — RelevanceMetricsComputer._computeInContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (7 pts), error handling 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImplGenerator._removeGeneratedMembers (cognitive 28) · ×1
  • AstNodeImplGenerator._removeGeneratedMembers (cognitive 28) pkg/analyzer/tool/generators/ast_generator.dart:1295 — AstNodeImplGenerator._removeGeneratedMembers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 4 (6 pts), match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CodeGenerator._addFieldForGetter (cognitive 28) · ×1
  • _CodeGenerator._addFieldForGetter (cognitive 28) pkg/analyzer/tool/summary/generate.dart:732 — _CodeGenerator._addFieldForGetter has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator.defaultMember (cognitive 28) · ×1
  • BytecodeGenerator.defaultMember (cognitive 28) pkg/dart2bytecode/lib/bytecode_generator.dart:827 — BytecodeGenerator.defaultMember has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDeclaration.toString (cognitive 28) · ×1
  • FunctionDeclaration.toString (cognitive 28) pkg/dart2bytecode/lib/declarations.dart:710 — FunctionDeclaration.toString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AstCompilationTask.run (cognitive 28) · ×1
  • AstCompilationTask.run (cognitive 28) pkg/dart2wasm/lib/translator.dart:2842 — AstCompilationTask.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpOutgoing.writeHeaders (cognitive 28) · ×1
  • _HttpOutgoing.writeHeaders (cognitive 28) sdk/lib/_http/http_impl.dart:1833 — _HttpOutgoing.writeHeaders has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncStarIterator.moveNext (cognitive 28) · ×1
  • _SyncStarIterator.moveNext (cognitive 28) sdk/lib/_internal/js_runtime/lib/async_patch.dart:648 — _SyncStarIterator.moveNext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BoxedDouble.compareTo (cognitive 28) · ×1
  • BoxedDouble.compareTo (cognitive 28) sdk/lib/_internal/wasm/common/boxed_double.dart:342 — BoxedDouble.compareTo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.evictIntersection (cognitive 28) · ×1
  • LinearScanRegisterAllocator.evictIntersection (cognitive 28) pkg/native_compiler/lib/back_end/register_allocator.dart:880 — LinearScanRegisterAllocator.evictIntersection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri._parseIPv4Address (cognitive 28) · ×1
  • Uri._parseIPv4Address (cognitive 28) sdk/lib/core/uri.dart:1429 — Uri._parseIPv4Address has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._uriDecode (cognitive 28) · ×1
  • _Uri._uriDecode (cognitive 28) sdk/lib/core/uri.dart:3619 — _Uri._uriDecode has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseParenthesizedExpressionOrRecordLiteral (cognitive 28) · ×1
  • Parser.parseParenthesizedExpressionOrRecordLiteral (cognitive 28) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8312 — Parser.parseParenthesizedExpressionOrRecordLiteral has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseConstExpression (cognitive 28) · ×1
  • Parser.parseConstExpression (cognitive 28) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9042 — Parser.parseConstExpression has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartCodeActionsProducer.getRefactorActions (cognitive 28) · ×1
  • DartCodeActionsProducer.getRefactorActions (cognitive 28) pkg/analysis_server/lib/src/lsp/handlers/code_actions/dart.dart:317 — DartCodeActionsProducer.getRefactorActions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitFieldDeclaration (cognitive 28) · ×1
  • InScopeCompletionPass.visitFieldDeclaration (cognitive 28) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1383 — InScopeCompletionPass.visitFieldDeclaration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkFixProcessor.fixErrorsUsingParsedResult (cognitive 28) · ×1
  • BulkFixProcessor.fixErrorsUsingParsedResult (cognitive 28) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:286 — BulkFixProcessor.fixErrorsUsingParsedResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertDocumentationIntoLine.compute (cognitive 28) · ×1
  • ConvertDocumentationIntoLine.compute (cognitive 28) pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_line.dart:32 — ConvertDocumentationIntoLine.compute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConvertQuotes._fixBackslashesForQuotes (cognitive 28) · ×1
  • _ConvertQuotes._fixBackslashesForQuotes (cognitive 28) pkg/analysis_server/lib/src/services/correction/dart/convert_quotes.dart:146 — _ConvertQuotes._fixBackslashesForQuotes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CreateExtensionMethod.compute (cognitive 28) · ×1
  • CreateExtensionMethod.compute (cognitive 28) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:169 — CreateExtensionMethod.compute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 4, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ReplaceReturnType.compute (cognitive 28) · ×1
  • ReplaceReturnType.compute (cognitive 28) pkg/analysis_server/lib/src/services/correction/dart/replace_return_type.dart:31 — ReplaceReturnType.compute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LogSanitizer.sanitizePath (cognitive 28) · ×1
  • LogSanitizer.sanitizePath (cognitive 28) pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart:370 — LogSanitizer.sanitizePath has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Collector._typedLiteral (cognitive 28) · ×1
  • _Collector._typedLiteral (cognitive 28) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:391 — _Collector._typedLiteral has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject (cognitive 28) · ×1
  • InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject (cognitive 28) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:199 — InterfaceLeastUpperBoundHelper._computeLongestInheritancePathToObject has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (7 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplacementVisitor.visitFunctionType (cognitive 28) · ×1
  • ReplacementVisitor.visitFunctionType (cognitive 28) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:164 — ReplacementVisitor.visitFunctionType has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl.isAlwaysExhaustive (cognitive 28) · ×1
  • TypeSystemImpl.isAlwaysExhaustive (cognitive 28) pkg/analyzer/lib/src/dart/element/type_system.dart:871 — TypeSystemImpl.isAlwaysExhaustive has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl._refineNumericInvocationContextNullSafe (cognitive 28) · ×1
  • TypeSystemImpl._refineNumericInvocationContextNullSafe (cognitive 28) pkg/analyzer/lib/src/dart/element/type_system.dart:1947 — TypeSystemImpl._refineNumericInvocationContextNullSafe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 9 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallInvocationResolver.resolve (cognitive 28) · ×1
  • CallInvocationResolver.resolve (cognitive 28) pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart:42 — CallInvocationResolver.resolve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MethodInvocationResolver._resolveQualifiedInvocation (cognitive 28) · ×1
  • MethodInvocationResolver._resolveQualifiedInvocation (cognitive 28) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:821 — MethodInvocationResolver._resolveQualifiedInvocation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, match/switch 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.visitEnumConstantDeclaration2 (cognitive 28) · ×1
  • TypeAnalyzer.visitEnumConstantDeclaration2 (cognitive 28) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:2878 — TypeAnalyzer.visitEnumConstantDeclaration2 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImportsVerifier._addDuplicateShownHiddenNames (cognitive 28) · ×1
  • ImportsVerifier._addDuplicateShownHiddenNames (cognitive 28) pkg/analyzer/lib/src/error/imports_verifier.dart:418 — ImportsVerifier._addDuplicateShownHiddenNames has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._isValidFfiNativeType (cognitive 28) · ×1
  • FfiVerifier._isValidFfiNativeType (cognitive 28) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1089 — FfiVerifier._isValidFfiNativeType has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FfiVerifier._validateSizeOfAnnotation (cognitive 28) · ×1
  • FfiVerifier._validateSizeOfAnnotation (cognitive 28) pkg/analyzer/lib/src/generated/ffi_verifier.dart:2313 — FfiVerifier._validateSizeOfAnnotation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VarianceBuilder._compute (cognitive 28) · ×1
  • VarianceBuilder._compute (cognitive 28) pkg/analyzer/lib/src/summary2/variance_builder.dart:57 — VarianceBuilder._compute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFileEditBuilderImpl._importLibrary (cognitive 28) · ×1
  • DartFileEditBuilderImpl._importLibrary (cognitive 28) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3096 — DartFileEditBuilderImpl._importLibrary has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpecializedChecks._findAsCheck (cognitive 28) · ×1
  • SpecializedChecks._findAsCheck (cognitive 28) pkg/compiler/lib/src/js_backend/specialized_checks.dart:153 — SpecializedChecks._findAsCheck has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 7 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._handleInvokeFactoryConstructor (cognitive 28) · ×1
  • KernelSsaGraphBuilder._handleInvokeFactoryConstructor (cognitive 28) pkg/compiler/lib/src/ssa/builder.dart:5196 — KernelSsaGraphBuilder._handleInvokeFactoryConstructor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitShiftLeft (cognitive 28) · ×1
  • SsaInstructionSimplifier.visitShiftLeft (cognitive 28) pkg/compiler/lib/src/ssa/optimize.dart:2986 — SsaInstructionSimplifier.visitShiftLeft has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CallStructure.signatureApplies (cognitive 28) · ×1
  • CallStructure.signatureApplies (cognitive 28) pkg/compiler/lib/src/universe/call_structure.dart:196 — CallStructure.signatureApplies has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrateCommand.run (cognitive 28) · ×1
  • MigrateCommand.run (cognitive 28) pkg/dartdev/lib/src/commands/migrate.dart:65 — MigrateCommand.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, error handling 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitCovarianceCheckStub (cognitive 28) · ×1
  • ProgramCompiler._emitCovarianceCheckStub (cognitive 28) pkg/dev_compiler/lib/src/kernel/compiler.dart:2690 — ProgramCompiler._emitCovarianceCheckStub has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitCovarianceCheckStub (cognitive 28) · ×1
  • LibraryCompiler._emitCovarianceCheckStub (cognitive 28) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3000 — LibraryCompiler._emitCovarianceCheckStub has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevHandler._handleConnection (cognitive 28) · ×1
  • DevHandler._handleConnection (cognitive 28) pkg/dwds/lib/src/handlers/dev_handler.dart:403 — DevHandler._handleConnection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadedLibrariesImpl.forEachImportChain (cognitive 28) · ×1
  • LoadedLibrariesImpl.forEachImportChain (cognitive 28) pkg/front_end/lib/src/base/import_chains.dart:125 — LoadedLibrariesImpl.forEachImportChain has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Modifiers.from (cognitive 28) · ×1
  • Modifiers.from (cognitive 28) pkg/front_end/lib/src/base/modifiers.dart:97 — Modifiers.from has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13, boolean chains 12, match/switch 1 (2 pts), if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FactoryEncoding.inferRedirectionTarget (cognitive 28) · ×1
  • FactoryEncoding.inferRedirectionTarget (cognitive 28) pkg/front_end/lib/src/fragment/factory/encoding.dart:223 — FactoryEncoding.inferRedirectionTarget has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 6, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.createFieldInitializer (cognitive 28) · ×1
  • BodyBuilderImpl.createFieldInitializer (cognitive 28) pkg/front_end/lib/src/kernel/body_builder.dart:2235 — BodyBuilderImpl.createFieldInitializer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SanitizedMember.computeMembers (cognitive 28) · ×1
  • _SanitizedMember.computeMembers (cognitive 28) pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart:1002 — _SanitizedMember.computeMembers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (9 pts), ternaries 2 (8 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeclarationBuilderRegistry.registerBuilder (cognitive 28) · ×1
  • _DeclarationBuilderRegistry.registerBuilder (cognitive 28) pkg/front_end/lib/src/source/name_space_builder.dart:258 — _DeclarationBuilderRegistry.registerBuilder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatchingExpressionVisitor.visitListPattern (cognitive 28) · ×1
  • MatchingExpressionVisitor.visitListPattern (cognitive 28) pkg/front_end/lib/src/type_inference/matching_expressions.dart:117 — MatchingExpressionVisitor.visitListPattern has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.getString (cognitive 28) · ×1
  • MiniJsParser.getString (cognitive 28) pkg/js_ast/lib/src/builder.dart:579 — MiniJsParser.getString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._nestedTypePairs (cognitive 28) · ×1
  • _Visitor._nestedTypePairs (cognitive 28) pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart:744 — _Visitor._nestedTypePairs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (10 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkFormalParameters (cognitive 28) · ×1
  • _Visitor._checkFormalParameters (cognitive 28) pkg/linter/lib/src/rules/strict_top_level_inference.dart:137 — _Visitor._checkFormalParameters has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SummaryNormalizer._excludeRedundantJoinPathsInternal (cognitive 28) · ×1
  • _SummaryNormalizer._excludeRedundantJoinPathsInternal (cognitive 28) pkg/vm/lib/transformations/type_flow/summary_collector.dart:114 — _SummaryNormalizer._excludeRedundantJoinPathsInternal has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bin_to_coff.main (cognitive 28) · ×1
  • bin_to_coff.main (cognitive 28) runtime/tools/bin_to_coff.py:113 — bin_to_coff.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · D3SymbolTreeMap.D3SymbolTreeMap._clone (cognitive 28) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._clone (cognitive 28) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:286 — D3SymbolTreeMap.D3SymbolTreeMap._clone has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · AstNodeImplGenerator._generateNodeGettersSetters (cognitive 27) · ×1
  • AstNodeImplGenerator._generateNodeGettersSetters (cognitive 27) pkg/analyzer/tool/generators/ast_generator.dart:846 — AstNodeImplGenerator._generateNodeGettersSetters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (7 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator.getFieldDeclaration (cognitive 27) · ×1
  • BytecodeGenerator.getFieldDeclaration (cognitive 27) pkg/dart2bytecode/lib/bytecode_generator.dart:520 — BytecodeGenerator.getFieldDeclaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AstCodeGenerator._setupLocalParameters (cognitive 27) · ×1
  • AstCodeGenerator._setupLocalParameters (cognitive 27) pkg/dart2wasm/lib/code_generator.dart:248 — AstCodeGenerator._setupLocalParameters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd (cognitive 27) · ×1
  • AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd (cognitive 27) pkg/front_end/tool/coverage_merger.dart:967 — AstIndexerAndIgnoreCollector._checkCommentAndIgnoreCoverageWithBeginAndEnd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, loops 4 (8 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncStarIterator.moveNext (cognitive 27) · ×1
  • _SyncStarIterator.moveNext (cognitive 27) sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:907 — _SyncStarIterator.moveNext has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BoxedDouble.computeRemainder (cognitive 27) · ×1
  • BoxedDouble.computeRemainder (cognitive 27) sdk/lib/_internal/wasm/common/boxed_double.dart:92 — BoxedDouble.computeRemainder has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TypeUniverse.substituteTypeArgument (cognitive 27) · ×1
  • _TypeUniverse.substituteTypeArgument (cognitive 27) sdk/lib/_internal/wasm/common/type.dart:808 — _TypeUniverse.substituteTypeArgument has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.allocateFreeRegister (cognitive 27) · ×1
  • LinearScanRegisterAllocator.allocateFreeRegister (cognitive 27) pkg/native_compiler/lib/back_end/register_allocator.dart:637 — LinearScanRegisterAllocator.allocateFreeRegister has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Simplification.visitBinaryIntOp (cognitive 27) · ×1
  • Simplification.visitBinaryIntOp (cognitive 27) pkg/cfg/lib/passes/simplification.dart:379 — Simplification.visitBinaryIntOp has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PromotionModel.joinPromotedTypes (cognitive 27) · ×1
  • PromotionModel.joinPromotedTypes (cognitive 27) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:5238 — PromotionModel.joinPromotedTypes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseListPatternSuffix (cognitive 27) · ×1
  • Parser.parseListPatternSuffix (cognitive 27) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:12011 — Parser.parseListPatternSuffix has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitSignatureComputer.compute (cognitive 27) · ×1
  • DartUnitSignatureComputer.compute (cognitive 27) pkg/analysis_server/lib/src/computer/computer_signature.dart:27 — DartUnitSignatureComputer.compute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportElementsComputer._computeUpdate (cognitive 27) · ×1
  • ImportElementsComputer._computeUpdate (cognitive 27) pkg/analysis_server/lib/src/computer/import_elements_computer.dart:192 — ImportElementsComputer._computeUpdate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeHierarchyComputerHelper.findMemberElement (cognitive 27) · ×1
  • TypeHierarchyComputerHelper.findMemberElement (cognitive 27) pkg/analysis_server/lib/src/search/type_hierarchy.dart:194 — TypeHierarchyComputerHelper.findMemberElement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenData.fromSelection (cognitive 27) · ×1
  • TokenData.fromSelection (cognitive 27) pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart:548 — TokenData.fromSelection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UriHelper.addSuggestions (cognitive 27) · ×1
  • UriHelper.addSuggestions (cognitive 27) pkg/analysis_server/lib/src/services/completion/dart/uri_helper.dart:29 — UriHelper.addSuggestions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ImportRemoveShow.compute (cognitive 27) · ×1
  • _ImportRemoveShow.compute (cognitive 27) pkg/analysis_server/lib/src/services/correction/dart/ambiguous_import_fix.dart:257 — _ImportRemoveShow.compute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertForEachToForLoop.compute (cognitive 27) · ×1
  • ConvertForEachToForLoop.compute (cognitive 27) pkg/analysis_server/lib/src/services/correction/dart/convert_for_each_to_for_loop.dart:28 — ConvertForEachToForLoop.compute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToSwitchExpression._convertArgumentSwitchExpression (cognitive 27) · ×1
  • ConvertToSwitchExpression._convertArgumentSwitchExpression (cognitive 27) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:82 — ConvertToSwitchExpression._convertArgumentSwitchExpression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (7 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReplacementEditBuilder.visitSimpleIdentifier (cognitive 27) · ×1
  • _ReplacementEditBuilder.visitSimpleIdentifier (cognitive 27) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:331 — _ReplacementEditBuilder.visitSimpleIdentifier has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PubspecFixProcessor.fix (cognitive 27) · ×1
  • PubspecFixProcessor.fix (cognitive 27) pkg/analysis_server/lib/src/services/correction/fix/pubspec/pubspec_fix_processor.dart:62 — PubspecFixProcessor.fix has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (9 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PubspecFixProcessor._fixFile (cognitive 27) · ×1
  • PubspecFixProcessor._fixFile (cognitive 27) pkg/analysis_server/lib/src/services/correction/fix/pubspec/pubspec_fix_processor.dart:132 — PubspecFixProcessor._fixFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisDriverScheduler._run (cognitive 27) · ×1
  • AnalysisDriverScheduler._run (cognitive 27) pkg/analyzer/lib/src/dart/analysis/driver.dart:2748 — AnalysisDriverScheduler._run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator._checkFields (cognitive 27) · ×1
  • _ConstructorInvocationEvaluator._checkFields (cognitive 27) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3052 — _ConstructorInvocationEvaluator._checkFields has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.checkForBodyMayCompleteNormally (cognitive 27) · ×1
  • TypeAnalyzer.checkForBodyMayCompleteNormally (cognitive 27) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:640 — TypeAnalyzer.checkForBodyMayCompleteNormally has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Constructor.updateWithParameters (cognitive 27) · ×1
  • _Constructor.updateWithParameters (cognitive 27) pkg/analyzer/lib/src/error/constructor_fields_verifier.dart:298 — _Constructor.updateWithParameters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnalyzerTypeOperations._getInterfacePropertyTypes (cognitive 27) · ×1
  • AnalyzerTypeOperations._getInterfacePropertyTypes (cognitive 27) pkg/analyzer/lib/src/generated/exhaustiveness.dart:419 — AnalyzerTypeOperations._getInterfacePropertyTypes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstanceMemberInferrer._inferConstructor (cognitive 27) · ×1
  • InstanceMemberInferrer._inferConstructor (cognitive 27) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:378 — InstanceMemberInferrer._inferConstructor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstanceMemberInferrer._inferExecutable (cognitive 27) · ×1
  • InstanceMemberInferrer._inferExecutable (cognitive 27) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:410 — InstanceMemberInferrer._inferExecutable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Linker._buildExportScopes (cognitive 27) · ×1
  • Linker._buildExportScopes (cognitive 27) pkg/analyzer/lib/src/summary2/link.dart:161 — Linker._buildExportScopes has cognitive complexity 27 (threshold 15). Drivers by points: loops 13 (19 pts), if/else 4 (8 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DartEditBuilderImpl._getBaseNameFromUnwrappedExpression (cognitive 27) · ×1
  • DartEditBuilderImpl._getBaseNameFromUnwrappedExpression (cognitive 27) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1324 — DartEditBuilderImpl._getBaseNameFromUnwrappedExpression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment (cognitive 27) · ×1
  • DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment (cognitive 27) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3183 — DartFileEditBuilderImpl._insertDocImportIntoBlockDocComment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 2 (6 pts), loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OpTypeAstVisitor.visitRegularFormalParameter (cognitive 27) · ×1
  • _OpTypeAstVisitor.visitRegularFormalParameter (cognitive 27) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1511 — _OpTypeAstVisitor.visitRegularFormalParameter has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (12 pts) (nesting depth added 3). 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.
D2 · Cognitive Complexity · KernelInfoCollector.visitClass (cognitive 27) · ×1
  • KernelInfoCollector.visitClass (cognitive 27) pkg/compiler/lib/src/dump_info.dart:935 — KernelInfoCollector.visitClass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeEnqueuer._processNativeBehavior (cognitive 27) · ×1
  • NativeEnqueuer._processNativeBehavior (cognitive 27) pkg/compiler/lib/src/native/enqueue.dart:81 — NativeEnqueuer._processNativeBehavior has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 10, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitSwitchInfo (cognitive 27) · ×1
  • SsaCodeGenerator.visitSwitchInfo (cognitive 27) pkg/compiler/lib/src/ssa/codegen.dart:905 — SsaCodeGenerator.visitSwitchInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitInvokeSuper (cognitive 27) · ×1
  • SsaCodeGenerator.visitInvokeSuper (cognitive 27) pkg/compiler/lib/src/ssa/codegen.dart:2685 — SsaCodeGenerator.visitInvokeSuper has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionMerger.analyzeInputs (cognitive 27) · ×1
  • SsaInstructionMerger.analyzeInputs (cognitive 27) pkg/compiler/lib/src/ssa/codegen_helpers.dart:844 — SsaInstructionMerger.analyzeInputs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionMerger.tryMergingExpressions (cognitive 27) · ×1
  • SsaInstructionMerger.tryMergingExpressions (cognitive 27) pkg/compiler/lib/src/ssa/codegen_helpers.dart:1100 — SsaInstructionMerger.tryMergingExpressions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitInvokeDynamicMethod (cognitive 27) · ×1
  • SsaInstructionSimplifier.visitInvokeDynamicMethod (cognitive 27) pkg/compiler/lib/src/ssa/optimize.dart:1028 — SsaInstructionSimplifier.visitInvokeDynamicMethod has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaLiveBlockAnalyzer.visitSwitch (cognitive 27) · ×1
  • SsaLiveBlockAnalyzer.visitSwitch (cognitive 27) pkg/compiler/lib/src/ssa/optimize.dart:3544 — SsaLiveBlockAnalyzer.visitSwitch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartDebugAdapter._buildOutputEventsWithSourceReferences (cognitive 27) · ×1
  • DartDebugAdapter._buildOutputEventsWithSourceReferences (cognitive 27) pkg/dap_adapters/lib/src/adapters/dart.dart:3027 — DartDebugAdapter._buildOutputEventsWithSourceReferences has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 5 (6 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartCliDebugAdapter.launchAndRespond (cognitive 27) · ×1
  • DartCliDebugAdapter.launchAndRespond (cognitive 27) pkg/dap_adapters/lib/src/adapters/dart_cli_adapter.dart:73 — DartCliDebugAdapter.launchAndRespond has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProtocolConverter.convertVmToDapStackFrame (cognitive 27) · ×1
  • ProtocolConverter.convertVmToDapStackFrame (cognitive 27) pkg/dap_adapters/lib/src/protocol_converter.dart:612 — ProtocolConverter.convertVmToDapStackFrame has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, ternaries 10, if/else 5 (6 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DDSRunner.start (cognitive 27) · ×1
  • DDSRunner.start (cognitive 27) pkg/dartdev/lib/src/dds_runner.dart:17 — DDSRunner.start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (23 pts), ternaries 3, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Printer.propertyNameOut (cognitive 27) · ×1
  • Printer.propertyNameOut (cognitive 27) pkg/dev_compiler/lib/src/js_ast/printer.dart:1476 — Printer.propertyNameOut has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BodyBuilderImpl.buildRedirectingInitializer (cognitive 27) · ×1
  • BodyBuilderImpl.buildRedirectingInitializer (cognitive 27) pkg/front_end/lib/src/kernel/body_builder.dart:1864 — BodyBuilderImpl.buildRedirectingInitializer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (4 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantsTransformer.visitBlock (cognitive 27) · ×1
  • ConstantsTransformer.visitBlock (cognitive 27) pkg/front_end/lib/src/kernel/constant_evaluator.dart:660 — ConstantsTransformer.visitBlock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementConstantEvaluator.visitTryCatch (cognitive 27) · ×1
  • StatementConstantEvaluator.visitTryCatch (cognitive 27) pkg/front_end/lib/src/kernel/constant_evaluator.dart:6338 — StatementConstantEvaluator.visitTryCatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LoweredTypedefTearOff.fromExpression (cognitive 27) · ×1
  • LoweredTypedefTearOff.fromExpression (cognitive 27) pkg/front_end/lib/src/kernel/constructor_tearoff_lowering.dart:496 — LoweredTypedefTearOff.fromExpression has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal (cognitive 27) · ×1
  • ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal (cognitive 27) pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart:150 — ClassHierarchyBuilder._getLegacyLeastUpperBoundInternal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.endClassDeclaration (cognitive 27) · ×1
  • OutlineBuilder.endClassDeclaration (cognitive 27) pkg/front_end/lib/src/source/outline_builder.dart:1416 — OutlineBuilder.endClassDeclaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceClassBuilder.checkMethodOverride (cognitive 27) · ×1
  • SourceClassBuilder.checkMethodOverride (cognitive 27) pkg/front_end/lib/src/source/source_class_builder.dart:1835 — SourceClassBuilder.checkMethodOverride has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SuccessfulInferenceResult.applyResult (cognitive 27) · ×1
  • SuccessfulInferenceResult.applyResult (cognitive 27) pkg/front_end/lib/src/type_inference/inference_results.dart:245 — SuccessfulInferenceResult.applyResult has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitMethodDeclaration (cognitive 27) · ×1
  • _Visitor.visitMethodDeclaration (cognitive 27) pkg/linter/lib/src/rules/avoid_renaming_method_parameters.dart:54 — _Visitor.visitMethodDeclaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitSwitchStatement (cognitive 27) · ×1
  • _Visitor.visitSwitchStatement (cognitive 27) pkg/linter/lib/src/rules/exhaustive_cases.dart:37 — _Visitor.visitSwitchStatement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitLexeme (cognitive 27) · ×1
  • _Visitor.visitLexeme (cognitive 27) pkg/linter/lib/src/rules/unnecessary_string_escapes.dart:55 — _Visitor.visitLexeme has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, ternaries 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncStateVisitor.visitSwitchStatement (cognitive 27) · ×1
  • AsyncStateVisitor.visitSwitchStatement (cognitive 27) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:584 — AsyncStateVisitor.visitSwitchStatement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FileInfo.fromReaderDwarf5 (cognitive 27) · ×1
  • FileInfo.fromReaderDwarf5 (cognitive 27) pkg/native_stack_traces/lib/src/dwarf.dart:1154 — FileInfo.fromReaderDwarf5 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (6 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BreakCommand.run (cognitive 27) · ×1
  • BreakCommand.run (cognitive 27) pkg/observatory/lib/src/elements/debugger.dart:779 — BreakCommand.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 2 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SelectorApproximation.observeArgs (cognitive 27) · ×1
  • _SelectorApproximation.observeArgs (cognitive 27) pkg/vm/lib/transformations/type_flow/analysis.dart:1035 — _SelectorApproximation.observeArgs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (6 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InvocationsCache.getInvocation (cognitive 27) · ×1
  • _InvocationsCache.getInvocation (cognitive 27) pkg/vm/lib/transformations/type_flow/analysis.dart:1112 — _InvocationsCache.getInvocation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _TFClassImpl._initDispatchTargets (cognitive 27) · ×1
  • _TFClassImpl._initDispatchTargets (cognitive 27) pkg/vm/lib/transformations/type_flow/analysis.dart:1503 — _TFClassImpl._initDispatchTargets has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Narrow.simplify (cognitive 27) · ×1
  • Narrow.simplify (cognitive 27) pkg/vm/lib/transformations/type_flow/summary.dart:149 — Narrow.simplify has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (9 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeType.isSubtypeOfRuntimeType (cognitive 27) · ×1
  • RuntimeType.isSubtypeOfRuntimeType (cognitive 27) pkg/vm/lib/transformations/type_flow/types.dart:1928 — RuntimeType.isSubtypeOfRuntimeType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BytecodeGenerator._checkArguments (cognitive 26) · ×1
  • BytecodeGenerator._checkArguments (cognitive 26) pkg/dart2bytecode/lib/bytecode_generator.dart:2449 — BytecodeGenerator._checkArguments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator.visitEqualsCall (cognitive 26) · ×1
  • AstCodeGenerator.visitEqualsCall (cognitive 26) pkg/dart2wasm/lib/code_generator.dart:1954 — AstCodeGenerator.visitEqualsCall has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy.sanityChecks (cognitive 26) · ×1
  • ClosedWorldClassHierarchy.sanityChecks (cognitive 26) pkg/kernel/lib/class_hierarchy.dart:1425 — ClosedWorldClassHierarchy.sanityChecks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 7 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Configuration.optionsEqual (cognitive 26) · ×1
  • Configuration.optionsEqual (cognitive 26) pkg/smith/lib/configuration.dart:562 — Configuration.optionsEqual has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 26. 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.
D2 · Cognitive Complexity · int._parseRadix (cognitive 26) · ×1
  • int._parseRadix (cognitive 26) sdk/lib/_internal/wasm/common/int_patch.dart:112 — int._parseRadix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ModifiableList.setRange (cognitive 26) · ×1
  • _ModifiableList.setRange (cognitive 26) sdk/lib/_internal/wasm/common/list.dart:84 — _ModifiableList.setRange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64Assembler.fmov (cognitive 26) · ×1
  • Arm64Assembler.fmov (cognitive 26) pkg/native_compiler/lib/back_end/arm64/assembler.dart:2515 — Arm64Assembler.fmov has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (18 pts), match/switch 3 (5 pts), if/else 3 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitTypeTest (cognitive 26) · ×1
  • Arm64CodeGenerator.visitTypeTest (cognitive 26) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1805 — Arm64CodeGenerator.visitTypeTest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Uri._validateIPvFutureAddress (cognitive 26) · ×1
  • Uri._validateIPvFutureAddress (cognitive 26) sdk/lib/core/uri.dart:1546 — Uri._validateIPvFutureAddress has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri.replace (cognitive 26) · ×1
  • _Uri.replace (cognitive 26) sdk/lib/core/uri.dart:2282 — _Uri.replace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConstantPropagation.visitPhi (cognitive 26) · ×1
  • ConstantPropagation.visitPhi (cognitive 26) pkg/cfg/lib/passes/constant_propagation.dart:224 — ConstantPropagation.visitPhi has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassSerializationCluster.writeFill (cognitive 26) · ×1
  • ClassSerializationCluster.writeFill (cognitive 26) pkg/native_compiler/lib/snapshot/snapshot.dart:778 — ClassSerializationCluster.writeFill has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Witness.reduce (cognitive 26) · ×1
  • Witness.reduce (cognitive 26) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart:326 — Witness.reduce has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utf8BytesScanner.scanUntilLineEnd (cognitive 26) · ×1
  • Utf8BytesScanner.scanUntilLineEnd (cognitive 26) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:249 — Utf8BytesScanner.scanUntilLineEnd has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utf8BytesScanner.skipSpaces (cognitive 26) · ×1
  • Utf8BytesScanner.skipSpaces (cognitive 26) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:319 — Utf8BytesScanner.skipSpaces has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 18, if/else 4 (6 pts), loops 2 (nesting depth added 2). 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.
D2 · Cognitive Complexity · ExportChecker.visitClass (cognitive 26) · ×1
  • ExportChecker.visitClass (cognitive 26) pkg/_js_interop_checks/lib/src/transformations/export_checker.dart:95 — ExportChecker.visitClass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 10, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManager._createPackageConfigFile (cognitive 26) · ×1
  • PluginManager._createPackageConfigFile (cognitive 26) pkg/analysis_server/lib/src/plugin/plugin_manager.dart:864 — PluginManager._createPackageConfigFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (10 pts), error handling 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PluginTrust._readPlugins (cognitive 26) · ×1
  • PluginTrust._readPlugins (cognitive 26) pkg/analysis_server/lib/src/plugin/plugin_trust.dart:214 — PluginTrust._readPlugins has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (7 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass._forPattern (cognitive 26) · ×1
  • InScopeCompletionPass._forPattern (cognitive 26) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:4095 — InScopeCompletionPass._forPattern has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AddAwait.compute (cognitive 26) · ×1
  • AddAwait.compute (cognitive 26) pkg/analysis_server/lib/src/services/correction/dart/add_await.dart:47 — AddAwait.compute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AddKeyToConstructors._canBeConst (cognitive 26) · ×1
  • AddKeyToConstructors._canBeConst (cognitive 26) pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart:54 — AddKeyToConstructors._canBeConst has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddNullCheck._computeTargetAndNullAwareToken (cognitive 26) · ×1
  • AddNullCheck._computeTargetAndNullAwareToken (cognitive 26) pkg/analysis_server/lib/src/services/correction/dart/add_null_check.dart:227 — AddNullCheck._computeTargetAndNullAwareToken has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveLate._lateKeywordLocation (cognitive 26) · ×1
  • RemoveLate._lateKeywordLocation (cognitive 26) pkg/analysis_server/lib/src/services/correction/dart/remove_late.dart:26 — RemoveLate._lateKeywordLocation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportOrganizer._organizeDocImportsInBlockComment (cognitive 26) · ×1
  • ImportOrganizer._organizeDocImportsInBlockComment (cognitive 26) pkg/analysis_server/lib/src/services/correction/organize_imports.dart:344 — ImportOrganizer._organizeDocImportsInBlockComment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 2 (6 pts), loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixInFileProcessor.compute (cognitive 26) · ×1
  • FixInFileProcessor.compute (cognitive 26) pkg/analysis_server_plugin/lib/src/correction/fix_in_file_processor.dart:35 — FixInFileProcessor.compute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextLocator._locateRoots (cognitive 26) · ×1
  • _ContextLocator._locateRoots (cognitive 26) pkg/analyzer/lib/src/dart/analysis/context_locator.dart:741 — _ContextLocator._locateRoots has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InvocationInferrer._visitArguments (cognitive 26) · ×1
  • InvocationInferrer._visitArguments (cognitive 26) pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart:705 — InvocationInferrer._visitArguments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VariableDeclarationResolver.resolve (cognitive 26) · ×1
  • VariableDeclarationResolver.resolve (cognitive 26) pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart:24 — VariableDeclarationResolver.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 8, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · YieldStatementResolver._checkForYieldOfInvalidType (cognitive 26) · ×1
  • YieldStatementResolver._checkForYieldOfInvalidType (cognitive 26) pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart:55 — YieldStatementResolver._checkForYieldOfInvalidType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartdocDirectiveInfo._stripDelimiters (cognitive 26) · ×1
  • DartdocDirectiveInfo._stripDelimiters (cognitive 26) pkg/analyzer/lib/src/dartdoc/dartdoc_directive_info.dart:217 — DartdocDirectiveInfo._stripDelimiters has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.doDotExpression (cognitive 26) · ×1
  • AstBuilder.doDotExpression (cognitive 26) pkg/analyzer/lib/src/fasta/ast_builder.dart:853 — AstBuilder.doDotExpression has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForNonFinalFieldInEnum (cognitive 26) · ×1
  • ErrorVerifier._checkForNonFinalFieldInEnum (cognitive 26) pkg/analyzer/lib/src/generated/error_verifier.dart:6930 — ErrorVerifier._checkForNonFinalFieldInEnum has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkForNotInitializedFieldDeclaration (cognitive 26) · ×1
  • ErrorVerifier._checkForNotInitializedFieldDeclaration (cognitive 26) pkg/analyzer/lib/src/generated/error_verifier.dart:7029 — ErrorVerifier._checkForNotInitializedFieldDeclaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier.visitCascadeMethodInvocation (cognitive 26) · ×1
  • FfiVerifier.visitCascadeMethodInvocation (cognitive 26) pkg/analyzer/lib/src/generated/ffi_verifier.dart:166 — FfiVerifier.visitCascadeMethodInvocation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultTypesBuilder._breakSelfCycles (cognitive 26) · ×1
  • DefaultTypesBuilder._breakSelfCycles (cognitive 26) pkg/analyzer/lib/src/summary2/default_types_builder.dart:67 — DefaultTypesBuilder._breakSelfCycles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementBuilder._buildInstanceElementMembers (cognitive 26) · ×1
  • ElementBuilder._buildInstanceElementMembers (cognitive 26) pkg/analyzer/lib/src/summary2/element_builder.dart:95 — ElementBuilder._buildInstanceElementMembers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (8 pts), match/switch 2 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentBuilder.visitPrimaryConstructorDeclaration (cognitive 26) · ×1
  • FragmentBuilder.visitPrimaryConstructorDeclaration (cognitive 26) pkg/analyzer/lib/src/summary2/element_builder.dart:1952 — FragmentBuilder.visitPrimaryConstructorDeclaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 7, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VarianceBuilder.perform (cognitive 26) · ×1
  • VarianceBuilder.perform (cognitive 26) pkg/analyzer/lib/src/summary2/variance_builder.dart:23 — VarianceBuilder.perform has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 6 (12 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuzzyMatcher.fuzzyMap (cognitive 26) · ×1
  • FuzzyMatcher.fuzzyMap (cognitive 26) pkg/analyzer/lib/src/utilities/fuzzy_matcher.dart:298 — FuzzyMatcher.fuzzyMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, ternaries 2 (5 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl.writeComment (cognitive 26) · ×1
  • DartEditBuilderImpl.writeComment (cognitive 26) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:169 — DartEditBuilderImpl.writeComment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Compiler.produceKernel (cognitive 26) · ×1
  • Compiler.produceKernel (cognitive 26) pkg/compiler/lib/src/compiler.dart:425 — Compiler.produceKernel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ElementInfoCollector.visitClass (cognitive 26) · ×1
  • ElementInfoCollector.visitClass (cognitive 26) pkg/compiler/lib/src/dump_info.dart:561 — ElementInfoCollector.visitClass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (8 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DumpInfoAnnotator.visitClass (cognitive 26) · ×1
  • DumpInfoAnnotator.visitClass (cognitive 26) pkg/compiler/lib/src/dump_info.dart:1348 — DumpInfoAnnotator.visitClass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _GraphGenerator.addNode (cognitive 26) · ×1
  • _GraphGenerator.addNode (cognitive 26) pkg/compiler/lib/src/inferrer/type_graph_dump.dart:280 — _GraphGenerator.addNode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (10 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnionTypeMask.unionOfHelper (cognitive 26) · ×1
  • UnionTypeMask.unionOfHelper (cognitive 26) pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:94 — UnionTypeMask.unionOfHelper has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnlineJavaScriptTracer._handleNotifySteps (cognitive 26) · ×1
  • OnlineJavaScriptTracer._handleNotifySteps (cognitive 26) pkg/compiler/lib/src/io/position_information.dart:1644 — OnlineJavaScriptTracer._handleNotifySteps has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodegenEnqueuerListener._processClass (cognitive 26) · ×1
  • CodegenEnqueuerListener._processClass (cognitive 26) pkg/compiler/lib/src/js_backend/codegen_listener.dart:333 — CodegenEnqueuerListener._processClass has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NativeDataBuilder.close (cognitive 26) · ×1
  • NativeDataBuilder.close (cognitive 26) pkg/compiler/lib/src/js_backend/native_data.dart:485 — NativeDataBuilder.close has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeBehavior.processEffects (cognitive 26) · ×1
  • NativeBehavior.processEffects (cognitive 26) pkg/compiler/lib/src/native/behavior.dart:503 — NativeBehavior.processEffects has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CompilerOptions.deriveOptions (cognitive 26) · ×1
  • CompilerOptions.deriveOptions (cognitive 26) pkg/compiler/lib/src/options.dart:1096 — CompilerOptions.deriveOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._handleInvokeStaticForeign (cognitive 26) · ×1
  • KernelSsaGraphBuilder._handleInvokeStaticForeign (cognitive 26) pkg/compiler/lib/src/ssa/builder.dart:5464 — KernelSsaGraphBuilder._handleInvokeStaticForeign has cognitive complexity 26 (threshold 15). Drivers by points: if/else 26. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SsaCodeGenerator.generateExpressionAssignment (cognitive 26) · ×1
  • SsaCodeGenerator.generateExpressionAssignment (cognitive 26) pkg/compiler/lib/src/ssa/codegen.dart:698 — SsaCodeGenerator.generateExpressionAssignment has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (10 pts), ternaries 1 (5 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock (cognitive 26) · ×1
  • SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock (cognitive 26) pkg/compiler/lib/src/ssa/optimize.dart:3751 — SsaGlobalValueNumberer.moveLoopInvariantCodeFromBlock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 10, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownTable.finish (cognitive 26) · ×1
  • MarkdownTable.finish (cognitive 26) pkg/dartdev/lib/src/utils.dart:368 — MarkdownTable.finish has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 3 (9 pts), loops 4 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitClassDeclaration (cognitive 26) · ×1
  • LibraryCompiler._emitClassDeclaration (cognitive 26) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1463 — LibraryCompiler._emitClassDeclaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitLibraryMembers (cognitive 26) · ×1
  • LibraryCompiler._emitLibraryMembers (cognitive 26) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4051 — LibraryCompiler._emitLibraryMembers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 9, loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeRecipeGenerator.liveInterfaceTypeRules (cognitive 26) · ×1
  • TypeRecipeGenerator.liveInterfaceTypeRules (cognitive 26) pkg/dev_compiler/lib/src/kernel/type_recipe_generator.dart:85 — TypeRecipeGenerator.liveInterfaceTypeRules has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 6 (12 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TypeRecipeVisitor.addLiveTypeAncestries (cognitive 26) · ×1
  • _TypeRecipeVisitor.addLiveTypeAncestries (cognitive 26) pkg/dev_compiler/lib/src/kernel/type_recipe_generator.dart:607 — _TypeRecipeVisitor.addLiveTypeAncestries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (9 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrameComputer._collectAsyncFrames (cognitive 26) · ×1
  • FrameComputer._collectAsyncFrames (cognitive 26) pkg/dwds/lib/src/debugging/frame_computer.dart:80 — FrameComputer._collectAsyncFrames has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._loadEnsureLoadedComponents (cognitive 26) · ×1
  • IncrementalCompiler._loadEnsureLoadedComponents (cognitive 26) pkg/front_end/lib/src/base/incremental_compiler.dart:1729 — IncrementalCompiler._loadEnsureLoadedComponents has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FactoryEncoding._computeRedirecteeType (cognitive 26) · ×1
  • FactoryEncoding._computeRedirecteeType (cognitive 26) pkg/front_end/lib/src/fragment/factory/encoding.dart:682 — FactoryEncoding._computeRedirecteeType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 1 (2 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.pushQualifiedReference (cognitive 26) · ×1
  • BodyBuilderImpl.pushQualifiedReference (cognitive 26) pkg/front_end/lib/src/kernel/body_builder.dart:9784 — BodyBuilderImpl.pushQualifiedReference has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InternalFunctionNode.toTextInternal (cognitive 26) · ×1
  • InternalFunctionNode.toTextInternal (cognitive 26) pkg/front_end/lib/src/kernel/internal_ast.dart:6668 — InternalFunctionNode.toTextInternal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.tokenize (cognitive 26) · ×1
  • SourceLoader.tokenize (cognitive 26) pkg/front_end/lib/src/source/source_loader.dart:1157 — SourceLoader.tokenize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitInstantiation (cognitive 26) · ×1
  • InferenceVisitorImpl.visitInstantiation (cognitive 26) pkg/front_end/lib/src/type_inference/inference_visitor.dart:671 — InferenceVisitorImpl.visitInstantiation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendServerClient.start (cognitive 26) · ×1
  • FrontendServerClient.start (cognitive 26) pkg/frontend_server_client/lib/src/frontend_server_client.dart:36 — FrontendServerClient.start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 3 (4 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MiniJsParser.parseCall (cognitive 26) · ×1
  • MiniJsParser.parseCall (cognitive 26) pkg/js_ast/lib/src/builder.dart:956 — MiniJsParser.parseCall has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitSwitchCase (cognitive 26) · ×1
  • _Visitor.visitSwitchCase (cognitive 26) pkg/linter/lib/src/rules/invalid_case_patterns.dart:49 — _Visitor.visitSwitchCase has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Instance._update (cognitive 26) · ×1
  • Instance._update (cognitive 26) pkg/observatory/lib/src/service/object.dart:3023 — Instance._update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, loops 2 (4 pts), match/switch 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _TreeShakerPass2.visitExtension (cognitive 26) · ×1
  • _TreeShakerPass2.visitExtension (cognitive 26) pkg/vm/lib/transformations/type_flow/transformer.dart:2629 — _TreeShakerPass2.visitExtension has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 2 (10 pts), if/else 3 (8 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_TreeShakerPass2.visitExtensionTypeDeclaration) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _TreeShakerPass2.visitExtensionTypeDeclaration (cognitive 26) · ×1
  • _TreeShakerPass2.visitExtensionTypeDeclaration (cognitive 26) pkg/vm/lib/transformations/type_flow/transformer.dart:2673 — _TreeShakerPass2.visitExtensionTypeDeclaration has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 2 (10 pts), if/else 3 (8 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (_TreeShakerPass2.visitExtension) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _SuggestionBuilder.buildSuggestions (cognitive 26) · ×1
  • _SuggestionBuilder.buildSuggestions (cognitive 26) pkg/analyzer_plugin/lib/utilities/completion/type_member_contributor.dart:350 — _SuggestionBuilder.buildSuggestions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (6 pts), ternaries 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.html.applySettings (cognitive 26) · ×1
  • index.html.applySettings (cognitive 26) pkg/vm_snapshot_analysis/lib/src/assets/index.html:258 — index.html.applySettings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 9 (nesting depth added 7). Of this number, 14 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · load (cognitive 26) · ×1
  • load (cognitive 26) REDACTED:214 — load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5 (nesting depth added 8). Of this number, 14 points are the body's own statements and 12 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · start (cognitive 26) · ×1
  • start (cognitive 26) REDACTED:652 — start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpectedCompletionsVisitor.visitSimpleIdentifier (cognitive 25) · ×1
  • ExpectedCompletionsVisitor.visitSimpleIdentifier (cognitive 25) pkg/analysis_server/tool/code_completion/visitors.dart:682 — ExpectedCompletionsVisitor.visitSimpleIdentifier has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 3 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RemoveLastFormalParameterMutation._deletionForLast (cognitive 25) · ×1
  • RemoveLastFormalParameterMutation._deletionForLast (cognitive 25) pkg/analyzer/tool/fine/ab_mutate/mutations/impl/remove_last_formal_parameter.dart:46 — RemoveLastFormalParameterMutation._deletionForLast has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _CodeGenerator.checkIdl (cognitive 25) · ×1
  • _CodeGenerator.checkIdl (cognitive 25) pkg/analyzer/tool/summary/generate.dart:527 — _CodeGenerator.checkIdl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassInfoCollector.collect (cognitive 25) · ×1
  • ClassInfoCollector.collect (cognitive 25) pkg/dart2wasm/lib/class_info.dart:626 — ClassInfoCollector.collect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 6 (11 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmCompilerOptions._validatePhases (cognitive 25) · ×1
  • WasmCompilerOptions._validatePhases (cognitive 25) pkg/dart2wasm/lib/compiler_options.dart:184 — WasmCompilerOptions._validatePhases has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StateMachineCodeGenerator.visitSwitchStatement (cognitive 25) · ×1
  • StateMachineCodeGenerator.visitSwitchStatement (cognitive 25) pkg/dart2wasm/lib/state_machine.dart:970 — StateMachineCodeGenerator.visitSwitchStatement has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (8 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TraverseFilter.asString (cognitive 25) · ×1
  • TraverseFilter.asString (cognitive 25) pkg/heap_snapshot/lib/analysis.dart:797 — TraverseFilter.asString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeChecker.checkComponent (cognitive 25) · ×1
  • TypeChecker.checkComponent (cognitive 25) pkg/kernel/lib/type_checker.dart:30 — TypeChecker.checkComponent has cognitive complexity 25 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CompilationSet.compileAllFunctions (cognitive 25) · ×1
  • CompilationSet.compileAllFunctions (cognitive 25) pkg/native_compiler/lib/compilation_set.dart:67 — CompilationSet.compileAllFunctions has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 3 (9 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _HttpClient._findProxyFromEnvironment (cognitive 25) · ×1
  • _HttpClient._findProxyFromEnvironment (cognitive 25) sdk/lib/_http/http_impl.dart:3307 — _HttpClient._findProxyFromEnvironment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StringBase.createFromCharCodes (cognitive 25) · ×1
  • _StringBase.createFromCharCodes (cognitive 25) sdk/lib/_internal/vm/lib/string_patch.dart:115 — _StringBase.createFromCharCodes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HtmlEscape._convert (cognitive 25) · ×1
  • HtmlEscape._convert (cognitive 25) sdk/lib/convert/html_escape.dart:241 — HtmlEscape._convert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstToIr._enterScope (cognitive 25) · ×1
  • AstToIr._enterScope (cognitive 25) pkg/cfg/lib/front_end/ast_to_ir.dart:959 — AstToIr._enterScope has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SSAComputation.rename (cognitive 25) · ×1
  • SSAComputation.rename (cognitive 25) pkg/cfg/lib/ir/ssa_computation.dart:108 — SSAComputation.rename has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (10 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · FieldSerializationCluster.writeFill (cognitive 25) · ×1
  • FieldSerializationCluster.writeFill (cognitive 25) pkg/native_compiler/lib/snapshot/snapshot.dart:939 — FieldSerializationCluster.writeFill has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (24 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseFunctionBody (cognitive 25) · ×1
  • Parser.parseFunctionBody (cognitive 25) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6539 — Parser.parseFunctionBody has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseNewExpression (cognitive 25) · ×1
  • Parser.parseNewExpression (cognitive 25) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:8923 — Parser.parseNewExpression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseParenthesizedPatternOrRecordPattern (cognitive 25) · ×1
  • Parser.parseParenthesizedPatternOrRecordPattern (cognitive 25) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:12181 — Parser.parseParenthesizedPatternOrRecordPattern has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.analyzeSwitchExpression (cognitive 25) · ×1
  • TypeAnalyzer.analyzeSwitchExpression (cognitive 25) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:2340 — TypeAnalyzer.analyzeSwitchExpression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitHoverComputer._typeDisplayString (cognitive 25) · ×1
  • DartUnitHoverComputer._typeDisplayString (cognitive 25) pkg/analysis_server/lib/src/computer/computer_hover.dart:357 — DartUnitHoverComputer._typeDisplayString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 11 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ContextManagerImpl._handleWatchEvent (cognitive 25) · ×1
  • ContextManagerImpl._handleWatchEvent (cognitive 25) pkg/analysis_server/lib/src/context_manager.dart:968 — ContextManagerImpl._handleWatchEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationSummaryBuilder._writeAvailableCleanUp (cognitive 25) · ×1
  • MigrationSummaryBuilder._writeAvailableCleanUp (cognitive 25) pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_summary_builder.dart:46 — MigrationSummaryBuilder._writeAvailableCleanUp has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (13 pts), ternaries 4 (8 pts), if/else 2 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DeclarationHelper._bestMember (cognitive 25) · ×1
  • DeclarationHelper._bestMember (cognitive 25) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1766 — DeclarationHelper._bestMember has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._visitPattern (cognitive 25) · ×1
  • DeclarationHelper._visitPattern (cognitive 25) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:3076 — DeclarationHelper._visitPattern has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SuggestionBuilder._addBuilder (cognitive 25) · ×1
  • SuggestionBuilder._addBuilder (cognitive 25) pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:1290 — SuggestionBuilder._addBuilder has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AddMissingClosureParameters._addToExistingClosure (cognitive 25) · ×1
  • AddMissingClosureParameters._addToExistingClosure (cognitive 25) pkg/analysis_server/lib/src/services/correction/dart/add_closure.dart:175 — AddMissingClosureParameters._addToExistingClosure has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertIntoFinalField.compute (cognitive 25) · ×1
  • ConvertIntoFinalField.compute (cognitive 25) pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart:26 — ConvertIntoFinalField.compute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateClass.producers (cognitive 25) · ×1
  • CreateClass.producers (cognitive 25) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:21 — CreateClass.producers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateExtensionGetter.compute (cognitive 25) · ×1
  • CreateExtensionGetter.compute (cognitive 25) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:35 — CreateExtensionGetter.compute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 6, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ExpressionImpl.constantContext (cognitive 25) · ×1
  • ExpressionImpl.constantContext (cognitive 25) pkg/analyzer/lib/src/dart/ast/ast.dart:19584 — ExpressionImpl.constantContext has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementDirectiveImpl.areIdenticalExceptUri (cognitive 25) · ×1
  • ElementDirectiveImpl.areIdenticalExceptUri (cognitive 25) pkg/analyzer/lib/src/dart/element/element.dart:2116 — ElementDirectiveImpl.areIdenticalExceptUri has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnnotationVerifier._checkInternal (cognitive 25) · ×1
  • AnnotationVerifier._checkInternal (cognitive 25) pkg/analyzer/lib/src/error/annotation_verifier.dart:326 — AnnotationVerifier._checkInternal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementUsageDetector._isLocalParameter (cognitive 25) · ×1
  • ElementUsageDetector._isLocalParameter (cognitive 25) pkg/analyzer/lib/src/error/element_usage_detector.dart:468 — ElementUsageDetector._isLocalParameter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportsVerifier.generateUnnecessaryImportHints (cognitive 25) · ×1
  • ImportsVerifier.generateUnnecessaryImportHints (cognitive 25) pkg/analyzer/lib/src/error/imports_verifier.dart:184 — ImportsVerifier.generateUnnecessaryImportHints has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClassVerifier._checkDirectSuperTypes (cognitive 25) · ×1
  • _ClassVerifier._checkDirectSuperTypes (cognitive 25) pkg/analyzer/lib/src/error/inheritance_override.dart:656 — _ClassVerifier._checkDirectSuperTypes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequiredParametersVerifier._check (cognitive 25) · ×1
  • RequiredParametersVerifier._check (cognitive 25) pkg/analyzer/lib/src/error/required_parameters_verifier.dart:123 — RequiredParametersVerifier._check has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AstBuilder.buildInitializer (cognitive 25) · ×1
  • AstBuilder.buildInitializer (cognitive 25) pkg/analyzer/lib/src/fasta/ast_builder.dart:635 — AstBuilder.buildInitializer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.endFormalParameter (cognitive 25) · ×1
  • AstBuilder.endFormalParameter (cognitive 25) pkg/analyzer/lib/src/fasta/ast_builder.dart:1865 — AstBuilder.endFormalParameter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, match/switch 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier.visitFieldsDeclaration (cognitive 25) · ×1
  • ErrorVerifier.visitFieldsDeclaration (cognitive 25) pkg/analyzer/lib/src/generated/error_verifier.dart:1237 — ErrorVerifier.visitFieldsDeclaration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFileEditBuilderImpl._getImportElement (cognitive 25) · ×1
  • DartFileEditBuilderImpl._getImportElement (cognitive 25) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:2976 — DartFileEditBuilderImpl._getImportElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InliningTraceListener.finish (cognitive 25) · ×1
  • InliningTraceListener.finish (cognitive 25) pkg/compiler/lib/src/io/position_information.dart:503 — InliningTraceListener.finish has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RecipeGenerator.visitFunctionType (cognitive 25) · ×1
  • _RecipeGenerator.visitFunctionType (cognitive 25) pkg/compiler/lib/src/js_backend/runtime_types_new.dart:340 — _RecipeGenerator.visitFunctionType has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (8 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InlineWeeder.handleGenerativeConstructorFactory (cognitive 25) · ×1
  • InlineWeeder.handleGenerativeConstructorFactory (cognitive 25) pkg/compiler/lib/src/ssa/builder.dart:9723 — InlineWeeder.handleGenerativeConstructorFactory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.simplifyExpressionPhi (cognitive 25) · ×1
  • SsaInstructionSimplifier.simplifyExpressionPhi (cognitive 25) pkg/compiler/lib/src/ssa/optimize.dart:525 — SsaInstructionSimplifier.simplifyExpressionPhi has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitFieldGet (cognitive 25) · ×1
  • SsaInstructionSimplifier.visitFieldGet (cognitive 25) pkg/compiler/lib/src/ssa/optimize.dart:1765 — SsaInstructionSimplifier.visitFieldGet has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitInvokeDynamicSetter (cognitive 25) · ×1
  • SsaInstructionSimplifier.visitInvokeDynamicSetter (cognitive 25) pkg/compiler/lib/src/ssa/optimize.dart:2132 — SsaInstructionSimplifier.visitInvokeDynamicSetter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassHierarchyNode.printOn (cognitive 25) · ×1
  • ClassHierarchyNode.printOn (cognitive 25) pkg/compiler/lib/src/universe/class_set.dart:377 — ClassHierarchyNode.printOn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalPackageResolver.resolvePackageConfig (cognitive 25) · ×1
  • EvalPackageResolver.resolvePackageConfig (cognitive 25) pkg/dartdev/lib/src/eval_packages.dart:72 — EvalPackageResolver.resolvePackageConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitClassDeclaration (cognitive 25) · ×1
  • ProgramCompiler._emitClassDeclaration (cognitive 25) pkg/dev_compiler/lib/src/kernel/compiler.dart:1170 — ProgramCompiler._emitClassDeclaration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassPropertyModel._findExtensionMembers (cognitive 25) · ×1
  • ClassPropertyModel._findExtensionMembers (cognitive 25) pkg/dev_compiler/lib/src/kernel/property_model.dart:342 — ClassPropertyModel._findExtensionMembers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamedTypeBuilderImpl.buildSupertype (cognitive 25) · ×1
  • NamedTypeBuilderImpl.buildSupertype (cognitive 25) pkg/front_end/lib/src/builder/named_type_builder.dart:646 — NamedTypeBuilderImpl.buildSupertype has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NamedTypeBuilderImpl.computeTypeParameterBuilderVariance (cognitive 25) · ×1
  • NamedTypeBuilderImpl.computeTypeParameterBuilderVariance (cognitive 25) pkg/front_end/lib/src/builder/named_type_builder.dart:847 — NamedTypeBuilderImpl.computeTypeParameterBuilderVariance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SynthesizedInterfaceMember._ensureMemberAndCovariance (cognitive 25) · ×1
  • SynthesizedInterfaceMember._ensureMemberAndCovariance (cognitive 25) pkg/front_end/lib/src/kernel/hierarchy/class_member.dart:540 — SynthesizedInterfaceMember._ensureMemberAndCovariance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelayedDefaultValueCloner.cloneDefaultValues (cognitive 25) · ×1
  • DelayedDefaultValueCloner.cloneDefaultValues (cognitive 25) pkg/front_end/lib/src/kernel/kernel_helper.dart:56 — DelayedDefaultValueCloner.cloneDefaultValues has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentFactoryImpl.computeAndValidateConstructorName (cognitive 25) · ×1
  • FragmentFactoryImpl.computeAndValidateConstructorName (cognitive 25) pkg/front_end/lib/src/source/fragment_factory_impl.dart:1795 — FragmentFactoryImpl.computeAndValidateConstructorName has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLibraryBuilder.checkTypesInOutline (cognitive 25) · ×1
  • SourceLibraryBuilder.checkTypesInOutline (cognitive 25) pkg/front_end/lib/src/source/source_library_builder.dart:1382 — SourceLibraryBuilder.checkTypesInOutline has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstListOrSetLiteralBuilder.translate (cognitive 25) · ×1
  • _ConstListOrSetLiteralBuilder.translate (cognitive 25) pkg/front_end/lib/src/type_inference/collection_encoding.dart:170 — _ConstListOrSetLiteralBuilder.translate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (4 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitDotShorthandPropertyGet (cognitive 25) · ×1
  • InferenceVisitorImpl.visitDotShorthandPropertyGet (cognitive 25) pkg/front_end/lib/src/type_inference/inference_visitor.dart:14135 — InferenceVisitorImpl.visitDotShorthandPropertyGet has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase._inferInstanceMethodInvocation (cognitive 25) · ×1
  • InferenceVisitorBase._inferInstanceMethodInvocation (cognitive 25) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3036 — InferenceVisitorBase._inferInstanceMethodInvocation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _Processor._preprocessImportsAsNeeded (cognitive 25) · ×1
  • _Processor._preprocessImportsAsNeeded (cognitive 25) pkg/front_end/lib/src/util/outline_extractor.dart:272 — _Processor._preprocessImportsAsNeeded has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstPrinter.writeFunctionNode (cognitive 25) · ×1
  • AstPrinter.writeFunctionNode (cognitive 25) pkg/kernel/lib/src/printer.dart:608 — AstPrinter.writeFunctionNode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitCompilationUnit (cognitive 25) · ×1
  • _Visitor.visitCompilationUnit (cognitive 25) pkg/linter/lib/src/rules/dangling_library_doc_comments.dart:38 — _Visitor.visitCompilationUnit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Isolate._update (cognitive 25) · ×1
  • Isolate._update (cognitive 25) pkg/observatory/lib/src/service/object.dart:1708 — Isolate._update has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 5 (11 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _BlockMatcher.match (cognitive 25) · ×1
  • _BlockMatcher.match (cognitive 25) pkg/vm/lib/testing/il_matchers.dart:513 — _BlockMatcher.match has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableSelectorAssigner._memberIdsForClass (cognitive 25) · ×1
  • TableSelectorAssigner._memberIdsForClass (cognitive 25) pkg/vm/lib/transformations/type_flow/table_selector_assigner.dart:45 — TableSelectorAssigner._memberIdsForClass has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (4 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TreeShakerPass2.defaultMember (cognitive 25) · ×1
  • _TreeShakerPass2.defaultMember (cognitive 25) pkg/vm/lib/transformations/type_flow/transformer.dart:2539 — _TreeShakerPass2.defaultMember has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SuggestionBuilder._addSuggestion (cognitive 25) · ×1
  • _SuggestionBuilder._addSuggestion (cognitive 25) pkg/analyzer_plugin/lib/utilities/completion/type_member_contributor.dart:394 — _SuggestionBuilder._addSuggestion has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (25 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · D3SymbolTreeMap.D3SymbolTreeMap._handleInodes (cognitive 25) · ×1
  • D3SymbolTreeMap.D3SymbolTreeMap._handleInodes (cognitive 25) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:382 — D3SymbolTreeMap.D3SymbolTreeMap._handleInodes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 4, boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 464, 533, 429, …). 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.
D2 · Cognitive Complexity · hotRestart (cognitive 25) · ×1
  • hotRestart (cognitive 25) REDACTED:481 — hotRestart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, loops 3 (nesting depth added 6). Of this number, 22 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BuilderGenerator._generateSignatureCall (cognitive 24) · ×1
  • _BuilderGenerator._generateSignatureCall (cognitive 24) pkg/analyzer/tool/summary/generate.dart:443 — _BuilderGenerator._generateSignatureCall has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnreachableIfFinder.helperForIfLikeStructure (cognitive 24) · ×1
  • UnreachableIfFinder.helperForIfLikeStructure (cognitive 24) pkg/front_end/tool/unreachable_if_finder.dart:69 — UnreachableIfFinder.helperForIfLikeStructure has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NaiveTypeChecker._checkFunctionOverride (cognitive 24) · ×1
  • NaiveTypeChecker._checkFunctionOverride (cognitive 24) pkg/kernel/lib/naive_type_checker.dart:163 — NaiveTypeChecker._checkFunctionOverride has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Double.compareTo (cognitive 24) · ×1
  • _Double.compareTo (cognitive 24) sdk/lib/_internal/vm/lib/double.dart:340 — _Double.compareTo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FunctionType.toString (cognitive 24) · ×1
  • _FunctionType.toString (cognitive 24) sdk/lib/_internal/wasm/common/type.dart:517 — _FunctionType.toString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitCompareAndBranch (cognitive 24) · ×1
  • Arm64CodeGenerator.visitCompareAndBranch (cognitive 24) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:374 — Arm64CodeGenerator.visitCompareAndBranch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, match/switch 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.allocate (cognitive 24) · ×1
  • LinearScanRegisterAllocator.allocate (cognitive 24) pkg/native_compiler/lib/back_end/register_allocator.dart:518 — LinearScanRegisterAllocator.allocate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryBuilder.readUriToSource (cognitive 24) · ×1
  • BinaryBuilder.readUriToSource (cognitive 24) pkg/kernel/lib/binary/ast_from_binary.dart:1056 — BinaryBuilder.readUriToSource has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (6 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DependenciesCollector._enqueueInstanceMembers (cognitive 24) · ×1
  • DependenciesCollector._enqueueInstanceMembers (cognitive 24) pkg/dart2wasm/lib/deferred_load/dependencies.dart:158 — DependenciesCollector._enqueueInstanceMembers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnnotationsListener.endLiteralString (cognitive 24) · ×1
  • AnnotationsListener.endLiteralString (cognitive 24) pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart:891 — AnnotationsListener.endLiteralString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseMixinHeaderRecovery (cognitive 24) · ×1
  • Parser.parseMixinHeaderRecovery (cognitive 24) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:3488 — Parser.parseMixinHeaderRecovery has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser._attemptPrecedenceLevelRecovery (cognitive 24) · ×1
  • Parser._attemptPrecedenceLevelRecovery (cognitive 24) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7631 — Parser._attemptPrecedenceLevelRecovery has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (10 pts), loops 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · Parser.parseSend (cognitive 24) · ×1
  • Parser.parseSend (cognitive 24) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9364 — Parser.parseSend has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseMapPatternSuffix (cognitive 24) · ×1
  • Parser.parseMapPatternSuffix (cognitive 24) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:12092 — Parser.parseMapPatternSuffix has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utf8BytesScanner._decodeUtf8CodePoint (cognitive 24) · ×1
  • Utf8BytesScanner._decodeUtf8CodePoint (cognitive 24) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:398 — Utf8BytesScanner._decodeUtf8CodePoint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionIndex._indexExtensions (cognitive 24) · ×1
  • ExtensionIndex._indexExtensions (cognitive 24) pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart:1170 — ExtensionIndex._indexExtensions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterOutlineComputer._addAttribute (cognitive 24) · ×1
  • FlutterOutlineComputer._addAttribute (cognitive 24) pkg/analysis_server/lib/src/flutter/flutter_outline_computer.dart:48 — FlutterOutlineComputer._addAttribute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (8 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeDefinitionHandler.handle (cognitive 24) · ×1
  • TypeDefinitionHandler.handle (cognitive 24) pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart:42 — TypeDefinitionHandler.handle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ResultMerger.mergeOutline (cognitive 24) · ×1
  • ResultMerger.mergeOutline (cognitive 24) pkg/analysis_server/lib/src/plugin/result_merger.dart:392 — ResultMerger.mergeOutline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.startAnalysisServer (cognitive 24) · ×1
  • Driver.startAnalysisServer (cognitive 24) pkg/analysis_server/lib/src/server/driver.dart:454 — Driver.startAnalysisServer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper.addFieldsForInitializers (cognitive 24) · ×1
  • DeclarationHelper.addFieldsForInitializers (cognitive 24) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:266 — DeclarationHelper.addFieldsForInitializers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitPropertyAccess (cognitive 24) · ×1
  • InScopeCompletionPass.visitPropertyAccess (cognitive 24) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2702 — InScopeCompletionPass.visitPropertyAccess has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeywordHelper.addFieldDeclarationKeywords (cognitive 24) · ×1
  • KeywordHelper.addFieldDeclarationKeywords (cognitive 24) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:444 — KeywordHelper.addFieldDeclarationKeywords has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotImportedCompletionPass.computeSuggestions (cognitive 24) · ×1
  • NotImportedCompletionPass.computeSuggestions (cognitive 24) pkg/analysis_server/lib/src/services/completion/dart/not_imported_completion_pass.dart:97 — NotImportedCompletionPass.computeSuggestions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor._checkExpressions (cognitive 24) · ×1
  • StatementCompletionProcessor._checkExpressions (cognitive 24) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:297 — StatementCompletionProcessor._checkExpressions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddCallSuper.compute (cognitive 24) · ×1
  • AddCallSuper.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/add_call_super.dart:29 — AddCallSuper.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences (cognitive 24) · ×1
  • AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:209 — AddDiagnosticPropertyReference._fixAllDiagnosticPropertyReferences has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AddInvocation.compute (cognitive 24) · ×1
  • _AddInvocation.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart:214 — _AddInvocation.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BindToField._replaceParameterWithThis (cognitive 24) · ×1
  • BindToField._replaceParameterWithThis (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/bind_to_field.dart:121 — BindToField._replaceParameterWithThis has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 1 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertMapFromIterableToForLiteral.compute (cognitive 24) · ×1
  • ConvertMapFromIterableToForLiteral.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart:33 — ConvertMapFromIterableToForLiteral.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToSetLiteral.compute (cognitive 24) · ×1
  • ConvertToSetLiteral.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart:34 — ConvertToSetLiteral.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateMixin.producers (cognitive 24) · ×1
  • CreateMixin.producers (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:21 — CreateMixin.producers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _JoinIfWithElseBlock._compute (cognitive 24) · ×1
  • _JoinIfWithElseBlock._compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/join_else_with_if.dart:200 — _JoinIfWithElseBlock._compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeRequiredNamedParametersFirst.compute (cognitive 24) · ×1
  • MakeRequiredNamedParametersFirst.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/make_required_named_parameters_first.dart:28 — MakeRequiredNamedParametersFirst.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3, boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RemoveDeadCode._handleDeadAtStartOfNode (cognitive 24) · ×1
  • RemoveDeadCode._handleDeadAtStartOfNode (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart:126 — RemoveDeadCode._handleDeadAtStartOfNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RemoveUnexpectedUnderscores.compute (cognitive 24) · ×1
  • RemoveUnexpectedUnderscores.compute (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/remove_unexpected_underscores.dart:26 — RemoveUnexpectedUnderscores.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveUnusedLocalVariable._deleteDeclarationInPatternField (cognitive 24) · ×1
  • RemoveUnusedLocalVariable._deleteDeclarationInPatternField (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:220 — RemoveUnusedLocalVariable._deleteDeclarationInPatternField has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 1, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ReplaceWithInterpolation._extractComponentsInto (cognitive 24) · ×1
  • ReplaceWithInterpolation._extractComponentsInto (cognitive 24) pkg/analysis_server/lib/src/services/correction/dart/replace_with_interpolation.dart:63 — ReplaceWithInterpolation._extractComponentsInto has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReferenceFinder.visitExtensionDeclaration (cognitive 24) · ×1
  • _ReferenceFinder.visitExtensionDeclaration (cognitive 24) pkg/analysis_server/lib/src/utilities/import_analyzer.dart:258 — _ReferenceFinder.visitExtensionDeclaration has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisDriver.workPriority (cognitive 24) · ×1
  • AnalysisDriver.workPriority (cognitive 24) pkg/analyzer/lib/src/dart/analysis/driver.dart:483 — AnalysisDriver.workPriority has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20 (22 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _DiscoverAvailableFilesJob._initialize (cognitive 24) · ×1
  • _DiscoverAvailableFilesJob._initialize (cognitive 24) pkg/analyzer/lib/src/dart/analysis/driver.dart:3199 — _DiscoverAvailableFilesJob._initialize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionImpl.correspondingParameter (cognitive 24) · ×1
  • ExpressionImpl.correspondingParameter (cognitive 24) pkg/analyzer/lib/src/dart/ast/ast.dart:19381 — ExpressionImpl.correspondingParameter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier._canBeEqual (cognitive 24) · ×1
  • ConstantVerifier._canBeEqual (cognitive 24) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:574 — ConstantVerifier._canBeEqual has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantVisitor._getDeferredLibraryError (cognitive 24) · ×1
  • ConstantVisitor._getDeferredLibraryError (cognitive 24) pkg/analyzer/lib/src/dart/constant/evaluation.dart:2067 — ConstantVisitor._getDeferredLibraryError has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall (cognitive 24) · ×1
  • _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall (cognitive 24) pkg/analyzer/lib/src/dart/constant/evaluation.dart:2921 — _ConstructorInvocationEvaluator.evaluateFactoryConstructorCall has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopMergeHelper._functionTypes (cognitive 24) · ×1
  • TopMergeHelper._functionTypes (cognitive 24) pkg/analyzer/lib/src/dart/element/top_merge.dart:133 — TopMergeHelper._functionTypes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver.resolveIndexReadWriteAssignmentTarget (cognitive 24) · ×1
  • PropertyElementResolver.resolveIndexReadWriteAssignmentTarget (cognitive 24) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:493 — PropertyElementResolver.resolveIndexReadWriteAssignmentTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypedLiteralResolver._inferSetOrMapLiteralType (cognitive 24) · ×1
  • TypedLiteralResolver._inferSetOrMapLiteralType (cognitive 24) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:553 — TypedLiteralResolver._inferSetOrMapLiteralType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalRedirectedParameters (cognitive 24) · ×1
  • DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalRedirectedParameters (cognitive 24) pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:226 — DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalRedirectedParameters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportsVerifier.generateUnusedImportWarnings (cognitive 24) · ×1
  • ImportsVerifier.generateUnusedImportWarnings (cognitive 24) pkg/analyzer/lib/src/error/imports_verifier.dart:259 — ImportsVerifier.generateUnusedImportWarnings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClassVerifier._checkForRecursiveInterfaceInheritance (cognitive 24) · ×1
  • _ClassVerifier._checkForRecursiveInterfaceInheritance (cognitive 24) pkg/analyzer/lib/src/error/inheritance_override.dart:700 — _ClassVerifier._checkForRecursiveInterfaceInheritance has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiteralElementVerifier._verifySpreadForListOrSet (cognitive 24) · ×1
  • LiteralElementVerifier._verifySpreadForListOrSet (cognitive 24) pkg/analyzer/lib/src/error/literal_element_verifier.dart:243 — LiteralElementVerifier._verifySpreadForListOrSet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DirectiveParser._parseArgument (cognitive 24) · ×1
  • _DirectiveParser._parseArgument (cognitive 24) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:1148 — _DirectiveParser._parseArgument has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryManifestBuilder._fillInterfaceElementInterface (cognitive 24) · ×1
  • LibraryManifestBuilder._fillInterfaceElementInterface (cognitive 24) pkg/analyzer/lib/src/fine/library_manifest.dart:1326 — LibraryManifestBuilder._fillInterfaceElementInterface has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForWrongNumberOfParametersForOperator (cognitive 24) · ×1
  • ErrorVerifier._checkForWrongNumberOfParametersForOperator (cognitive 24) pkg/analyzer/lib/src/generated/error_verifier.dart:7845 — ErrorVerifier._checkForWrongNumberOfParametersForOperator has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 18, if/else 6. 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.
D2 · Cognitive Complexity · FfiVerifier._validateCompatibleNativeType (cognitive 24) · ×1
  • FfiVerifier._validateCompatibleNativeType (cognitive 24) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1579 — FfiVerifier._validateCompatibleNativeType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InstanceMemberInferrer._setInducedModifier (cognitive 24) · ×1
  • InstanceMemberInferrer._setInducedModifier (cognitive 24) pkg/analyzer/lib/src/summary2/instance_member_inferrer.dart:641 — InstanceMemberInferrer._setInducedModifier has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalDeclarationVisitor._visitCompilationUnit (cognitive 24) · ×1
  • LocalDeclarationVisitor._visitCompilationUnit (cognitive 24) pkg/analyzer_plugin/lib/src/utilities/visitors/local_declaration_visitor.dart:378 — LocalDeclarationVisitor._visitCompilationUnit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 4 (11 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · InferrerEngine.updateParameterInputs (cognitive 24) · ×1
  • InferrerEngine.updateParameterInputs (cognitive 24) pkg/compiler/lib/src/inferrer/engine.dart:894 — InferrerEngine.updateParameterInputs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystem.joinTypeMasks (cognitive 24) · ×1
  • TypeSystem.joinTypeMasks (cognitive 24) pkg/compiler/lib/src/inferrer/type_system.dart:824 — TypeSystem.joinTypeMasks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodegenImpactTransformer.transformCodegenImpact (cognitive 24) · ×1
  • CodegenImpactTransformer.transformCodegenImpact (cognitive 24) pkg/compiler/lib/src/js_backend/impact_transformer.dart:77 — CodegenImpactTransformer.transformCodegenImpact has cognitive complexity 24 (threshold 15). Drivers by points: loops 10, if/else 4 (8 pts), match/switch 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeReferenceFinalizerImpl._allocateNames (cognitive 24) · ×1
  • TypeReferenceFinalizerImpl._allocateNames (cognitive 24) pkg/compiler/lib/src/js_backend/type_reference.dart:370 — TypeReferenceFinalizerImpl._allocateNames has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassStubGenerator.generateCallStubsForGetter (cognitive 24) · ×1
  • ClassStubGenerator.generateCallStubsForGetter (cognitive 24) pkg/compiler/lib/src/js_emitter/class_stub_generator.dart:46 — ClassStubGenerator.generateCallStubsForGetter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (7 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramBuilder._buildMethod (cognitive 24) · ×1
  • ProgramBuilder._buildMethod (cognitive 24) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:965 — ProgramBuilder._buildMethod has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.handleArrayTypeInfo (cognitive 24) · ×1
  • SsaInstructionSimplifier.handleArrayTypeInfo (cognitive 24) pkg/compiler/lib/src/ssa/optimize.dart:2314 — SsaInstructionSimplifier.handleArrayTypeInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProtocolConverter._gettersForClassHierarchy (cognitive 24) · ×1
  • ProtocolConverter._gettersForClassHierarchy (cognitive 24) pkg/dap_adapters/lib/src/protocol_converter.dart:801 — ProtocolConverter._gettersForClassHierarchy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (7 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartDevelopmentServiceImpl._startDDSServer (cognitive 24) · ×1
  • DartDevelopmentServiceImpl._startDDSServer (cognitive 24) pkg/dds/lib/src/dds_impl.dart:168 — DartDevelopmentServiceImpl._startDDSServer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3, boolean chains 2, error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionBuilderImpl.lookupExtensionMemberByName (cognitive 24) · ×1
  • ExtensionBuilderImpl.lookupExtensionMemberByName (cognitive 24) pkg/front_end/lib/src/builder/extension_builder.dart:52 — ExtensionBuilderImpl.lookupExtensionMemberByName has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endLiteralString (cognitive 24) · ×1
  • BodyBuilderImpl.endLiteralString (cognitive 24) pkg/front_end/lib/src/kernel/body_builder.dart:4712 — BodyBuilderImpl.endLiteralString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelayedGetterSetterCheck._checkGetterSetter (cognitive 24) · ×1
  • DelayedGetterSetterCheck._checkGetterSetter (cognitive 24) pkg/front_end/lib/src/kernel/hierarchy/delayed.dart:101 — DelayedGetterSetterCheck._checkGetterSetter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OutlineBuilder.endTypedef (cognitive 24) · ×1
  • OutlineBuilder.endTypedef (cognitive 24) pkg/front_end/lib/src/source/outline_builder.dart:3898 — OutlineBuilder.endTypedef has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Processor.preprocessUri (cognitive 24) · ×1
  • _Processor.preprocessUri (cognitive 24) pkg/front_end/lib/src/util/outline_extractor.dart:141 — _Processor.preprocessUri has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 7 (10 pts), boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · StringToSource.analyze (cognitive 24) · ×1
  • StringToSource.analyze (cognitive 24) pkg/js_ast/lib/src/strings.dart:26 — StringToSource.analyze has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _Visitor.visitPatternField (cognitive 24) · ×1
  • _Visitor.visitPatternField (cognitive 24) pkg/linter/lib/src/rules/simplify_variable_pattern.dart:40 — _Visitor.visitPatternField has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.check (cognitive 24) · ×1
  • _Visitor.check (cognitive 24) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:1120 — _Visitor.check has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InspectPage._visitObject (cognitive 24) · ×1
  • InspectPage._visitObject (cognitive 24) pkg/observatory/lib/src/app/page.dart:249 — InspectPage._visitObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20 (21 pts), error handling 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SampleProfile._loadCommon (cognitive 24) · ×1
  • SampleProfile._loadCommon (cognitive 24) pkg/observatory/lib/src/sample_profile/sample_profile.dart:903 — SampleProfile._loadCommon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LateLowering.getLocalLowering (cognitive 24) · ×1
  • LateLowering.getLocalLowering (cognitive 24) pkg/kernel/lib/target/targets.dart:734 — LateLowering.getLocalLowering has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (24 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LateLowering.getFieldLowering) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LateLowering.getFieldLowering (cognitive 24) · ×1
  • LateLowering.getFieldLowering (cognitive 24) pkg/kernel/lib/target/targets.dart:770 — LateLowering.getFieldLowering has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (24 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LateLowering.getLocalLowering) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SummaryCollector.rawArguments (cognitive 24) · ×1
  • SummaryCollector.rawArguments (cognitive 24) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1086 — SummaryCollector.rawArguments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (8 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnboxingInfoManager._updateUnboxingInfoOfMember (cognitive 24) · ×1
  • UnboxingInfoManager._updateUnboxingInfoOfMember (cognitive 24) pkg/vm/lib/transformations/type_flow/unboxing_info.dart:136 — UnboxingInfoManager._updateUnboxingInfoOfMember has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VMService._routeRequestImpl (cognitive 24) · ×1
  • VMService._routeRequestImpl (cognitive 24) sdk/lib/vmservice/vmservice.dart:735 — VMService._routeRequestImpl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionQualityMetricsComputer.gatherMetricsForSuggestions (cognitive 23) · ×1
  • CompletionQualityMetricsComputer.gatherMetricsForSuggestions (cognitive 23) pkg/analysis_server/tool/code_completion/completion_metrics.dart:984 — CompletionQualityMetricsComputer.gatherMetricsForSuggestions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelevanceDataCollector._recordTypeRelationships (cognitive 23) · ×1
  • RelevanceDataCollector._recordTypeRelationships (cognitive 23) pkg/analysis_server/tool/code_completion/relevance_metrics.dart:2053 — RelevanceDataCollector._recordTypeRelationships has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BytecodeGenerator._handleVariableInitialization (cognitive 23) · ×1
  • BytecodeGenerator._handleVariableInitialization (cognitive 23) pkg/dart2bytecode/lib/bytecode_generator.dart:4759 — BytecodeGenerator._handleVariableInitialization has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DispatchTable.output (cognitive 23) · ×1
  • DispatchTable.output (cognitive 23) pkg/dart2wasm/lib/dispatch_table.dart:811 — DispatchTable.output has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicDispatchTable.outputTargetTable (cognitive 23) · ×1
  • DynamicDispatchTable.outputTargetTable (cognitive 23) pkg/dart2wasm/lib/dynamic_dispatch_table.dart:203 — DynamicDispatchTable.outputTargetTable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver._analyzeFiles (cognitive 23) · ×1
  • Driver._analyzeFiles (cognitive 23) pkg/linter/tool/checks/driver.dart:60 — Driver._analyzeFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 2 (10 pts), loops 3 (6 pts), error handling 1 (5 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SnapshotGraph._dfs (cognitive 23) · ×1
  • _SnapshotGraph._dfs (cognitive 23) pkg/observatory/lib/object_graph.dart:1113 — _SnapshotGraph._dfs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SnapshotGraph._buildDominators (cognitive 23) · ×1
  • _SnapshotGraph._buildDominators (cognitive 23) pkg/observatory/lib/object_graph.dart:1420 — _SnapshotGraph._buildDominators has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 4 (9 pts), ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFuzz._emitMinimizedLiteralHelper (cognitive 23) · ×1
  • DartFuzz._emitMinimizedLiteralHelper (cognitive 23) runtime/tools/dartfuzz/dartfuzz.dart:802 — DartFuzz._emitMinimizedLiteralHelper has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpHeaders._parseCookies (cognitive 23) · ×1
  • _HttpHeaders._parseCookies (cognitive 23) sdk/lib/_http/http_headers.dart:595 — _HttpHeaders._parseCookies has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParameterParser.parseParameterValue (cognitive 23) · ×1
  • _ParameterParser.parseParameterValue (cognitive 23) sdk/lib/_http/http_headers.dart:798 — _ParameterParser.parseParameterValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CustomHashMap.remove (cognitive 23) · ×1
  • CustomHashMap.remove (cognitive 23) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:195 — CustomHashMap.remove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 1 (5 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseStringToBuffer (cognitive 23) · ×1
  • _ChunkedJsonParser.parseStringToBuffer (cognitive 23) sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1021 — _ChunkedJsonParser.parseStringToBuffer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator.visitAllocateArray (cognitive 23) · ×1
  • Arm64CodeGenerator.visitAllocateArray (cognitive 23) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:2167 — Arm64CodeGenerator.visitAllocateArray has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeGenerator.visitParallelMove (cognitive 23) · ×1
  • CodeGenerator.visitParallelMove (cognitive 23) pkg/native_compiler/lib/back_end/code_generator.dart:354 — CodeGenerator.visitParallelMove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (5 pts), loops 3, boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DevirtualizionOracle.isAlwaysStaticallyDispatchedTo (cognitive 23) · ×1
  • DevirtualizionOracle.isAlwaysStaticallyDispatchedTo (cognitive 23) pkg/dart2wasm/lib/deferred_load/devirtualization_oracle.dart:24 — DevirtualizionOracle.isAlwaysStaticallyDispatchedTo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CorrectionUtils.replaceSourceIndent (cognitive 23) · ×1
  • CorrectionUtils.replaceSourceIndent (cognitive 23) pkg/analysis_server_plugin/lib/edit/correction_utils.dart:242 — CorrectionUtils.replaceSourceIndent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstToIr.visitSwitchStatement (cognitive 23) · ×1
  • AstToIr.visitSwitchStatement (cognitive 23) pkg/cfg/lib/front_end/ast_to_ir.dart:1335 — AstToIr.visitSwitchStatement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InteropSpecializerFactory._getSpecializer (cognitive 23) · ×1
  • InteropSpecializerFactory._getSpecializer (cognitive 23) pkg/dart2wasm/lib/js/interop_specializer.dart:655 — InteropSpecializerFactory._getSpecializer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiTransformer.ensureNativeTypeMatch (cognitive 23) · ×1
  • FfiTransformer.ensureNativeTypeMatch (cognitive 23) pkg/vm/lib/modular/transformations/ffi/common.dart:1931 — FfiTransformer.ensureNativeTypeMatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FfiNativeTransformer.visitProcedure (cognitive 23) · ×1
  • FfiNativeTransformer.visitProcedure (cognitive 23) pkg/vm/lib/modular/transformations/ffi/native.dart:956 — FfiNativeTransformer.visitProcedure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Evaluator._visitExpression (cognitive 23) · ×1
  • Evaluator._visitExpression (cognitive 23) pkg/_fe_analyzer_shared/lib/src/metadata/evaluate.dart:48 — Evaluator._visitExpression has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 5 (9 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TypeReferenceIdentifierContext.ensureIdentifier (cognitive 23) · ×1
  • TypeReferenceIdentifierContext.ensureIdentifier (cognitive 23) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1495 — TypeReferenceIdentifierContext.ensureIdentifier has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts) (nesting depth added 3). 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.
D2 · Cognitive Complexity · Parser.parseInitializers (cognitive 23) · ×1
  • Parser.parseInitializers (cognitive 23) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4759 — Parser.parseInitializers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseFactoryMethod (cognitive 23) · ×1
  • Parser.parseFactoryMethod (cognitive 23) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6170 — Parser.parseFactoryMethod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser._computePrecedence (cognitive 23) · ×1
  • Parser._computePrecedence (cognitive 23) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7743 — Parser._computePrecedence has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseCascadeExpression (cognitive 23) · ×1
  • Parser.parseCascadeExpression (cognitive 23) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7794 — Parser.parseCascadeExpression has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdValue.decode (cognitive 23) · ×1
  • IdValue.decode (cognitive 23) pkg/_fe_analyzer_shared/lib/src/testing/id.dart:129 — IdValue.decode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (23 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AnalyticsManager.toHtml (cognitive 23) · ×1
  • AnalyticsManager.toHtml (cognitive 23) pkg/analysis_server/lib/src/analytics/analytics_manager.dart:387 — AnalyticsManager.toHtml has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 8 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · EditGetFixesHandler._computeDartFixes (cognitive 23) · ×1
  • EditGetFixesHandler._computeDartFixes (cognitive 23) pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart:168 — EditGetFixesHandler._computeDartFixes has cognitive complexity 23 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 3 (8 pts), loops 2 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationRunner._runRound (cognitive 23) · ×1
  • MigrationRunner._runRound (cognitive 23) pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_runner.dart:420 — MigrationRunner._runRound has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (8 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MinimalEditComputer._addEditFor (cognitive 23) · ×1
  • _MinimalEditComputer._addEditFor (cognitive 23) pkg/analysis_server/lib/src/lsp/source_edits.dart:465 — _MinimalEditComputer._addEditFor has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (9 pts), loops 2 (nesting depth added 2). 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.
D2 · Cognitive Complexity · PluginIsolate._computeEffectiveAnalysisRoots (cognitive 23) · ×1
  • PluginIsolate._computeEffectiveAnalysisRoots (cognitive 23) pkg/analysis_server/lib/src/plugin/plugin_isolate.dart:252 — PluginIsolate._computeEffectiveAnalysisRoots has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor._complete_controlFlowBlock (cognitive 23) · ×1
  • StatementCompletionProcessor._complete_controlFlowBlock (cognitive 23) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:411 — StatementCompletionProcessor._complete_controlFlowBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChangeTo._proposeGetterOrSetter (cognitive 23) · ×1
  • ChangeTo._proposeGetterOrSetter (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:337 — ChangeTo._proposeGetterOrSetter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToContains.compute (cognitive 23) · ×1
  • ConvertToContains.compute (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/convert_to_contains.dart:27 — ConvertToContains.compute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToInBodyConstructor._writeNameAndParameterList (cognitive 23) · ×1
  • ConvertToInBodyConstructor._writeNameAndParameterList (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:440 — ConvertToInBodyConstructor._writeNameAndParameterList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateField._proposeFromIdentifier (cognitive 23) · ×1
  • CreateField._proposeFromIdentifier (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/create_field.dart:148 — CreateField._proposeFromIdentifier has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateMethod._createMethodFromMethodInvocation (cognitive 23) · ×1
  • CreateMethod._createMethodFromMethodInvocation (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/create_method.dart:127 — CreateMethod._createMethodFromMethodInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateParameter.compute (cognitive 23) · ×1
  • CreateParameter.compute (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/create_parameter.dart:30 — CreateParameter.compute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveTypeName.compute (cognitive 23) · ×1
  • RemoveTypeName.compute (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/remove_type_name.dart:27 — RemoveTypeName.compute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplaceWithIsEven._validComparison (cognitive 23) · ×1
  • ReplaceWithIsEven._validComparison (cognitive 23) pkg/analysis_server/lib/src/services/correction/dart/replace_with_is_even.dart:102 — ReplaceWithIsEven._validComparison has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MatcherBuilder.buildMatchersForNode (cognitive 23) · ×1
  • _MatcherBuilder.buildMatchersForNode (cognitive 23) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart:201 — _MatcherBuilder.buildMatchersForNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MemberSorter._sortUnitMembers (cognitive 23) · ×1
  • MemberSorter._sortUnitMembers (cognitive 23) pkg/analysis_server/lib/src/services/correction/sort_members.dart:170 — MemberSorter._sortUnitMembers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PreviewVisitor.visitAnnotation (cognitive 23) · ×1
  • _PreviewVisitor.visitAnnotation (cognitive 23) pkg/analysis_server/lib/src/services/flutter/widget_previews.dart:271 — _PreviewVisitor.visitAnnotation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractWidgetRefactoringImpl._checkSelection (cognitive 23) · ×1
  • ExtractWidgetRefactoringImpl._checkSelection (cognitive 23) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:178 — ExtractWidgetRefactoringImpl._checkSelection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MoveFileRefactoringImpl.buildChange (cognitive 23) · ×1
  • MoveFileRefactoringImpl.buildChange (cognitive 23) pkg/analysis_server/lib/src/services/refactoring/legacy/move_file.dart:67 — MoveFileRefactoringImpl.buildChange has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (10 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryCyclesPerformanceComponent.render (cognitive 23) · ×1
  • _LibraryCyclesPerformanceComponent.render (cognitive 23) pkg/analysis_server/lib/src/status/pages/performance_page.dart:200 — _LibraryCyclesPerformanceComponent.render has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (7 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AnnotationV1Children._tokenElement (cognitive 23) · ×1
  • _AnnotationV1Children._tokenElement (cognitive 23) pkg/analyzer/lib/src/dart/ast/ast.dart:64492 — _AnnotationV1Children._tokenElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PrefixScope.PrefixScope (cognitive 23) · ×1
  • PrefixScope.PrefixScope (cognitive 23) pkg/analyzer/lib/src/dart/element/scope.dart:655 — PrefixScope.PrefixScope has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionMemberResolver._chooseMostSpecific (cognitive 23) · ×1
  • ExtensionMemberResolver._chooseMostSpecific (cognitive 23) pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart:383 — ExtensionMemberResolver._chooseMostSpecific has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamedTypeResolver._instantiateElement (cognitive 23) · ×1
  • NamedTypeResolver._instantiateElement (cognitive 23) pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart:434 — NamedTypeResolver._instantiateElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver._resolveTargetInterfaceElement (cognitive 23) · ×1
  • PropertyElementResolver._resolveTargetInterfaceElement (cognitive 23) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:1859 — PropertyElementResolver._resolveTargetInterfaceElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.computeWhyNotPromotedMessages (cognitive 23) · ×1
  • TypeAnalyzer.computeWhyNotPromotedMessages (cognitive 23) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:810 — TypeAnalyzer.computeWhyNotPromotedMessages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypedLiteralResolver._inferCollectionElementType (cognitive 23) · ×1
  • TypedLiteralResolver._inferCollectionElementType (cognitive 23) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:366 — TypedLiteralResolver._inferCollectionElementType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalSuperParameters (cognitive 23) · ×1
  • DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalSuperParameters (cognitive 23) pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart:266 — DeprecatedFunctionalityVerifier._checkForDeprecatedOptionalSuperParameters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementUsageDetectorV2.checkUsage (cognitive 23) · ×1
  • ElementUsageDetectorV2.checkUsage (cognitive 23) pkg/analyzer/lib/src/error/element_usage_detector.dart:540 — ElementUsageDetectorV2.checkUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiteralElementVerifier._verifyElement (cognitive 23) · ×1
  • LiteralElementVerifier._verifyElement (cognitive 23) pkg/analyzer/lib/src/error/literal_element_verifier.dart:88 — LiteralElementVerifier._verifyElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MemberDuplicateDefinitionVerifier._checkExtensionStatic (cognitive 23) · ×1
  • MemberDuplicateDefinitionVerifier._checkExtensionStatic (cognitive 23) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:487 — MemberDuplicateDefinitionVerifier._checkExtensionStatic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.endVariablesDeclaration (cognitive 23) · ×1
  • AstBuilder.endVariablesDeclaration (cognitive 23) pkg/analyzer/lib/src/fasta/ast_builder.dart:3647 — AstBuilder.endVariablesDeclaration has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkForBaseClassOrMixinImplementedOutsideOfLibrary (cognitive 23) · ×1
  • ErrorVerifier._checkForBaseClassOrMixinImplementedOutsideOfLibrary (cognitive 23) pkg/analyzer/lib/src/generated/error_verifier.dart:3701 — ErrorVerifier._checkForBaseClassOrMixinImplementedOutsideOfLibrary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForWrongTypeParameterVarianceInMethod (cognitive 23) · ×1
  • ErrorVerifier._checkForWrongTypeParameterVarianceInMethod (cognitive 23) pkg/analyzer/lib/src/generated/error_verifier.dart:7937 — ErrorVerifier._checkForWrongTypeParameterVarianceInMethod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IgnoreInfo.isIgnoreForFileComment (cognitive 23) · ×1
  • IgnoreInfo.isIgnoreForFileComment (cognitive 23) pkg/analyzer/lib/src/ignore_comments/ignore_info.dart:246 — IgnoreInfo.isIgnoreForFileComment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21 (22 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _InfoBuilder.build (cognitive 23) · ×1
  • _InfoBuilder.build (cognitive 23) pkg/analyzer/lib/src/summary2/informative_data.dart:571 — _InfoBuilder.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), loops 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DartEditBuilderImpl._canWriteType (cognitive 23) · ×1
  • DartEditBuilderImpl._canWriteType (cognitive 23) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1189 — DartEditBuilderImpl._canWriteType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective (cognitive 23) · ×1
  • DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective (cognitive 23) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3299 — DartFileEditBuilderImpl._insertDocImportIntoLibraryDirective has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MapTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 23) · ×1
  • MapTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 23) pkg/compiler/lib/src/inferrer/map_tracer.dart:79 — MapTracerVisitor.visitDynamicCallSiteTypeInformation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 23) · ×1
  • TracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 23) pkg/compiler/lib/src/inferrer/node_tracer.dart:433 — TracerVisitor.visitDynamicCallSiteTypeInformation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CallPosition.getSemanticPositionForCall (cognitive 23) · ×1
  • CallPosition.getSemanticPositionForCall (cognitive 23) pkg/compiler/lib/src/io/position_information.dart:720 — CallPosition.getSemanticPositionForCall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RecipeToIdentifier.visitFunctionType (cognitive 23) · ×1
  • _RecipeToIdentifier.visitFunctionType (cognitive 23) pkg/compiler/lib/src/js_backend/type_reference.dart:712 — _RecipeToIdentifier.visitFunctionType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitStringify (cognitive 23) · ×1
  • SsaInstructionSimplifier.visitStringify (cognitive 23) pkg/compiler/lib/src/ssa/optimize.dart:2403 — SsaInstructionSimplifier.visitStringify has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaValueRangeAnalyzer.visitConditionalBranch (cognitive 23) · ×1
  • SsaValueRangeAnalyzer.visitConditionalBranch (cognitive 23) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:1260 — SsaValueRangeAnalyzer.visitConditionalBranch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (23 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DominatorFinder.run (cognitive 23) · ×1
  • _DominatorFinder.run (cognitive 23) pkg/dart2js_info/lib/src/graph.dart:285 — _DominatorFinder.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuildCliSubcommand.run (cognitive 23) · ×1
  • BuildCliSubcommand.run (cognitive 23) pkg/dartdev/lib/src/commands/build.dart:204 — BuildCliSubcommand.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProgramCompiler._emitFactoryInvocation (cognitive 23) · ×1
  • ProgramCompiler._emitFactoryInvocation (cognitive 23) pkg/dev_compiler/lib/src/kernel/compiler.dart:7458 — ProgramCompiler._emitFactoryInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitCast (cognitive 23) · ×1
  • ProgramCompiler._emitCast (cognitive 23) pkg/dev_compiler/lib/src/kernel/compiler.dart:7755 — ProgramCompiler._emitCast has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryCompiler._emitJSInteropClassNonExternalMembers (cognitive 23) · ×1
  • LibraryCompiler._emitJSInteropClassNonExternalMembers (cognitive 23) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1601 — LibraryCompiler._emitJSInteropClassNonExternalMembers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitFactoryInvocation (cognitive 23) · ×1
  • LibraryCompiler._emitFactoryInvocation (cognitive 23) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8325 — LibraryCompiler._emitFactoryInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitCast (cognitive 23) · ×1
  • LibraryCompiler._emitCast (cognitive 23) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8622 — LibraryCompiler._emitCast has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Import.finalizeImports (cognitive 23) · ×1
  • Import.finalizeImports (cognitive 23) pkg/front_end/lib/src/base/import.dart:57 — Import.finalizeImports has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InitializationFromUri.initialize (cognitive 23) · ×1
  • _InitializationFromUri.initialize (cognitive 23) pkg/front_end/lib/src/base/incremental_compiler.dart:3396 — _InitializationFromUri.initialize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (8 pts), boolean chains 4, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalSerializer.initialize (cognitive 23) · ×1
  • IncrementalSerializer.initialize (cognitive 23) pkg/front_end/lib/src/base/incremental_serializer.dart:26 — IncrementalSerializer.initialize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (7 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FactoryEncoding._isCyclicRedirectingFactory (cognitive 23) · ×1
  • FactoryEncoding._isCyclicRedirectingFactory (cognitive 23) pkg/front_end/lib/src/fragment/factory/encoding.dart:802 — FactoryEncoding._isCyclicRedirectingFactory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator._evaluate (cognitive 23) · ×1
  • ConstantEvaluator._evaluate (cognitive 23) pkg/front_end/lib/src/kernel/constant_evaluator.dart:2823 — ConstantEvaluator._evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.endNamedMixinApplication (cognitive 23) · ×1
  • OutlineBuilder.endNamedMixinApplication (cognitive 23) pkg/front_end/lib/src/source/outline_builder.dart:2788 — OutlineBuilder.endNamedMixinApplication has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelCompiledData.getOffsetFromId (cognitive 23) · ×1
  • KernelCompiledData.getOffsetFromId (cognitive 23) pkg/front_end/lib/src/testing/kernel_id_testing.dart:145 — KernelCompiledData.getOffsetFromId has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (23 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MergeVisitor.mergeFunctionTypes (cognitive 23) · ×1
  • MergeVisitor.mergeFunctionTypes (cognitive 23) pkg/kernel/lib/src/merge_visitor.dart:33 — MergeVisitor.mergeFunctionTypes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._visitConstructorInvocation (cognitive 23) · ×1
  • _Visitor._visitConstructorInvocation (cognitive 23) pkg/linter/lib/src/rules/avoid_redundant_argument_values.dart:134 — _Visitor._visitConstructorInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeclarationVisitor.checkPatternElements (cognitive 23) · ×1
  • _DeclarationVisitor.checkPatternElements (cognitive 23) pkg/linter/lib/src/rules/parameter_assignments.dart:63 — _DeclarationVisitor.checkPatternElements has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitMethodInvocation (cognitive 23) · ×1
  • _Visitor.visitMethodInvocation (cognitive 23) pkg/linter/lib/src/rules/prefer_iterable_whereType.dart:36 — _Visitor.visitMethodInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeclarationGatherer.addDeclarations (cognitive 23) · ×1
  • _DeclarationGatherer.addDeclarations (cognitive 23) pkg/linter/lib/src/rules/unreachable_from_main.dart:56 — _DeclarationGatherer.addDeclarations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitIfElement (cognitive 23) · ×1
  • _Visitor.visitIfElement (cognitive 23) pkg/linter/lib/src/rules/use_null_aware_elements.dart:42 — _Visitor.visitIfElement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseType (cognitive 23) · ×1
  • Parser.parseType (cognitive 23) pkg/kernel/lib/testing/type_parser.dart:477 — Parser.parseType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WidgetCreatorTracker._transformWidgetConstructors (cognitive 23) · ×1
  • WidgetCreatorTracker._transformWidgetConstructors (cognitive 23) pkg/kernel/lib/transformations/track_widget_constructor_locations.dart:779 — WidgetCreatorTracker._transformWidgetConstructors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WorkList.processInvocation (cognitive 23) · ×1
  • _WorkList.processInvocation (cognitive 23) pkg/vm/lib/transformations/type_flow/analysis.dart:1934 — _WorkList.processInvocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (23 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnaryOperation.simplify (cognitive 23) · ×1
  • UnaryOperation.simplify (cognitive 23) pkg/vm/lib/transformations/type_flow/summary.dart:908 — UnaryOperation.simplify has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WideConeType.intersection (cognitive 23) · ×1
  • WideConeType.intersection (cognitive 23) pkg/vm/lib/transformations/type_flow/types.dart:1103 — WideConeType.intersection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleUnreachableCodeElimination.visitSwitchStatement (cognitive 23) · ×1
  • SimpleUnreachableCodeElimination.visitSwitchStatement (cognitive 23) pkg/vm/lib/transformations/unreachable_code_elimination.dart:192 — SimpleUnreachableCodeElimination.visitSwitchStatement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · timeline.processTimelineResponse (cognitive 23) · ×1
  • timeline.processTimelineResponse (cognitive 23) REDACTED:584 — timeline.processTimelineResponse has cognitive complexity 23 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 6 (11 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · graphexplorer.Graph.loadDartHeapSnapshot (cognitive 23) · ×1
  • graphexplorer.Graph.loadDartHeapSnapshot (cognitive 23) runtime/tools/graphexplorer/graphexplorer.js:155 — graphexplorer.Graph.loadDartHeapSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 6 (8 pts), ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · computeDominators (cognitive 23) · ×1
  • computeDominators (cognitive 23) runtime/tools/graphexplorer/graphexplorer.js:576 — computeDominators has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartLanguageServerBenchmark._launch (cognitive 22) · ×1
  • DartLanguageServerBenchmark._launch (cognitive 22) pkg/analysis_server/tool/benchmark_tools/language_server_benchmark.dart:256 — DartLanguageServerBenchmark._launch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (6 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeShapeMetricsComputer._writeChildData (cognitive 22) · ×1
  • CodeShapeMetricsComputer._writeChildData (cognitive 22) pkg/analysis_server/tool/code_completion/code_metrics.dart:1371 — CodeShapeMetricsComputer._writeChildData has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 3 (8 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AstNodeImplGenerator._buildImplClass (cognitive 22) · ×1
  • AstNodeImplGenerator._buildImplClass (cognitive 22) pkg/analyzer/tool/generators/ast_generator.dart:67 — AstNodeImplGenerator._buildImplClass has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Translator.getClosure (cognitive 22) · ×1
  • Translator.getClosure (cognitive 22) pkg/dart2wasm/lib/translator.dart:1361 — Translator.getClosure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4, ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _VerifyingVisitor.visitProcedure (cognitive 22) · ×1
  • _VerifyingVisitor.visitProcedure (cognitive 22) pkg/kernel/lib/verifier.dart:896 — _VerifyingVisitor.visitProcedure has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 11. 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.
D2 · Cognitive Complexity · StatusFile.read (cognitive 22) · ×1
  • StatusFile.read (cognitive 22) pkg/status_file/lib/status_file.dart:54 — StatusFile.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (7 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Api.parse (cognitive 22) · ×1
  • Api.parse (cognitive 22) pkg/vm_service/tool/dart/generate_dart_common.dart:96 — Api.parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Type.generateAssert (cognitive 22) · ×1
  • Type.generateAssert (cognitive 22) pkg/vm_service/tool/dart/generate_dart_common.dart:965 — Type.generateAssert has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StringBase.indexOf (cognitive 22) · ×1
  • _StringBase.indexOf (cognitive 22) sdk/lib/_internal/vm/lib/string_patch.dart:383 — _StringBase.indexOf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator._prepareNamedParameters (cognitive 22) · ×1
  • Arm64CodeGenerator._prepareNamedParameters (cognitive 22) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:186 — Arm64CodeGenerator._prepareNamedParameters has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator._passArguments (cognitive 22) · ×1
  • Arm64CodeGenerator._passArguments (cognitive 22) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:639 — Arm64CodeGenerator._passArguments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegisterAllocationChecker.computeInOut (cognitive 22) · ×1
  • RegisterAllocationChecker.computeInOut (cognitive 22) pkg/native_compiler/lib/back_end/regalloc_checker.dart:135 — RegisterAllocationChecker.computeInOut has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 5 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DateTime.parse (cognitive 22) · ×1
  • DateTime.parse (cognitive 22) sdk/lib/core/date_time.dart:252 — DateTime.parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FunctionRegistry.getFunction (cognitive 22) · ×1
  • FunctionRegistry.getFunction (cognitive 22) pkg/cfg/lib/ir/functions.dart:340 — FunctionRegistry.getFunction has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 6, ternaries 2 (4 pts), match/switch 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · SSALivenessAnalysis.computeInitialSets (cognitive 22) · ×1
  • SSALivenessAnalysis.computeInitialSets (cognitive 22) pkg/cfg/lib/ir/liveness_analysis.dart:142 — SSALivenessAnalysis.computeInitialSets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (11 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValueNumbering.run (cognitive 22) · ×1
  • ValueNumbering.run (cognitive 22) pkg/cfg/lib/passes/value_numbering.dart:31 — ValueNumbering.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListPatternShape.witnessToDart (cognitive 22) · ×1
  • ListPatternShape.witnessToDart (cognitive 22) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:158 — ListPatternShape.witnessToDart has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModifierContext.parseFormalParameterModifiers (cognitive 22) · ×1
  • ModifierContext.parseFormalParameterModifiers (cognitive 22) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:205 — ModifierContext.parseFormalParameterModifiers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseEnumHeaderOpt (cognitive 22) · ×1
  • Parser.parseEnumHeaderOpt (cognitive 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:2749 — Parser.parseEnumHeaderOpt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.computeTypeAfterIsOrAs (cognitive 22) · ×1
  • Parser.computeTypeAfterIsOrAs (cognitive 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9674 — Parser.computeTypeAfterIsOrAs has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (8 pts) (nesting depth added 4). 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.
D2 · Cognitive Complexity · Parser.looksLikeExpressionAfterAwaitOrYield (cognitive 22) · ×1
  • Parser.looksLikeExpressionAfterAwaitOrYield (cognitive 22) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:10571 — Parser.looksLikeExpressionAfterAwaitOrYield has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer.analyzeMapPattern (cognitive 22) · ×1
  • TypeAnalyzer.analyzeMapPattern (cognitive 22) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:1477 — TypeAnalyzer.analyzeMapPattern has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevAnalysisServer.processDirectories (cognitive 22) · ×1
  • DevAnalysisServer.processDirectories (cognitive 22) pkg/analysis_server/lib/src/server/dev_server.dart:37 — DevAnalysisServer.processDirectories has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DeclarationHelper._addExternalTopLevelDeclarations (cognitive 22) · ×1
  • DeclarationHelper._addExternalTopLevelDeclarations (cognitive 22) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:935 — DeclarationHelper._addExternalTopLevelDeclarations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitExtensionDeclaration (cognitive 22) · ×1
  • InScopeCompletionPass.visitExtensionDeclaration (cognitive 22) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1285 — InScopeCompletionPass.visitExtensionDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitMixinDeclaration (cognitive 22) · ×1
  • InScopeCompletionPass.visitMixinDeclaration (cognitive 22) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:2177 — InScopeCompletionPass.visitMixinDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementCompletionProcessor._complete_switchStatement (cognitive 22) · ×1
  • StatementCompletionProcessor._complete_switchStatement (cognitive 22) pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart:979 — StatementCompletionProcessor._complete_switchStatement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToWildcardVariable.compute (cognitive 22) · ×1
  • ConvertToWildcardVariable.compute (cognitive 22) pkg/analysis_server/lib/src/services/correction/dart/convert_to_wildcard_variable.dart:37 — ConvertToWildcardVariable.compute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateMissingOverrides.compute (cognitive 22) · ×1
  • CreateMissingOverrides.compute (cognitive 22) pkg/analysis_server/lib/src/services/correction/dart/create_missing_overrides.dart:34 — CreateMissingOverrides.compute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3, boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestructureLocalVariableAssignment.computeObjectPattern (cognitive 22) · ×1
  • DestructureLocalVariableAssignment.computeObjectPattern (cognitive 22) pkg/analysis_server/lib/src/services/correction/dart/destructure_local_variable_assignment.dart:46 — DestructureLocalVariableAssignment.computeObjectPattern has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterParentAndChild.swapParentAndChild (cognitive 22) · ×1
  • FlutterParentAndChild.swapParentAndChild (cognitive 22) pkg/analysis_server/lib/src/services/correction/dart/flutter_swap_with_child.dart:21 — FlutterParentAndChild.swapParentAndChild has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AddTypeParameter.validate (cognitive 22) · ×1
  • AddTypeParameter.validate (cognitive 22) pkg/analysis_server/lib/src/services/correction/fix/data_driven/add_type_parameter.dart:50 — AddTypeParameter.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameParameter.apply (cognitive 22) · ×1
  • RenameParameter.apply (cognitive 22) pkg/analysis_server/lib/src/services/correction/fix/data_driven/rename_parameter.dart:25 — RenameParameter.apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RenameParameter.validate (cognitive 22) · ×1
  • RenameParameter.validate (cognitive 22) pkg/analysis_server/lib/src/services/correction/fix/data_driven/rename_parameter.dart:70 — RenameParameter.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (3 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExtractWidgetRefactoringImpl._writeWidgetDeclaration (cognitive 22) · ×1
  • ExtractWidgetRefactoringImpl._writeWidgetDeclaration (cognitive 22) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:435 — ExtractWidgetRefactoringImpl._writeWidgetDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ContextRootImpl._isExcluded (cognitive 22) · ×1
  • ContextRootImpl._isExcluded (cognitive 22) pkg/analyzer/lib/src/dart/analysis/context_root.dart:138 — ContextRootImpl._isExcluded has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Search.references (cognitive 22) · ×1
  • Search.references (cognitive 22) pkg/analyzer/lib/src/dart/analysis/search.dart:573 — Search.references has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Search._searchReferences_Field (cognitive 22) · ×1
  • Search._searchReferences_Field (cognitive 22) pkg/analyzer/lib/src/dart/analysis/search.dart:1004 — Search._searchReferences_Field has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVisitor.visitBinaryOperatorInvocation (cognitive 22) · ×1
  • ConstantVisitor.visitBinaryOperatorInvocation (cognitive 22) pkg/analyzer/lib/src/dart/constant/evaluation.dart:667 — ConstantVisitor.visitBinaryOperatorInvocation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TypeSystemImpl._futureTypeOfBounded (cognitive 22) · ×1
  • TypeSystemImpl._futureTypeOfBounded (cognitive 22) pkg/analyzer/lib/src/dart/element/type_system.dart:1816 — TypeSystemImpl._futureTypeOfBounded has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ErrorHelper.reportNullOrNonTypeElement (cognitive 22) · ×1
  • _ErrorHelper.reportNullOrNonTypeElement (cognitive 22) pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart:705 — _ErrorHelper.reportNullOrNonTypeElement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RecordTypeAnnotationResolver.reportInvalidFieldNames (cognitive 22) · ×1
  • RecordTypeAnnotationResolver.reportInvalidFieldNames (cognitive 22) pkg/analyzer/lib/src/dart/resolver/record_type_annotation_resolver.dart:64 — RecordTypeAnnotationResolver.reportInvalidFieldNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypedLiteralResolver.resolveSetOrMapLiteral (cognitive 22) · ×1
  • TypedLiteralResolver.resolveSetOrMapLiteral (cognitive 22) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:109 — TypedLiteralResolver.resolveSetOrMapLiteral has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Constructor.updateWithInitializers (cognitive 22) · ×1
  • _Constructor.updateWithInitializers (cognitive 22) pkg/analyzer/lib/src/error/constructor_fields_verifier.dart:255 — _Constructor.updateWithInitializers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryExportRequirements.build (cognitive 22) · ×1
  • LibraryExportRequirements.build (cognitive 22) pkg/analyzer/lib/src/fine/requirements.dart:468 — LibraryExportRequirements.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdkConstraintExtractor._initializeTextAndOffset (cognitive 22) · ×1
  • SdkConstraintExtractor._initializeTextAndOffset (cognitive 22) pkg/analyzer/lib/src/hint/sdk_constraint_extractor.dart:69 — SdkConstraintExtractor._initializeTextAndOffset has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (19 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Blake3Base.hash (cognitive 22) · ×1
  • _Blake3Base.hash (cognitive 22) pkg/analyzer/lib/src/utilities/hash/blake3_internal.dart:36 — _Blake3Base.hash has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (9 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl.writeConstructorDeclaration (cognitive 22) · ×1
  • DartEditBuilderImpl.writeConstructorDeclaration (cognitive 22) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:219 — DartEditBuilderImpl.writeConstructorDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelInfoCollector.visitLibrary (cognitive 22) · ×1
  • KernelInfoCollector.visitLibrary (cognitive 22) pkg/compiler/lib/src/dump_info.dart:846 — KernelInfoCollector.visitLibrary has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DumpInfoTask.buildDumpInfoData (cognitive 22) · ×1
  • DumpInfoTask.buildDumpInfoData (cognitive 22) pkg/compiler/lib/src/dump_info.dart:1828 — DumpInfoTask.buildDumpInfoData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 6 (9 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTypeGraphBuilder.visitLogicalExpression (cognitive 22) · ×1
  • KernelTypeGraphBuilder.visitLogicalExpression (cognitive 22) pkg/compiler/lib/src/inferrer/builder.dart:2265 — KernelTypeGraphBuilder.visitLogicalExpression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (22 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TracerVisitor.analyzeStoredIntoList (cognitive 22) · ×1
  • TracerVisitor.analyzeStoredIntoList (cognitive 22) pkg/compiler/lib/src/inferrer/node_tracer.dart:297 — TracerVisitor.analyzeStoredIntoList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (TracerVisitor.analyzeStoredIntoSet, TracerVisitor.analyzeStoredIntoMap) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TracerVisitor.analyzeStoredIntoSet (cognitive 22) · ×1
  • TracerVisitor.analyzeStoredIntoSet (cognitive 22) pkg/compiler/lib/src/inferrer/node_tracer.dart:317 — TracerVisitor.analyzeStoredIntoSet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (TracerVisitor.analyzeStoredIntoList, TracerVisitor.analyzeStoredIntoMap) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TracerVisitor.analyzeStoredIntoMap (cognitive 22) · ×1
  • TracerVisitor.analyzeStoredIntoMap (cognitive 22) pkg/compiler/lib/src/inferrer/node_tracer.dart:338 — TracerVisitor.analyzeStoredIntoMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (TracerVisitor.analyzeStoredIntoList, TracerVisitor.analyzeStoredIntoSet) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · RecordTypeMask.isInMask (cognitive 22) · ×1
  • RecordTypeMask.isInMask (cognitive 22) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:319 — RecordTypeMask.isInMask has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentEmitter.emitTypeRules (cognitive 22) · ×1
  • FragmentEmitter.emitTypeRules (cognitive 22) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:2122 — FragmentEmitter.emitTypeRules has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (7 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsKernelToElementMap.JsKernelToElementMap (cognitive 22) · ×1
  • JsKernelToElementMap.JsKernelToElementMap (cognitive 22) pkg/compiler/lib/src/js_model/element_map_impl.dart:117 — JsKernelToElementMap.JsKernelToElementMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsKernelToElementMap._buildClosureClassFields (cognitive 22) · ×1
  • JsKernelToElementMap._buildClosureClassFields (cognitive 22) pkg/compiler/lib/src/js_model/element_map_impl.dart:1923 — JsKernelToElementMap._buildClosureClassFields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator._expressionType (cognitive 22) · ×1
  • SsaCodeGenerator._expressionType (cognitive 22) pkg/compiler/lib/src/ssa/codegen.dart:538 — SsaCodeGenerator._expressionType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaTrustedLateCheckRemover.visitLateCheck (cognitive 22) · ×1
  • SsaTrustedLateCheckRemover.visitLateCheck (cognitive 22) pkg/compiler/lib/src/ssa/codegen_helpers.dart:610 — SsaTrustedLateCheckRemover.visitLateCheck has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShiftRightSpecializer.tryConvertToBuiltin (cognitive 22) · ×1
  • ShiftRightSpecializer.tryConvertToBuiltin (cognitive 22) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1286 — ShiftRightSpecializer.tryConvertToBuiltin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitTypeEval (cognitive 22) · ×1
  • SsaInstructionSimplifier.visitTypeEval (cognitive 22) pkg/compiler/lib/src/ssa/optimize.dart:2500 — SsaInstructionSimplifier.visitTypeEval has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (22 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitShiftRight (cognitive 22) · ×1
  • SsaInstructionSimplifier.visitShiftRight (cognitive 22) pkg/compiler/lib/src/ssa/optimize.dart:2935 — SsaInstructionSimplifier.visitShiftRight has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SideEffects.toString (cognitive 22) · ×1
  • SideEffects.toString (cognitive 22) pkg/compiler/lib/src/universe/side_effects.dart:191 — SideEffects.toString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartDebugAdapter._configureIsolateSettings (cognitive 22) · ×1
  • DartDebugAdapter._configureIsolateSettings (cognitive 22) pkg/dap_adapters/lib/src/adapters/dart.dart:792 — DartDebugAdapter._configureIsolateSettings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, error handling 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseDebugAdapter.handleIncomingRequest (cognitive 22) · ×1
  • BaseDebugAdapter.handleIncomingRequest (cognitive 22) pkg/dap_adapters/lib/src/base_debug_adapter.dart:326 — BaseDebugAdapter.handleIncomingRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InstallCommand._parseArguments (cognitive 22) · ×1
  • InstallCommand._parseArguments (cognitive 22) pkg/dartdev/lib/src/commands/install.dart:96 — InstallCommand._parseArguments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionTypeBuilderImpl.substituteRange (cognitive 22) · ×1
  • FunctionTypeBuilderImpl.substituteRange (cognitive 22) pkg/front_end/lib/src/builder/function_type_builder.dart:296 — FunctionTypeBuilderImpl.substituteRange has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordTypeBuilderImpl.printOn (cognitive 22) · ×1
  • RecordTypeBuilderImpl.printOn (cognitive 22) pkg/front_end/lib/src/builder/record_type_builder.dart:64 — RecordTypeBuilderImpl.printOn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endSwitchBlock (cognitive 22) · ×1
  • BodyBuilderImpl.endSwitchBlock (cognitive 22) pkg/front_end/lib/src/kernel/body_builder.dart:5383 — BodyBuilderImpl.endSwitchBlock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), ternaries 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.isSubtype (cognitive 22) · ×1
  • ConstantEvaluator.isSubtype (cognitive 22) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5772 — ConstantEvaluator.isSubtype has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CfeSealedClassOperations.getDirectSubclasses (cognitive 22) · ×1
  • CfeSealedClassOperations.getDirectSubclasses (cognitive 22) pkg/front_end/lib/src/kernel/exhaustiveness.dart:480 — CfeSealedClassOperations.getDirectSubclasses has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AugmentedParameters.registerParameters (cognitive 22) · ×1
  • AugmentedParameters.registerParameters (cognitive 22) pkg/front_end/lib/src/source/parameters.dart:91 — AugmentedParameters.registerParameters has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceExtensionTypeDeclarationBuilder._buildRepresentationType (cognitive 22) · ×1
  • SourceExtensionTypeDeclarationBuilder._buildRepresentationType (cognitive 22) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:457 — SourceExtensionTypeDeclarationBuilder._buildRepresentationType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (22 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartTypeToTextVisitor.visitFunctionType (cognitive 22) · ×1
  • DartTypeToTextVisitor.visitFunctionType (cognitive 22) pkg/front_end/lib/src/testing/id_testing_utils.dart:802 — DartTypeToTextVisitor.visitFunctionType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase._computeAssignabilityKind (cognitive 22) · ×1
  • InferenceVisitorBase._computeAssignabilityKind (cognitive 22) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:863 — InferenceVisitorBase._computeAssignabilityKind has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase.findInterfaceMember (cognitive 22) · ×1
  • InferenceVisitorBase.findInterfaceMember (cognitive 22) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:1398 — InferenceVisitorBase.findInterfaceMember has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase.preCheckInvocationContravariance (cognitive 22) · ×1
  • InferenceVisitorBase.preCheckInvocationContravariance (cognitive 22) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:5011 — InferenceVisitorBase.preCheckInvocationContravariance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FrontendServerClient.compileExpressionToJs (cognitive 22) · ×1
  • FrontendServerClient.compileExpressionToJs (cognitive 22) pkg/frontend_server_client/lib/src/frontend_server_client.dart:327 — FrontendServerClient.compileExpressionToJs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitFieldDeclaration (cognitive 22) · ×1
  • _Visitor.visitFieldDeclaration (cognitive 22) pkg/linter/lib/src/rules/avoid_field_initializers_in_const_classes.dart:86 — _Visitor.visitFieldDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitClassDeclaration (cognitive 22) · ×1
  • _Visitor.visitClassDeclaration (cognitive 22) pkg/linter/lib/src/rules/hash_and_equals.dart:37 — _Visitor.visitClassDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackTraceHeader.tryParseHeaderLine (cognitive 22) · ×1
  • StackTraceHeader.tryParseHeaderLine (cognitive 22) pkg/native_stack_traces/lib/src/convert.dart:137 — StackTraceHeader.tryParseHeaderLine has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineNumberProgramHeader.fromReader (cognitive 22) · ×1
  • LineNumberProgramHeader.fromReader (cognitive 22) pkg/native_stack_traces/lib/src/dwarf.dart:1403 — LineNumberProgramHeader.fromReader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pdb._decodeAnnotations (cognitive 22) · ×1
  • Pdb._decodeAnnotations (cognitive 22) pkg/native_stack_traces/lib/src/pdb.dart:1162 — Pdb._decodeAnnotations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerLocation._completeFunction (cognitive 22) · ×1
  • DebuggerLocation._completeFunction (cognitive 22) pkg/observatory/lib/src/debugger/debugger_location.dart:323 — DebuggerLocation._completeFunction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Instructions.serialize (cognitive 22) · ×1
  • Instructions.serialize (cognitive 22) pkg/wasm_builder/lib/src/ir/instructions.dart:66 — Instructions.serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModulePrinter.print (cognitive 22) · ×1
  • ModulePrinter.print (cognitive 22) pkg/wasm_builder/lib/src/serialize/printer.dart:254 — ModulePrinter.print has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 6 (9 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _ClassInfo._initDispatchTargets (cognitive 22) · ×1
  • _ClassInfo._initDispatchTargets (cognitive 22) pkg/vm/lib/transformations/dynamic_interface_annotator.dart:644 — _ClassInfo._initDispatchTargets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SummaryCollector._makeNarrow (cognitive 22) · ×1
  • SummaryCollector._makeNarrow (cognitive 22) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1524 — SummaryCollector._makeNarrow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TreeShaker.addUsedMember (cognitive 22) · ×1
  • TreeShaker.addUsedMember (cognitive 22) pkg/vm/lib/transformations/type_flow/transformer.dart:1286 — TreeShaker.addUsedMember has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetType.intersection (cognitive 22) · ×1
  • SetType.intersection (cognitive 22) pkg/vm/lib/transformations/type_flow/types.dart:875 — SetType.intersection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WideConeType.union (cognitive 22) · ×1
  • WideConeType.union (cognitive 22) pkg/vm/lib/transformations/type_flow/types.dart:1064 — WideConeType.union has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevFS._writeDevFSFile (cognitive 22) · ×1
  • DevFS._writeDevFSFile (cognitive 22) sdk/lib/vmservice/devfs.dart:280 — DevFS._writeDevFSFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator.getClassDeclaration (cognitive 21) · ×1
  • BytecodeGenerator.getClassDeclaration (cognitive 21) pkg/dart2bytecode/lib/bytecode_generator.dart:313 — BytecodeGenerator.getClassDeclaration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BytecodeGenerator.end (cognitive 21) · ×1
  • BytecodeGenerator.end (cognitive 21) pkg/dart2bytecode/lib/bytecode_generator.dart:2046 — BytecodeGenerator.end has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (21 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Component.write (cognitive 21) · ×1
  • Component.write (cognitive 21) pkg/dart2bytecode/lib/declarations.dart:1437 — Component.write has cognitive complexity 21 (threshold 15). Drivers by points: loops 14, if/else 5 (7 pts) (nesting depth added 2). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _Allocator._visitFunction (cognitive 21) · ×1
  • _Allocator._visitFunction (cognitive 21) pkg/dart2bytecode/lib/local_vars.dart:998 — _Allocator._visitFunction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator.visitTryCatch (cognitive 21) · ×1
  • AstCodeGenerator.visitTryCatch (cognitive 21) pkg/dart2wasm/lib/code_generator.dart:931 — AstCodeGenerator.visitTryCatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstantAccessor._defineConstantInModule (cognitive 21) · ×1
  • _ConstantAccessor._defineConstantInModule (cognitive 21) pkg/dart2wasm/lib/constants.dart:2055 — _ConstantAccessor._defineConstantInModule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _UsageCollector._findVariablesStoredInFields (cognitive 21) · ×1
  • _UsageCollector._findVariablesStoredInFields (cognitive 21) pkg/dart2wasm/lib/constructor_info.dart:158 — _UsageCollector._findVariablesStoredInFields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DryRunSummarizer._lintChecks (cognitive 21) · ×1
  • DryRunSummarizer._lintChecks (cognitive 21) pkg/dart2wasm/lib/dry_run.dart:197 — DryRunSummarizer._lintChecks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicDispatchTable.outputClassIdTable (cognitive 21) · ×1
  • DynamicDispatchTable.outputClassIdTable (cognitive 21) pkg/dart2wasm/lib/dynamic_dispatch_table.dart:261 — DynamicDispatchTable.outputClassIdTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParameterInfo.fromMember (cognitive 21) · ×1
  • ParameterInfo.fromMember (cognitive 21) pkg/dart2wasm/lib/param_info.dart:73 — ParameterInfo.fromMember has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendCompiler.invalidateIfInitializingFromDill (cognitive 21) · ×1
  • FrontendCompiler.invalidateIfInitializingFromDill (cognitive 21) pkg/frontend_server/lib/frontend_server.dart:1347 — FrontendCompiler.invalidateIfInitializingFromDill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Type.generateSerializedFieldAccess (cognitive 21) · ×1
  • Type.generateSerializedFieldAccess (cognitive 21) pkg/vm_service/tool/dart/generate_dart_common.dart:928 — Type.generateSerializedFieldAccess has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProgramInfoBuilder.getInfoNodeFor (cognitive 21) · ×1
  • _ProgramInfoBuilder.getInfoNodeFor (cognitive 21) pkg/vm_snapshot_analysis/lib/v8_profile.dart:371 — _ProgramInfoBuilder.getInfoNodeFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 1 (5 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _HttpOutgoing.close (cognitive 21) · ×1
  • _HttpOutgoing.close (cognitive 21) sdk/lib/_http/http_impl.dart:1990 — _HttpOutgoing.close has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpParser._headersEnd (cognitive 21) · ×1
  • _HttpParser._headersEnd (cognitive 21) sdk/lib/_http/http_parser.dart:388 — _HttpParser._headersEnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CustomHashMap.[] (cognitive 21) · ×1
  • CustomHashMap.[] (cognitive 21) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:97 — CustomHashMap.[] has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 1 (6 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Primitives.parseInt (cognitive 21) · ×1
  • Primitives.parseInt (cognitive 21) sdk/lib/_internal/js_runtime/lib/js_helper.dart:337 — Primitives.parseInt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64Assembler._emitAddSub (cognitive 21) · ×1
  • Arm64Assembler._emitAddSub (cognitive 21) pkg/native_compiler/lib/back_end/arm64/assembler.dart:1243 — Arm64Assembler._emitAddSub has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LowerIrreducibleControlFlow._collectMultiEntryLoops (cognitive 21) · ×1
  • LowerIrreducibleControlFlow._collectMultiEntryLoops (cognitive 21) pkg/dart2wasm/lib/cfg/passes/lower_irreducible_control_flow.dart:48 — LowerIrreducibleControlFlow._collectMultiEntryLoops has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LineSplitterSink._addLines (cognitive 21) · ×1
  • _LineSplitterSink._addLines (cognitive 21) sdk/lib/convert/line_splitter.dart:144 — _LineSplitterSink._addLines has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DependenciesCollector.directReferenceDependencies (cognitive 21) · ×1
  • DependenciesCollector.directReferenceDependencies (cognitive 21) pkg/dart2wasm/lib/deferred_load/dependencies.dart:68 — DependenciesCollector.directReferenceDependencies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser._isConstructor (cognitive 21) · ×1
  • Parser._isConstructor (cognitive 21) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:5729 — Parser._isConstructor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (21 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TypeAnalyzer.analyzeRecordPattern (cognitive 21) · ×1
  • TypeAnalyzer.analyzeRecordPattern (cognitive 21) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:2076 — TypeAnalyzer.analyzeRecordPattern has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EditGetAvailableRefactoringsHandler.handle (cognitive 21) · ×1
  • EditGetAvailableRefactoringsHandler.handle (cognitive 21) pkg/analysis_server/lib/src/handler/legacy/edit_get_available_refactorings.dart:20 — EditGetAvailableRefactoringsHandler.handle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (21 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LspAnalysisServer.handleMessage (cognitive 21) · ×1
  • LspAnalysisServer.handleMessage (cognitive 21) pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart:431 — LspAnalysisServer.handleMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), error handling 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResultMerger.mergeRefactorings (cognitive 21) · ×1
  • ResultMerger.mergeRefactorings (cognitive 21) pkg/analysis_server/lib/src/plugin/result_merger.dart:694 — ResultMerger.mergeRefactorings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper.addMembersFromExtensionElement (cognitive 21) · ×1
  • DeclarationHelper.addMembersFromExtensionElement (cognitive 21) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:501 — DeclarationHelper.addMembersFromExtensionElement has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._addLocalDeclarations (cognitive 21) · ×1
  • DeclarationHelper._addLocalDeclarations (cognitive 21) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:1314 — DeclarationHelper._addLocalDeclarations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeatureComputer.computeElementKind (cognitive 21) · ×1
  • FeatureComputer.computeElementKind (cognitive 21) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:193 — FeatureComputer.computeElementKind has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FeatureComputer.computeElementKind2) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · FeatureComputer.computeElementKind2 (cognitive 21) · ×1
  • FeatureComputer.computeElementKind2 (cognitive 21) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:251 — FeatureComputer.computeElementKind2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FeatureComputer.computeElementKind) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · InScopeCompletionPass.visitFormalParameterList (cognitive 21) · ×1
  • InScopeCompletionPass.visitFormalParameterList (cognitive 21) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1518 — InScopeCompletionPass.visitFormalParameterList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YamlCompletionGenerator._producerForPath (cognitive 21) · ×1
  • YamlCompletionGenerator._producerForPath (cognitive 21) pkg/analysis_server/lib/src/services/completion/yaml/yaml_completion_generator.dart:151 — YamlCompletionGenerator._producerForPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMissingClosureParameters._writeAdditions (cognitive 21) · ×1
  • AddMissingClosureParameters._writeAdditions (cognitive 21) pkg/analysis_server/lib/src/services/correction/dart/add_closure.dart:518 — AddMissingClosureParameters._writeAdditions has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (7 pts), if/else 2, loops 1 (2 pts) (nesting depth added 2). 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.
D2 · Cognitive Complexity · CreateExtensionSetter.compute (cognitive 21) · ×1
  • CreateExtensionSetter.compute (cognitive 21) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:513 — CreateExtensionSetter.compute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveUnusedLocalVariable._deleteDeclaration (cognitive 21) · ×1
  • RemoveUnusedLocalVariable._deleteDeclaration (cognitive 21) pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart:85 — RemoveUnusedLocalVariable._deleteDeclaration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Rename.apply (cognitive 21) · ×1
  • Rename.apply (cognitive 21) pkg/analysis_server/lib/src/services/correction/fix/data_driven/rename.dart:22 — Rename.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformSetParser._translateCodeTemplate (cognitive 21) · ×1
  • TransformSetParser._translateCodeTemplate (cognitive 21) pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart:707 — TransformSetParser._translateCodeTemplate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SignatureUpdater._rewriteToNamedSuper (cognitive 21) · ×1
  • _SignatureUpdater._rewriteToNamedSuper (cognitive 21) pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart:1196 — _SignatureUpdater._rewriteToNamedSuper has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SymlinksPerformanceComponent._SymlinksPerformanceComponent (cognitive 21) · ×1
  • _SymlinksPerformanceComponent._SymlinksPerformanceComponent (cognitive 21) pkg/analysis_server/lib/src/status/pages/performance_page.dart:524 — _SymlinksPerformanceComponent._SymlinksPerformanceComponent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 7 (9 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ApplyState._applyCannotIgnore (cognitive 21) · ×1
  • _ApplyState._applyCannotIgnore (cognitive 21) pkg/analyzer/lib/src/analysis_options/analysis_options_parser.dart:178 — _ApplyState._applyCannotIgnore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts), ternaries 1 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Search._addResults (cognitive 21) · ×1
  • Search._addResults (cognitive 21) pkg/analyzer/lib/src/dart/analysis/search.dart:722 — Search._addResults has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier._validateFieldInitializers (cognitive 21) · ×1
  • ConstantVerifier._validateFieldInitializers (cognitive 21) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:992 — ConstantVerifier._validateFieldInitializers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator._checkFromEnvironmentArguments (cognitive 21) · ×1
  • _ConstructorInvocationEvaluator._checkFromEnvironmentArguments (cognitive 21) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3104 — _ConstructorInvocationEvaluator._checkFromEnvironmentArguments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Collector._nameExpression (cognitive 21) · ×1
  • _Collector._nameExpression (cognitive 21) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:309 — _Collector._nameExpression has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl.isMoreBottom (cognitive 21) · ×1
  • TypeSystemImpl.isMoreBottom (cognitive 21) pkg/analyzer/lib/src/dart/element/type_system.dart:1066 — TypeSystemImpl.isMoreBottom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · InvocationInferrer._resolveDeferredFunctionLiterals (cognitive 21) · ×1
  • InvocationInferrer._resolveDeferredFunctionLiterals (cognitive 21) pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart:633 — InvocationInferrer._resolveDeferredFunctionLiterals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnusedLocalElementsVerifier._computeConstructorsExposedThroughAliases (cognitive 21) · ×1
  • UnusedLocalElementsVerifier._computeConstructorsExposedThroughAliases (cognitive 21) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:994 — UnusedLocalElementsVerifier._computeConstructorsExposedThroughAliases has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForUnnecessaryNullAware (cognitive 21) · ×1
  • ErrorVerifier._checkForUnnecessaryNullAware (cognitive 21) pkg/analyzer/lib/src/generated/error_verifier.dart:7669 — ErrorVerifier._checkForUnnecessaryNullAware has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FfiVerifier._validateFfiMethodInvocation (cognitive 21) · ×1
  • FfiVerifier._validateFfiMethodInvocation (cognitive 21) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1694 — FfiVerifier._validateFfiMethodInvocation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentEmitter.emitInstanceMethodAliases (cognitive 21) · ×1
  • FragmentEmitter.emitInstanceMethodAliases (cognitive 21) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1338 — FragmentEmitter.emitInstanceMethodAliases has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (6 pts), ternaries 1 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncLowering._isDefinitelyNonFutureValue (cognitive 21) · ×1
  • AsyncLowering._isDefinitelyNonFutureValue (cognitive 21) pkg/compiler/lib/src/kernel/transformations/modular/async_lowering.dart:134 — AsyncLowering._isDefinitelyNonFutureValue has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 17, if/else 4. 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.
D2 · Cognitive Complexity · KernelSsaGraphBuilder.visitStaticInvocation (cognitive 21) · ×1
  • KernelSsaGraphBuilder.visitStaticInvocation (cognitive 21) pkg/compiler/lib/src/ssa/builder.dart:5079 — KernelSsaGraphBuilder.visitStaticInvocation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.handleDelayedVariableDeclarations (cognitive 21) · ×1
  • SsaCodeGenerator.handleDelayedVariableDeclarations (cognitive 21) pkg/compiler/lib/src/ssa/codegen.dart:464 — SsaCodeGenerator.handleDelayedVariableDeclarations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionSelection._computeBitWidth (cognitive 21) · ×1
  • SsaInstructionSelection._computeBitWidth (cognitive 21) pkg/compiler/lib/src/ssa/codegen_helpers.dart:284 — SsaInstructionSelection._computeBitWidth has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitBitAnd (cognitive 21) · ×1
  • SsaInstructionSimplifier.visitBitAnd (cognitive 21) pkg/compiler/lib/src/ssa/optimize.dart:2792 — SsaInstructionSimplifier.visitBitAnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DartDebugAdapter.stackTraceRequest (cognitive 21) · ×1
  • DartDebugAdapter.stackTraceRequest (cognitive 21) pkg/dap_adapters/lib/src/adapters/dart.dart:1839 — DartDebugAdapter.stackTraceRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixCommand._compareFixesInDirectory (cognitive 21) · ×1
  • FixCommand._compareFixesInDirectory (cognitive 21) pkg/dartdev/lib/src/commands/fix.dart:245 — FixCommand._compareFixesInDirectory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncRewriterBase.visitFor (cognitive 21) · ×1
  • AsyncRewriterBase.visitFor (cognitive 21) pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:1241 — AsyncRewriterBase.visitFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler.emitModule (cognitive 21) · ×1
  • ProgramCompiler.emitModule (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler.dart:651 — ProgramCompiler.emitModule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ProgramCompiler._emitJSInteropClassNonExternalMembers (cognitive 21) · ×1
  • ProgramCompiler._emitJSInteropClassNonExternalMembers (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler.dart:1313 — ProgramCompiler._emitJSInteropClassNonExternalMembers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._coerceBitOperationResultToUnsigned (cognitive 21) · ×1
  • ProgramCompiler._coerceBitOperationResultToUnsigned (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler.dart:6178 — ProgramCompiler._coerceBitOperationResultToUnsigned has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitSuperTarget (cognitive 21) · ×1
  • ProgramCompiler._emitSuperTarget (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler.dart:6576 — ProgramCompiler._emitSuperTarget has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 5 (6 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LibraryCompiler._coerceBitOperationResultToUnsigned (cognitive 21) · ×1
  • LibraryCompiler._coerceBitOperationResultToUnsigned (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6867 — LibraryCompiler._coerceBitOperationResultToUnsigned has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitSuperTarget (cognitive 21) · ×1
  • LibraryCompiler._emitSuperTarget (cognitive 21) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7265 — LibraryCompiler._emitSuperTarget has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 5 (6 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IncrementalCompiler._convertSourceLibraryBuildersToDill (cognitive 21) · ×1
  • IncrementalCompiler._convertSourceLibraryBuildersToDill (cognitive 21) pkg/front_end/lib/src/base/incremental_compiler.dart:789 — IncrementalCompiler._convertSourceLibraryBuildersToDill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransitiveDependenciesCalculator._calculateTransitiveHashes (cognitive 21) · ×1
  • TransitiveDependenciesCalculator._calculateTransitiveHashes (cognitive 21) pkg/front_end/lib/src/base/incremental_compiler.dart:4197 — TransitiveDependenciesCalculator._calculateTransitiveHashes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamedTypeBuilderImpl.resolveIn (cognitive 21) · ×1
  • NamedTypeBuilderImpl.resolveIn (cognitive 21) pkg/front_end/lib/src/builder/named_type_builder.dart:220 — NamedTypeBuilderImpl.resolveIn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ExtensionTypeConstructorEncodingMixin._build (cognitive 21) · ×1
  • _ExtensionTypeConstructorEncodingMixin._build (cognitive 21) pkg/front_end/lib/src/fragment/constructor/encoding.dart:552 — _ExtensionTypeConstructorEncodingMixin._build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.hasPrimitiveEqual (cognitive 21) · ×1
  • ConstantEvaluator.hasPrimitiveEqual (cognitive 21) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5683 — ConstantEvaluator.hasPrimitiveEqual has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForwardingNode._createNoSuchMethodForwarder (cognitive 21) · ×1
  • ForwardingNode._createNoSuchMethodForwarder (cognitive 21) pkg/front_end/lib/src/kernel/forwarding_node.dart:494 — ForwardingNode._createNoSuchMethodForwarder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 2, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Covariance.fromMethod (cognitive 21) · ×1
  • Covariance.fromMethod (cognitive 21) pkg/front_end/lib/src/kernel/member_covariance.dart:116 — Covariance.fromMethod has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelayedInstanceGet.createExpression (cognitive 21) · ×1
  • DelayedInstanceGet.createExpression (cognitive 21) pkg/front_end/lib/src/type_inference/delayed_expressions.dart:1050 — DelayedInstanceGet.createExpression has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitAnonymousMethodBlock (cognitive 21) · ×1
  • InferenceVisitorImpl.visitAnonymousMethodBlock (cognitive 21) pkg/front_end/lib/src/type_inference/inference_visitor.dart:9415 — InferenceVisitorImpl.visitAnonymousMethodBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase.getWhyNotPromotedContext (cognitive 21) · ×1
  • InferenceVisitorBase.getWhyNotPromotedContext (cognitive 21) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:261 — InferenceVisitorBase.getWhyNotPromotedContext has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase._finishFieldGetterInvocation (cognitive 21) · ×1
  • InferenceVisitorBase._finishFieldGetterInvocation (cognitive 21) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3282 — InferenceVisitorBase._finishFieldGetterInvocation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InferenceVisitorBase.inferMethodInvocation (cognitive 21) · ×1
  • InferenceVisitorBase.inferMethodInvocation (cognitive 21) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3621 — InferenceVisitorBase.inferMethodInvocation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorBase.inferVariableGet (cognitive 21) · ×1
  • InferenceVisitorBase.inferVariableGet (cognitive 21) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:4366 — InferenceVisitorBase.inferVariableGet has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer._isSmallInitialization (cognitive 21) · ×1
  • Printer._isSmallInitialization (cognitive 21) pkg/js_ast/lib/src/printer.dart:889 — Printer._isSmallInitialization has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntersectionType.IntersectionType (cognitive 21) · ×1
  • IntersectionType.IntersectionType (cognitive 21) pkg/kernel/lib/src/ast/types.dart:2102 — IntersectionType.IntersectionType has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 21. 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.
D2 · Cognitive Complexity · _ConstructorChecker.check (cognitive 21) · ×1
  • _ConstructorChecker.check (cognitive 21) pkg/linter/lib/src/rules/prefer_initializing_formals.dart:79 — _ConstructorChecker.check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerLocation._lookupScript (cognitive 21) · ×1
  • DebuggerLocation._lookupScript (cognitive 21) pkg/observatory/lib/src/debugger/debugger_location.dart:144 — DebuggerLocation._lookupScript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerLocation._lookupClass (cognitive 21) · ×1
  • DebuggerLocation._lookupClass (cognitive 21) pkg/observatory/lib/src/debugger/debugger_location.dart:199 — DebuggerLocation._lookupClass has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScriptInsetElement.lineBreakpointElement (cognitive 21) · ×1
  • ScriptInsetElement.lineBreakpointElement (cognitive 21) pkg/observatory/lib/src/elements/script_inset.dart:826 — ScriptInsetElement.lineBreakpointElement has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.visitLibraryDependency (cognitive 21) · ×1
  • Printer.visitLibraryDependency (cognitive 21) pkg/kernel/lib/text/ast_to_text.dart:2221 — Printer.visitLibraryDependency has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextIterator.skipToEndOfAtom (cognitive 21) · ×1
  • TextIterator.skipToEndOfAtom (cognitive 21) pkg/kernel/lib/text/text_reader.dart:48 — TextIterator.skipToEndOfAtom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeduplicateMixinKey.== (cognitive 21) · ×1
  • _DeduplicateMixinKey.== (cognitive 21) pkg/vm/lib/transformations/mixin_deduplication.dart:117 — _DeduplicateMixinKey.== has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstantTreeShaker.collectRemovedFields (cognitive 21) · ×1
  • _ConstantTreeShaker.collectRemovedFields (cognitive 21) pkg/vm/lib/transformations/type_flow/transformer.dart:2886 — _ConstantTreeShaker.collectRemovedFields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalyzerConverter._getParametersString (cognitive 21) · ×1
  • AnalyzerConverter._getParametersString (cognitive 21) pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart:252 — AnalyzerConverter._getParametersString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InheritedReferenceContributor._addSuggestionsForType (cognitive 21) · ×1
  • InheritedReferenceContributor._addSuggestionsForType (cognitive 21) pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart:93 — InheritedReferenceContributor._addSuggestionsForType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevFS._readDevFSFile (cognitive 21) · ×1
  • DevFS._readDevFSFile (cognitive 21) sdk/lib/vmservice/devfs.dart:223 — DevFS._readDevFSFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._tryFixingPropertyAccess (cognitive 20) · ×1
  • _Visitor._tryFixingPropertyAccess (cognitive 20) pkg/analyzer_utilities/tool/messages/use_new_with_arguments.dart:174 — _Visitor._tryFixingPropertyAccess has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator._genConditionAndJumpIf (cognitive 20) · ×1
  • BytecodeGenerator._genConditionAndJumpIf (cognitive 20) pkg/dart2bytecode/lib/bytecode_generator.dart:1747 — BytecodeGenerator._genConditionAndJumpIf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BytecodeGenerator.getClosureDeclaration (cognitive 20) · ×1
  • BytecodeGenerator.getClosureDeclaration (cognitive 20) pkg/dart2bytecode/lib/bytecode_generator.dart:2689 — BytecodeGenerator.getClosureDeclaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator._initializeContextLocals (cognitive 20) · ×1
  • AstCodeGenerator._initializeContextLocals (cognitive 20) pkg/dart2wasm/lib/code_generator.dart:542 — AstCodeGenerator._initializeContextLocals has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantCreator.visitInstantiationConstant (cognitive 20) · ×1
  • ConstantCreator.visitInstantiationConstant (cognitive 20) pkg/dart2wasm/lib/constants.dart:1346 — ConstantCreator.visitInstantiationConstant has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 6, boolean chains 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ModuleOutputData.moduleForReference (cognitive 20) · ×1
  • ModuleOutputData.moduleForReference (cognitive 20) pkg/dart2wasm/lib/modules.dart:128 — ModuleOutputData.moduleForReference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WasmTargetBase.performModularTransformationsOnLibraries (cognitive 20) · ×1
  • WasmTargetBase.performModularTransformationsOnLibraries (cognitive 20) pkg/dart2wasm/lib/target.dart:264 — WasmTargetBase.performModularTransformationsOnLibraries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevToolsServer.launchDevTools (cognitive 20) · ×1
  • DevToolsServer.launchDevTools (cognitive 20) pkg/dds/lib/devtools_server.dart:647 — DevToolsServer.launchDevTools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocTestIncrementalCompiler.compileDartDocTestLibrary (cognitive 20) · ×1
  • DocTestIncrementalCompiler.compileDartDocTestLibrary (cognitive 20) pkg/front_end/tool/dart_doctest_impl.dart:1047 — DocTestIncrementalCompiler.compileDartDocTestLibrary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy._inheritMembers (cognitive 20) · ×1
  • ClosedWorldClassHierarchy._inheritMembers (cognitive 20) pkg/kernel/lib/class_hierarchy.dart:1741 — ClosedWorldClassHierarchy._inheritMembers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorFormatter.reportFailure (cognitive 20) · ×1
  • ErrorFormatter.reportFailure (cognitive 20) pkg/kernel/lib/error_formatter.dart:36 — ErrorFormatter.reportFailure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VerifyingVisitor.enterScopeProvider (cognitive 20) · ×1
  • _VerifyingVisitor.enterScopeProvider (cognitive 20) pkg/kernel/lib/verifier.dart:302 — _VerifyingVisitor.enterScopeProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (7 pts), error handling 1 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SnapshotGraph._eval (cognitive 20) · ×1
  • _SnapshotGraph._eval (cognitive 20) pkg/observatory/lib/object_graph.dart:1331 — _SnapshotGraph._eval has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpProfileData.toJson (cognitive 20) · ×1
  • _HttpProfileData.toJson (cognitive 20) sdk/lib/_http/http_impl.dart:207 — _HttpProfileData.toJson has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WebSocketImpl.connect (cognitive 20) · ×1
  • _WebSocketImpl.connect (cognitive 20) sdk/lib/_http/websocket_impl.dart:1374 — _WebSocketImpl.connect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, error handling 1, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Primitives.parseInt (cognitive 20) · ×1
  • Primitives.parseInt (cognitive 20) sdk/lib/_internal/js_dev_runtime/private/js_helper.dart:73 — Primitives.parseInt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseString (cognitive 20) · ×1
  • _ChunkedJsonParser.parseString (cognitive 20) sdk/lib/_internal/vm/lib/convert_patch.dart:1044 — _ChunkedJsonParser.parseString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder.decode8 (cognitive 20) · ×1
  • _Utf8Decoder.decode8 (cognitive 20) sdk/lib/_internal/vm/lib/convert_patch.dart:2012 — _Utf8Decoder.decode8 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _GrowableList.join (cognitive 20) · ×1
  • _GrowableList.join (cognitive 20) sdk/lib/_internal/vm/lib/growable_array.dart:435 — _GrowableList.join has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · int._tryParseSmi (cognitive 20) · ×1
  • int._tryParseSmi (cognitive 20) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:21 — int._tryParseSmi has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder.convertSingle (cognitive 20) · ×1
  • _Utf8Decoder.convertSingle (cognitive 20) sdk/lib/_internal/wasm/common/convert_patch.dart:2210 — _Utf8Decoder.convertSingle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrowableList.addAll (cognitive 20) · ×1
  • GrowableList.addAll (cognitive 20) sdk/lib/_internal/wasm/common/list.dart:631 — GrowableList.addAll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · String.fromCharCodes (cognitive 20) · ×1
  • String.fromCharCodes (cognitive 20) sdk/lib/_internal/wasm/js_compatibility/string_patch.dart:15 — String.fromCharCodes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearScanRegisterAllocator.advance (cognitive 20) · ×1
  • LinearScanRegisterAllocator.advance (cognitive 20) pkg/native_compiler/lib/back_end/register_allocator.dart:583 — LinearScanRegisterAllocator.advance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryPrinter.writeUriToSource (cognitive 20) · ×1
  • BinaryPrinter.writeUriToSource (cognitive 20) pkg/kernel/lib/binary/ast_to_binary.dart:911 — BinaryPrinter.writeUriToSource has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (5 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListBase.replaceRange (cognitive 20) · ×1
  • ListBase.replaceRange (cognitive 20) sdk/lib/collection/list.dart:410 — ListBase.replaceRange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8EncoderSink.addSlice (cognitive 20) · ×1
  • _Utf8EncoderSink.addSlice (cognitive 20) sdk/lib/convert/utf.dart:254 — _Utf8EncoderSink.addSlice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._normalizeRelativePath (cognitive 20) · ×1
  • _Uri._normalizeRelativePath (cognitive 20) sdk/lib/core/uri.dart:3053 — _Uri._normalizeRelativePath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StructuredClone.walk (cognitive 20) · ×1
  • _StructuredClone.walk (cognitive 20) sdk/lib/html/html_common/conversions.dart:87 — _StructuredClone.walk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (20 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _File.readAsBytesSync (cognitive 20) · ×1
  • _File.readAsBytesSync (cognitive 20) sdk/lib/io/file_impl.dart:659 — _File.readAsBytesSync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Platform.environment (cognitive 20) · ×1
  • _Platform.environment (cognitive 20) sdk/lib/io/platform_impl.dart:84 — _Platform.environment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RawSecureSocket._pushAllFilterStages (cognitive 20) · ×1
  • _RawSecureSocket._pushAllFilterStages (cognitive 20) sdk/lib/io/secure_socket.dart:1251 — _RawSecureSocket._pushAllFilterStages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LateVarInitTransformer._shouldApplyTransform (cognitive 20) · ×1
  • LateVarInitTransformer._shouldApplyTransform (cognitive 20) pkg/vm/lib/modular/transformations/late_var_init_transformer.dart:11 — LateVarInitTransformer._shouldApplyTransform has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Simplification.visitComparison (cognitive 20) · ×1
  • Simplification.visitComparison (cognitive 20) pkg/cfg/lib/passes/simplification.dart:103 — Simplification.visitComparison has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (6 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseFormalParametersRest (cognitive 20) · ×1
  • Parser.parseFormalParametersRest (cognitive 20) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:1934 — Parser.parseFormalParametersRest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractScanner.tokenizeDirectives (cognitive 20) · ×1
  • AbstractScanner.tokenizeDirectives (cognitive 20) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:989 — AbstractScanner.tokenizeDirectives has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Writer._typeAnnotationToText (cognitive 20) · ×1
  • Writer._typeAnnotationToText (cognitive 20) pkg/_fe_analyzer_shared/lib/src/testing/metadata_helper.dart:364 — Writer._typeAnnotationToText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TypeAnalyzer.analyzeListPattern (cognitive 20) · ×1
  • TypeAnalyzer.analyzeListPattern (cognitive 20) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer.dart:1178 — TypeAnalyzer.analyzeListPattern has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditArgumentHandler._computeValueCode (cognitive 20) · ×1
  • EditArgumentHandler._computeValueCode (cognitive 20) pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_edit_argument.dart:176 — EditArgumentHandler._computeValueCode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WorkspaceFlutterWidgetPreviewsHandler.handle (cognitive 20) · ×1
  • WorkspaceFlutterWidgetPreviewsHandler.handle (cognitive 20) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_get_widget_previews.dart:103 — WorkspaceFlutterWidgetPreviewsHandler.handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 5 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationSchedule.plan (cognitive 20) · ×1
  • MigrationSchedule.plan (cognitive 20) pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_schedule.dart:115 — MigrationSchedule.plan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManager.addPluginToContextRoot (cognitive 20) · ×1
  • PluginManager.addPluginToContextRoot (cognitive 20) pkg/analysis_server/lib/src/plugin/plugin_manager.dart:197 — PluginManager.addPluginToContextRoot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginWatcher._locatePluginFolders (cognitive 20) · ×1
  • PluginWatcher._locatePluginFolders (cognitive 20) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:415 — PluginWatcher._locatePluginFolders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.start (cognitive 20) · ×1
  • Driver.start (cognitive 20) pkg/analysis_server/lib/src/server/driver.dart:189 — Driver.start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, ternaries 3, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · KeywordHelper.addClassModifiers (cognitive 20) · ×1
  • KeywordHelper.addClassModifiers (cognitive 20) pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart:86 — KeywordHelper.addClassModifiers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddDiagnosticPropertyReference._getPropertyInfo (cognitive 20) · ×1
  • AddDiagnosticPropertyReference._getPropertyInfo (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/add_diagnostic_property_reference.dart:345 — AddDiagnosticPropertyReference._getPropertyInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AddTypeAnnotation.compute (cognitive 20) · ×1
  • AddTypeAnnotation.compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart:55 — AddTypeAnnotation.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConvertIntoBlockBody._computeMissingFunctionBody (cognitive 20) · ×1
  • ConvertIntoBlockBody._computeMissingFunctionBody (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart:95 — ConvertIntoBlockBody._computeMissingFunctionBody has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConvertIntoBlockBody._computeSetLiteral (cognitive 20) · ×1
  • ConvertIntoBlockBody._computeSetLiteral (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart:183 — ConvertIntoBlockBody._computeSetLiteral has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToSwitchExpression._convertAssignmentSwitchExpression (cognitive 20) · ×1
  • ConvertToSwitchExpression._convertAssignmentSwitchExpression (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:181 — ConvertToSwitchExpression._convertAssignmentSwitchExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (7 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CreateConstructor._computeWithSuperParameters (cognitive 20) · ×1
  • _CreateConstructor._computeWithSuperParameters (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_super.dart:187 — _CreateConstructor._computeWithSuperParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreateEnumConstant.compute (cognitive 20) · ×1
  • CreateEnumConstant.compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/create_enum_constant.dart:33 — CreateEnumConstant.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveAbstract._compute (cognitive 20) · ×1
  • RemoveAbstract._compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/remove_abstract.dart:52 — RemoveAbstract._compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveArgument.compute (cognitive 20) · ×1
  • RemoveArgument.compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/remove_argument.dart:30 — RemoveArgument.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveInitializer.compute (cognitive 20) · ×1
  • RemoveInitializer.compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/remove_initializer.dart:42 — RemoveInitializer.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RenameToCamelCase.compute (cognitive 20) · ×1
  • RenameToCamelCase.compute (cognitive 20) pkg/analysis_server/lib/src/services/correction/dart/rename_to_camel_case.dart:35 — RenameToCamelCase.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementDescriptor._matchesConstructor (cognitive 20) · ×1
  • ElementDescriptor._matchesConstructor (cognitive 20) pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart:80 — ElementDescriptor._matchesConstructor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParametersCollector.visitSimpleIdentifier (cognitive 20) · ×1
  • _ParametersCollector.visitSimpleIdentifier (cognitive 20) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:662 — _ParametersCollector.visitSimpleIdentifier has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReferenceFinder._getPrefixFromExpression (cognitive 20) · ×1
  • _ReferenceFinder._getPrefixFromExpression (cognitive 20) pkg/analysis_server/lib/src/utilities/import_analyzer.dart:399 — _ReferenceFinder._getPrefixFromExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileState.serializeAstUnlinked2 (cognitive 20) · ×1
  • FileState.serializeAstUnlinked2 (cognitive 20) pkg/analyzer/lib/src/dart/analysis/file_state.dart:971 — FileState.serializeAstUnlinked2 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryAnalyzer._resolvePartDirective (cognitive 20) · ×1
  • LibraryAnalyzer._resolvePartDirective (cognitive 20) pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart:1015 — LibraryAnalyzer._resolvePartDirective has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassDeclaration2Impl.visitChildrenWithHooks (cognitive 20) · ×1
  • ClassDeclaration2Impl.visitChildrenWithHooks (cognitive 20) pkg/analyzer/lib/src/dart/ast/ast.dart:8132 — ClassDeclaration2Impl.visitChildrenWithHooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StringLexemeHelper._trimInitialWhitespace (cognitive 20) · ×1
  • StringLexemeHelper._trimInitialWhitespace (cognitive 20) pkg/analyzer/lib/src/dart/ast/ast.dart:55751 — StringLexemeHelper._trimInitialWhitespace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier._validatePrimaryFieldInitializers (cognitive 20) · ×1
  • ConstantVerifier._validatePrimaryFieldInitializers (cognitive 20) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1038 — ConstantVerifier._validatePrimaryFieldInitializers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstLiteralVerifier._reportNotPotentialConstants (cognitive 20) · ×1
  • _ConstLiteralVerifier._reportNotPotentialConstants (cognitive 20) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1412 — _ConstLiteralVerifier._reportNotPotentialConstants has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplacementVisitor.visitFunctionTypeBuilder (cognitive 20) · ×1
  • ReplacementVisitor.visitFunctionTypeBuilder (cognitive 20) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:272 — ReplacementVisitor.visitFunctionTypeBuilder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver.resolveReceiverPropertyDirectAssignmentTarget (cognitive 20) · ×1
  • PropertyElementResolver.resolveReceiverPropertyDirectAssignmentTarget (cognitive 20) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:701 — PropertyElementResolver.resolveReceiverPropertyDirectAssignmentTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RecordLiteralResolver._reportInvalidFieldNames (cognitive 20) · ×1
  • RecordLiteralResolver._reportInvalidFieldNames (cognitive 20) pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart:100 — RecordLiteralResolver._reportInvalidFieldNames has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnnotationVerifier._checkAwaitNotRequired (cognitive 20) · ×1
  • AnnotationVerifier._checkAwaitNotRequired (cognitive 20) pkg/analyzer/lib/src/error/annotation_verifier.dart:73 — AnnotationVerifier._checkAwaitNotRequired has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BestPracticesVerifier._getSubExpressionsMarkedDoNotStore (cognitive 20) · ×1
  • BestPracticesVerifier._getSubExpressionsMarkedDoNotStore (cognitive 20) pkg/analyzer/lib/src/error/best_practices_verifier.dart:1613 — BestPracticesVerifier._getSubExpressionsMarkedDoNotStore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ElementUsageDetector.formalParameter (cognitive 20) · ×1
  • ElementUsageDetector.formalParameter (cognitive 20) pkg/analyzer/lib/src/error/element_usage_detector.dart:268 — ElementUsageDetector.formalParameter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ElementUsageDetectorV2.formalParameter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ElementUsageDetectorV2.formalParameter (cognitive 20) · ×1
  • ElementUsageDetectorV2.formalParameter (cognitive 20) pkg/analyzer/lib/src/error/element_usage_detector.dart:740 — ElementUsageDetectorV2.formalParameter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ElementUsageDetector.formalParameter) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MemberDuplicateDefinitionVerifier._checkEnumStatic (cognitive 20) · ×1
  • MemberDuplicateDefinitionVerifier._checkEnumStatic (cognitive 20) pkg/analyzer/lib/src/error/member_duplicate_definition_verifier.dart:423 — MemberDuplicateDefinitionVerifier._checkEnumStatic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeArgumentsVerifier.checkConstructorTearOff (cognitive 20) · ×1
  • TypeArgumentsVerifier.checkConstructorTearOff (cognitive 20) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:59 — TypeArgumentsVerifier.checkConstructorTearOff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryManifestBuilder._fillItemMapFromInputManifests (cognitive 20) · ×1
  • LibraryManifestBuilder._fillItemMapFromInputManifests (cognitive 20) pkg/analyzer/lib/src/fine/library_manifest.dart:1436 — LibraryManifestBuilder._fillItemMapFromInputManifests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryManifestBuilder._getInterfaceElementMemberId (cognitive 20) · ×1
  • LibraryManifestBuilder._getInterfaceElementMemberId (cognitive 20) pkg/analyzer/lib/src/fine/library_manifest.dart:1552 — LibraryManifestBuilder._getInterfaceElementMemberId has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalyzerSealedClassOperations.getSubclassAsInstanceOf (cognitive 20) · ×1
  • AnalyzerSealedClassOperations.getSubclassAsInstanceOf (cognitive 20) pkg/analyzer/lib/src/generated/exhaustiveness.dart:195 — AnalyzerSealedClassOperations.getSubclassAsInstanceOf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdkConstraintVerifier._checkSinceSdkVersion (cognitive 20) · ×1
  • SdkConstraintVerifier._checkSinceSdkVersion (cognitive 20) pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart:311 — SdkConstraintVerifier._checkSinceSdkVersion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstructorInitializerResolver._constructorElement (cognitive 20) · ×1
  • ConstructorInitializerResolver._constructorElement (cognitive 20) pkg/analyzer/lib/src/summary2/constructor_initializer_resolver.dart:33 — ConstructorInitializerResolver._constructorElement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FieldPromotability._handleMembers (cognitive 20) · ×1
  • _FieldPromotability._handleMembers (cognitive 20) pkg/analyzer/lib/src/summary2/library_builder.dart:907 — _FieldPromotability._handleMembers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypesBuilder._declaration (cognitive 20) · ×1
  • TypesBuilder._declaration (cognitive 20) pkg/analyzer/lib/src/summary2/types_builder.dart:152 — TypesBuilder._declaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PackageConfigWorkspace.findPackageFor (cognitive 20) · ×1
  • PackageConfigWorkspace.findPackageFor (cognitive 20) pkg/analyzer/lib/src/workspace/pub.dart:322 — PackageConfigWorkspace.findPackageFor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (10 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisStats.print (cognitive 20) · ×1
  • AnalysisStats.print (cognitive 20) pkg/analyzer_cli/lib/src/error_formatter.dart:54 — AnalysisStats.print has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HumanErrorFormatter.flush (cognitive 20) · ×1
  • HumanErrorFormatter.flush (cognitive 20) pkg/analyzer_cli/lib/src/error_formatter.dart:241 — HumanErrorFormatter.flush has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisOptionLinkComputer.findLinks (cognitive 20) · ×1
  • AnalysisOptionLinkComputer.findLinks (cognitive 20) pkg/analyzer_plugin/lib/src/utilities/navigation/document_links.dart:26 — AnalysisOptionLinkComputer.findLinks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (7 pts), loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiagnosticReporter._reportDiagnosticInternal (cognitive 20) · ×1
  • DiagnosticReporter._reportDiagnosticInternal (cognitive 20) pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart:124 — DiagnosticReporter._reportDiagnosticInternal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DartTypeToStringVisitor.visitFunctionType (cognitive 20) · ×1
  • _DartTypeToStringVisitor.visitFunctionType (cognitive 20) pkg/compiler/lib/src/elements/types.dart:1638 — _DartTypeToStringVisitor.visitFunctionType has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 6 (9 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ClosureTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 20) · ×1
  • ClosureTracerVisitor.visitDynamicCallSiteTypeInformation (cognitive 20) pkg/compiler/lib/src/inferrer/closure_tracer.dart:126 — ClosureTracerVisitor.visitDynamicCallSiteTypeInformation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · InferrerEngine._isFieldInitializerPotentiallyNull (cognitive 20) · ×1
  • InferrerEngine._isFieldInitializerPotentiallyNull (cognitive 20) pkg/compiler/lib/src/inferrer/engine.dart:769 — InferrerEngine._isFieldInitializerPotentiallyNull has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 19, if/else 1. 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.
D2 · Cognitive Complexity · UnionTypeMask._nonEmptyIntersection (cognitive 20) · ×1
  • UnionTypeMask._nonEmptyIntersection (cognitive 20) pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:237 — UnionTypeMask._nonEmptyIntersection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentEmitter.emitInheritance (cognitive 20) · ×1
  • FragmentEmitter.emitInheritance (cognitive 20) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1215 — FragmentEmitter.emitInheritance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (6 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder.visitDoStatement (cognitive 20) · ×1
  • KernelSsaGraphBuilder.visitDoStatement (cognitive 20) pkg/compiler/lib/src/ssa/builder.dart:3046 — KernelSsaGraphBuilder.visitDoStatement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitBoundsCheck (cognitive 20) · ×1
  • SsaCodeGenerator.visitBoundsCheck (cognitive 20) pkg/compiler/lib/src/ssa/codegen.dart:3370 — SsaCodeGenerator.visitBoundsCheck has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SsaLateFieldOptimizer.visitLateReadCheck (cognitive 20) · ×1
  • SsaLateFieldOptimizer.visitLateReadCheck (cognitive 20) pkg/compiler/lib/src/ssa/late_field_optimizer.dart:58 — SsaLateFieldOptimizer.visitLateReadCheck has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitGetLength (cognitive 20) · ×1
  • SsaInstructionSimplifier.visitGetLength (cognitive 20) pkg/compiler/lib/src/ssa/optimize.dart:1856 — SsaInstructionSimplifier.visitGetLength has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaDeadCodeEliminator.updateEmptyRegions (cognitive 20) · ×1
  • SsaDeadCodeEliminator.updateEmptyRegions (cognitive 20) pkg/compiler/lib/src/ssa/optimize.dart:3390 — SsaDeadCodeEliminator.updateEmptyRegions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaDeadPhiEliminator.visitGraph (cognitive 20) · ×1
  • SsaDeadPhiEliminator.visitGraph (cognitive 20) pkg/compiler/lib/src/ssa/optimize.dart:3586 — SsaDeadPhiEliminator.visitGraph has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 3 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · MemorySet.findCommonInstruction (cognitive 20) · ×1
  • MemorySet.findCommonInstruction (cognitive 20) pkg/compiler/lib/src/ssa/optimize.dart:5029 — MemorySet.findCommonInstruction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaTypePropagator.visitInvokeDynamic (cognitive 20) · ×1
  • SsaTypePropagator.visitInvokeDynamic (cognitive 20) pkg/compiler/lib/src/ssa/types_propagation.dart:414 — SsaTypePropagator.visitInvokeDynamic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NoSuchMethodDecoderBase._expandCallSignature (cognitive 20) · ×1
  • NoSuchMethodDecoderBase._expandCallSignature (cognitive 20) pkg/dart2js_tools/lib/src/name_decoder.dart:122 — NoSuchMethodDecoderBase._expandCallSignature has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DdsIsolateManager.initializeIsolates (cognitive 20) · ×1
  • DdsIsolateManager.initializeIsolates (cognitive 20) pkg/dart_runtime_service_dds/lib/src/dds_isolate_manager.dart:222 — DdsIsolateManager.initializeIsolates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 1 (4 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecutableCompiler.parseDepfile (cognitive 20) · ×1
  • ExecutableCompiler.parseDepfile (cognitive 20) pkg/dartdev/lib/src/executable_compiler.dart:84 — ExecutableCompiler.parseDepfile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedType.== (cognitive 20) · ×1
  • ParsedType.== (cognitive 20) pkg/front_end/lib/src/api_prototype/expression_compilation_tools.dart:220 — ParsedType.== has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._cleanupSourcesForBuilder (cognitive 20) · ×1
  • IncrementalCompiler._cleanupSourcesForBuilder (cognitive 20) pkg/front_end/lib/src/base/incremental_compiler.dart:1939 — IncrementalCompiler._cleanupSourcesForBuilder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalSerializer.writePackagesToSinkAndTrimComponent (cognitive 20) · ×1
  • IncrementalSerializer.writePackagesToSinkAndTrimComponent (cognitive 20) pkg/front_end/lib/src/base/incremental_serializer.dart:86 — IncrementalSerializer.writePackagesToSinkAndTrimComponent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 6 (8 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DillExportNameSpace.patchUpScope (cognitive 20) · ×1
  • DillExportNameSpace.patchUpScope (cognitive 20) pkg/front_end/lib/src/base/name_space.dart:270 — DillExportNameSpace.patchUpScope has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessedOptions.validateOptions (cognitive 20) · ×1
  • ProcessedOptions.validateOptions (cognitive 20) pkg/front_end/lib/src/base/processed_options.dart:395 — ProcessedOptions.validateOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FactoryEncoding.buildOutlineNodes (cognitive 20) · ×1
  • FactoryEncoding.buildOutlineNodes (cognitive 20) pkg/front_end/lib/src/fragment/factory/encoding.dart:94 — FactoryEncoding.buildOutlineNodes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endBinaryPattern (cognitive 20) · ×1
  • BodyBuilderImpl.endBinaryPattern (cognitive 20) pkg/front_end/lib/src/kernel/body_builder.dart:3143 — BodyBuilderImpl.endBinaryPattern has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (7 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BodyBuilderImpl.handleCatchBlock (cognitive 20) · ×1
  • BodyBuilderImpl.handleCatchBlock (cognitive 20) pkg/front_end/lib/src/kernel/body_builder.dart:6559 — BodyBuilderImpl.handleCatchBlock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitConstructorInvocation (cognitive 20) · ×1
  • ConstantEvaluator.visitConstructorInvocation (cognitive 20) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3536 — ConstantEvaluator.visitConstructorInvocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ConstantEvaluator.visitStringConcatenation (cognitive 20) · ×1
  • ConstantEvaluator.visitStringConcatenation (cognitive 20) pkg/front_end/lib/src/kernel/constant_evaluator.dart:5047 — ConstantEvaluator.visitStringConcatenation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Covariance.merge (cognitive 20) · ×1
  • Covariance.merge (cognitive 20) pkg/front_end/lib/src/kernel/member_covariance.dart:228 — Covariance.merge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 3 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OutlineBuilder.endMixinDeclaration (cognitive 20) · ×1
  • OutlineBuilder.endMixinDeclaration (cognitive 20) pkg/front_end/lib/src/source/outline_builder.dart:1528 — OutlineBuilder.endMixinDeclaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.endTypeVariable (cognitive 20) · ×1
  • OutlineBuilder.endTypeVariable (cognitive 20) pkg/front_end/lib/src/source/outline_builder.dart:4426 — OutlineBuilder.endTypeVariable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (20 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceClassBuilder.build (cognitive 20) · ×1
  • SourceClassBuilder.build (cognitive 20) pkg/front_end/lib/src/source/source_class_builder.dart:479 — SourceClassBuilder.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AsyncContext._checkValidReturn (cognitive 20) · ×1
  • _AsyncContext._checkValidReturn (cognitive 20) pkg/front_end/lib/src/type_inference/body_inference_context.dart:534 — _AsyncContext._checkValidReturn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitAnonymousMethodExpression (cognitive 20) · ×1
  • InferenceVisitorImpl.visitAnonymousMethodExpression (cognitive 20) pkg/front_end/lib/src/type_inference/inference_visitor.dart:9215 — InferenceVisitorImpl.visitAnonymousMethodExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InferenceVisitorImpl._inferInternalVariableDeclaration (cognitive 20) · ×1
  • InferenceVisitorImpl._inferInternalVariableDeclaration (cognitive 20) pkg/front_end/lib/src/type_inference/inference_visitor.dart:14346 — InferenceVisitorImpl._inferInternalVariableDeclaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntersectionType.nullability (cognitive 20) · ×1
  • IntersectionType.nullability (cognitive 20) pkg/kernel/lib/src/ast/types.dart:2223 — IntersectionType.nullability has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 19, match/switch 1. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DartTypeEquivalence.visitRecordType (cognitive 20) · ×1
  • DartTypeEquivalence.visitRecordType (cognitive 20) pkg/kernel/lib/src/dart_type_equivalence.dart:118 — DartTypeEquivalence.visitRecordType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitVariableDeclarationList (cognitive 20) · ×1
  • _Visitor.visitVariableDeclarationList (cognitive 20) pkg/linter/lib/src/rules/always_specify_types.dart:177 — _Visitor.visitVariableDeclarationList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._problemsForAnalyzerPublicApi (cognitive 20) · ×1
  • _Visitor._problemsForAnalyzerPublicApi (cognitive 20) pkg/linter/lib/src/rules/analyzer_public_api.dart:362 — _Visitor._problemsForAnalyzerPublicApi has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (6 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _Visitor._checkConstant (cognitive 20) · ×1
  • _Visitor._checkConstant (cognitive 20) pkg/linter/lib/src/rules/prefer_contains.dart:73 — _Visitor._checkConstant has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitCompilationUnit (cognitive 20) · ×1
  • _Visitor.visitCompilationUnit (cognitive 20) pkg/linter/lib/src/rules/public_member_api_docs.dart:131 — _Visitor.visitCompilationUnit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkMembers (cognitive 20) · ×1
  • _Visitor._checkMembers (cognitive 20) pkg/linter/lib/src/rules/use_primary_constructors.dart:66 — _Visitor._checkMembers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _Visitor.check (cognitive 20) · ×1
  • _Visitor.check (cognitive 20) pkg/linter/lib/src/rules/use_super_parameters.dart:72 — _Visitor.check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LineNumberContentType.validate (cognitive 20) · ×1
  • _LineNumberContentType.validate (cognitive 20) pkg/native_stack_traces/lib/src/dwarf.dart:1071 — _LineNumberContentType.validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ObservatoryDebugger.onEvent (cognitive 20) · ×1
  • ObservatoryDebugger.onEvent (cognitive 20) pkg/observatory/lib/src/elements/debugger.dart:1740 — ObservatoryDebugger.onEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HeapSnapshotElement._createReport (cognitive 20) · ×1
  • HeapSnapshotElement._createReport (cognitive 20) pkg/observatory/lib/src/elements/heap_snapshot.dart:670 — HeapSnapshotElement._createReport has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScriptInsetElement.linesTable (cognitive 20) · ×1
  • ScriptInsetElement.linesTable (cognitive 20) pkg/observatory/lib/src/elements/script_inset.dart:696 — ScriptInsetElement.linesTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Histogram.printCounts (cognitive 20) · ×1
  • Histogram.printCounts (cognitive 20) pkg/scrape/lib/src/histogram.dart:42 — Histogram.printCounts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceShadowTransformer._traverse (cognitive 20) · ×1
  • SourceShadowTransformer._traverse (cognitive 20) pkg/shadow_sources/lib/src/shadow_sources.dart:66 — SourceShadowTransformer._traverse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportSection.deserialize (cognitive 20) · ×1
  • ImportSection.deserialize (cognitive 20) pkg/wasm_builder/lib/src/serialize/sections.dart:158 — ImportSection.deserialize has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (6 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SmartConsole.smartReadLine (cognitive 20) · ×1
  • SmartConsole.smartReadLine (cognitive 20) runtime/tools/heapsnapshot/lib/src/console.dart:36 — SmartConsole.smartReadLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ImplicitUsesAnnotator.annotateDispatchTargets (cognitive 20) · ×1
  • _ImplicitUsesAnnotator.annotateDispatchTargets (cognitive 20) pkg/vm/lib/transformations/dynamic_interface_annotator.dart:532 — _ImplicitUsesAnnotator.annotateDispatchTargets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 5 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DeduplicateMixinsTransformer._correctForwardingConstructors (cognitive 20) · ×1
  • _DeduplicateMixinsTransformer._correctForwardingConstructors (cognitive 20) pkg/vm/lib/transformations/mixin_deduplication.dart:289 — _DeduplicateMixinsTransformer._correctForwardingConstructors has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DirectInvocation._processField (cognitive 20) · ×1
  • _DirectInvocation._processField (cognitive 20) pkg/vm/lib/transformations/type_flow/analysis.dart:301 — _DirectInvocation._processField has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PragmaEntryPointsVisitor.visitField (cognitive 20) · ×1
  • PragmaEntryPointsVisitor.visitField (cognitive 20) pkg/vm/lib/transformations/type_flow/native_code.dart:268 — PragmaEntryPointsVisitor.visitField has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryOperation.apply (cognitive 20) · ×1
  • BinaryOperation.apply (cognitive 20) pkg/vm/lib/transformations/type_flow/summary.dart:1066 — BinaryOperation.apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypesBuilder.fromStaticType (cognitive 20) · ×1
  • TypesBuilder.fromStaticType (cognitive 20) pkg/vm/lib/transformations/type_flow/types.dart:283 — TypesBuilder.fromStaticType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SetType._unionLists (cognitive 20) · ×1
  • SetType._unionLists (cognitive 20) pkg/vm/lib/transformations/type_flow/types.dart:673 — SetType._unionLists has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetType.union (cognitive 20) · ×1
  • SetType.union (cognitive 20) pkg/vm/lib/transformations/type_flow/types.dart:839 — SetType.union has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · graphexplorer.Graph.forestEval (cognitive 20) · ×1
  • graphexplorer.Graph.forestEval (cognitive 20) runtime/tools/graphexplorer/graphexplorer.js:654 — graphexplorer.Graph.forestEval has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · graphexplorer.Graph.computeOwnedSizes (cognitive 20) · ×1
  • graphexplorer.Graph.computeOwnedSizes (cognitive 20) runtime/tools/graphexplorer/graphexplorer.js:702 — graphexplorer.Graph.computeOwnedSizes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionResult._getElement (cognitive 19) · ×1
  • CompletionResult._getElement (cognitive 19) pkg/analysis_server/tool/code_completion/completion_metrics.dart:1852 — CompletionResult._getElement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogEntry.from (cognitive 19) · ×1
  • LogEntry.from (cognitive 19) pkg/analysis_server/tool/instrumentation/log/log.dart:573 — LogEntry.from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _FlatBufferSchemaGenerator.generate (cognitive 19) · ×1
  • _FlatBufferSchemaGenerator.generate (cognitive 19) pkg/analyzer/tool/summary/generate.dart:865 — _FlatBufferSchemaGenerator.generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AwaitTransformer.visitForStatement (cognitive 19) · ×1
  • _AwaitTransformer.visitForStatement (cognitive 19) pkg/dart2wasm/lib/await_transformer.dart:245 — _AwaitTransformer.visitForStatement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstantAccessor._constantName (cognitive 19) · ×1
  • _ConstantAccessor._constantName (cognitive 19) pkg/dart2wasm/lib/constants.dart:2284 — _ConstantAccessor._constantName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCollector.getFunction (cognitive 19) · ×1
  • FunctionCollector.getFunction (cognitive 19) pkg/dart2wasm/lib/functions.dart:102 — FunctionCollector.getFunction has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 3. 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.
D2 · Cognitive Complexity · ParameterInfo.merge (cognitive 19) · ×1
  • ParameterInfo.merge (cognitive 19) pkg/dart2wasm/lib/param_info.dart:143 — ParameterInfo.merge has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClosureDynamicEntryGenerator.generate (cognitive 19) · ×1
  • _ClosureDynamicEntryGenerator.generate (cognitive 19) pkg/dart2wasm/lib/translator.dart:3046 — _ClosureDynamicEntryGenerator.generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ExternVerifierMixin._validateMemoryAccessIntrinsic (cognitive 19) · ×1
  • _ExternVerifierMixin._validateMemoryAccessIntrinsic (cognitive 19) pkg/dart2wasm/lib/wasm_library_checks.dart:271 — _ExternVerifierMixin._validateMemoryAccessIntrinsic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Expect._escapeSubstring (cognitive 19) · ×1
  • Expect._escapeSubstring (cognitive 19) pkg/expect/lib/expect.dart:81 — Expect._escapeSubstring has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Expect.stringEquals (cognitive 19) · ×1
  • Expect.stringEquals (cognitive 19) pkg/expect/lib/expect.dart:490 — Expect.stringEquals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BenchMaker.visitFunctionType (cognitive 19) · ×1
  • BenchMaker.visitFunctionType (cognitive 19) pkg/front_end/tool/bench_maker.dart:444 — BenchMaker.visitFunctionType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstIndexerAndIgnoreCollector._hasIgnoreComment (cognitive 19) · ×1
  • AstIndexerAndIgnoreCollector._hasIgnoreComment (cognitive 19) pkg/front_end/tool/coverage_merger.dart:914 — AstIndexerAndIgnoreCollector._hasIgnoreComment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MyLaunchingVMServiceHelper.run (cognitive 19) · ×1
  • MyLaunchingVMServiceHelper.run (cognitive 19) pkg/front_end/tool/coverage_runner.dart:44 — MyLaunchingVMServiceHelper.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (5 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassHierarchyExtensionTypeMixin.getExtensionTypeDeclarationAsInstanceOfClass (cognitive 19) · ×1
  • ClassHierarchyExtensionTypeMixin.getExtensionTypeDeclarationAsInstanceOfClass (cognitive 19) pkg/kernel/lib/class_hierarchy.dart:232 — ClassHierarchyExtensionTypeMixin.getExtensionTypeDeclarationAsInstanceOfClass has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCheckingVisitor.getReceiverType (cognitive 19) · ×1
  • TypeCheckingVisitor.getReceiverType (cognitive 19) pkg/kernel/lib/type_checker.dart:319 — TypeCheckingVisitor.getReceiverType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Step.parse (cognitive 19) · ×1
  • Step.parse (cognitive 19) pkg/smith/lib/builder.dart:44 — Step.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Method.generateDefinition (cognitive 19) · ×1
  • Method.generateDefinition (cognitive 19) pkg/vm_service/tool/dart/generate_dart_common.dart:281 — Method.generateDefinition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LinkedMap.remove (cognitive 19) · ×1
  • LinkedMap.remove (cognitive 19) sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:246 — LinkedMap.remove has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HashMap.HashMap (cognitive 19) · ×1
  • HashMap.HashMap (cognitive 19) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:25 — HashMap.HashMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (LinkedHashMap.LinkedHashMap, HashSet.HashSet, LinkedHashSet.LinkedHashSet) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LinkedHashMap.LinkedHashMap (cognitive 19) · ×1
  • LinkedHashMap.LinkedHashMap (cognitive 19) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:509 — LinkedHashMap.LinkedHashMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (HashMap.HashMap, HashSet.HashSet, LinkedHashSet.LinkedHashSet) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · HashSet.HashSet (cognitive 19) · ×1
  • HashSet.HashSet (cognitive 19) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:611 — HashSet.HashSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (HashMap.HashMap, LinkedHashMap.LinkedHashMap, LinkedHashSet.LinkedHashSet) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LinkedHashSet.LinkedHashSet (cognitive 19) · ×1
  • LinkedHashSet.LinkedHashSet (cognitive 19) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1030 — LinkedHashSet.LinkedHashSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (HashMap.HashMap, LinkedHashMap.LinkedHashMap, HashSet.HashSet) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _List.setRange (cognitive 19) · ×1
  • _List.setRange (cognitive 19) sdk/lib/_internal/vm/lib/array.dart:205 — _List.setRange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder.decode16 (cognitive 19) · ×1
  • _Utf8Decoder.decode16 (cognitive 19) sdk/lib/_internal/vm/lib/convert_patch.dart:2064 — _Utf8Decoder.decode16 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StringBase._createStringFromIterable (cognitive 19) · ×1
  • _StringBase._createStringFromIterable (cognitive 19) sdk/lib/_internal/vm/lib/string_patch.dart:198 — _StringBase._createStringFromIterable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _TypedListMixin._slowSetRange (cognitive 19) · ×1
  • _TypedListMixin._slowSetRange (cognitive 19) sdk/lib/_internal/vm/lib/typed_data_patch.dart:273 — _TypedListMixin._slowSetRange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BigIntImpl.toString (cognitive 19) · ×1
  • _BigIntImpl.toString (cognitive 19) sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2600 — _BigIntImpl.toString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Arm64CodeGenerator._prepareOptionalPositionalParameters (cognitive 19) · ×1
  • Arm64CodeGenerator._prepareOptionalPositionalParameters (cognitive 19) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:97 — Arm64CodeGenerator._prepareOptionalPositionalParameters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (5 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegisterAllocationChecker._updateInState (cognitive 19) · ×1
  • RegisterAllocationChecker._updateInState (cognitive 19) pkg/native_compiler/lib/back_end/regalloc_checker.dart:209 — RegisterAllocationChecker._updateInState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassSerializationCluster.trace (cognitive 19) · ×1
  • ClassSerializationCluster.trace (cognitive 19) pkg/native_compiler/lib/snapshot/snapshot.dart:707 — ClassSerializationCluster.trace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 4, ternaries 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineInfo.getOffsetForLine (cognitive 19) · ×1
  • LineInfo.getOffsetForLine (cognitive 19) pkg/analyzer/lib/source/line_info.dart:140 — LineInfo.getOffsetForLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordFieldDeclarationIdentifierContext.ensureIdentifier (cognitive 19) · ×1
  • RecordFieldDeclarationIdentifierContext.ensureIdentifier (cognitive 19) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:623 — RecordFieldDeclarationIdentifierContext.ensureIdentifier has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (6 pts) (nesting depth added 1). 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.
D2 · Cognitive Complexity · ModifierContext._parseModifiers (cognitive 19) · ×1
  • ModifierContext._parseModifiers (cognitive 19) pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart:340 — ModifierContext._parseModifiers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Writer._formalParametersToText (cognitive 19) · ×1
  • Writer._formalParametersToText (cognitive 19) pkg/_fe_analyzer_shared/lib/src/testing/metadata_helper.dart:442 — Writer._formalParametersToText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeConstraintGenerator.performSubtypeConstraintGenerationForRightNullableType (cognitive 19) · ×1
  • TypeConstraintGenerator.performSubtypeConstraintGenerationForRightNullableType (cognitive 19) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:2019 — TypeConstraintGenerator.performSubtypeConstraintGenerationForRightNullableType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckNameResponse._getInterpolationIdentifier (cognitive 19) · ×1
  • CheckNameResponse._getInterpolationIdentifier (cognitive 19) pkg/analysis_server/lib/src/cider/rename.dart:323 — CheckNameResponse._getInterpolationIdentifier has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextManagerImpl._computePluginConflicts (cognitive 19) · ×1
  • ContextManagerImpl._computePluginConflicts (cognitive 19) pkg/analysis_server/lib/src/context_manager.dart:610 — ContextManagerImpl._computePluginConflicts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationSummaryBuilder._writeVersionMigrationSummary (cognitive 19) · ×1
  • MigrationSummaryBuilder._writeVersionMigrationSummary (cognitive 19) pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_summary_builder.dart:168 — MigrationSummaryBuilder._writeVersionMigrationSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper.addLexicalDeclarations (cognitive 19) · ×1
  • DeclarationHelper.addLexicalDeclarations (cognitive 19) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:441 — DeclarationHelper.addLexicalDeclarations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, match/switch 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DeclarationHelper._suggestClass (cognitive 19) · ×1
  • DeclarationHelper._suggestClass (cognitive 19) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2041 — DeclarationHelper._suggestClass has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextTypeVisitor.visitRecordLiteral (cognitive 19) · ×1
  • _ContextTypeVisitor.visitRecordLiteral (cognitive 19) pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart:1135 — _ContextTypeVisitor.visitRecordLiteral has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitIfElement (cognitive 19) · ×1
  • InScopeCompletionPass.visitIfElement (cognitive 19) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1767 — InScopeCompletionPass.visitIfElement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspacePackageProducer.suggestions (cognitive 19) · ×1
  • WorkspacePackageProducer.suggestions (cognitive 19) pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart:167 — WorkspacePackageProducer.suggestions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertClassToMixin.compute (cognitive 19) · ×1
  • ConvertClassToMixin.compute (cognitive 19) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart:26 — ConvertClassToMixin.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConvertFieldFormalToNormal.compute (cognitive 19) · ×1
  • ConvertFieldFormalToNormal.compute (cognitive 19) pkg/analysis_server/lib/src/services/correction/dart/convert_field_formal_to_normal.dart:25 — ConvertFieldFormalToNormal.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConvertToIfNull._preferIfNull (cognitive 19) · ×1
  • ConvertToIfNull._preferIfNull (cognitive 19) pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart:53 — ConvertToIfNull._preferIfNull has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplaceIfElseWithConditional.compute (cognitive 19) · ×1
  • ReplaceIfElseWithConditional.compute (cognitive 19) pkg/analysis_server/lib/src/services/correction/dart/replace_if_else_with_conditional.dart:25 — ReplaceIfElseWithConditional.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WrapInUnawaited.compute (cognitive 19) · ×1
  • WrapInUnawaited.compute (cognitive 19) pkg/analysis_server/lib/src/services/correction/dart/wrap_in_unawaited.dart:26 — WrapInUnawaited.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeFragmentParser._parseAccessor (cognitive 19) · ×1
  • CodeFragmentParser._parseAccessor (cognitive 19) pkg/analysis_server/lib/src/services/correction/fix/data_driven/code_fragment_parser.dart:179 — CodeFragmentParser._parseAccessor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameConstructorRefactoringImpl.buildChange (cognitive 19) · ×1
  • RenameConstructorRefactoringImpl.buildChange (cognitive 19) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_constructor.dart:46 — RenameConstructorRefactoringImpl.buildChange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegacyPluginsPage.generateContent (cognitive 19) · ×1
  • LegacyPluginsPage.generateContent (cognitive 19) pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:26 — LegacyPluginsPage.generateContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SymlinksPerformanceComponent._collectSymlinkedFiles (cognitive 19) · ×1
  • _SymlinksPerformanceComponent._collectSymlinkedFiles (cognitive 19) pkg/analysis_server/lib/src/status/pages/performance_page.dart:709 — _SymlinksPerformanceComponent._collectSymlinkedFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginServer._computeEffectiveIncludedPaths (cognitive 19) · ×1
  • PluginServer._computeEffectiveIncludedPaths (cognitive 19) pkg/analysis_server_plugin/lib/src/plugin_server.dart:835 — PluginServer._computeEffectiveIncludedPaths has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextLocator._contextRootLocation (cognitive 19) · ×1
  • _ContextLocator._contextRootLocation (cognitive 19) pkg/analyzer/lib/src/dart/analysis/context_locator.dart:217 — _ContextLocator._contextRootLocation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextLocator._sortIncludedFoldersIntoWorkspaceResolutions (cognitive 19) · ×1
  • _ContextLocator._sortIncludedFoldersIntoWorkspaceResolutions (cognitive 19) pkg/analyzer/lib/src/dart/analysis/context_locator.dart:952 — _ContextLocator._sortIncludedFoldersIntoWorkspaceResolutions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _FindLibraryDeclarations._addDeclaration (cognitive 19) · ×1
  • _FindLibraryDeclarations._addDeclaration (cognitive 19) pkg/analyzer/lib/src/dart/analysis/search.dart:1539 — _FindLibraryDeclarations._addDeclaration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BinaryExpressionResolver._resolveEqual (cognitive 19) · ×1
  • BinaryExpressionResolver._resolveEqual (cognitive 19) pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart:165 — BinaryExpressionResolver._resolveEqual has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, ternaries 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ExtensionMemberResolver._isValidContext (cognitive 19) · ×1
  • ExtensionMemberResolver._isValidContext (cognitive 19) pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart:566 — ExtensionMemberResolver._isValidContext has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 18, if/else 1. 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.
D2 · Cognitive Complexity · AnnotationVerifier._checkReopen (cognitive 19) · ×1
  • AnnotationVerifier._checkReopen (cognitive 19) pkg/analyzer/lib/src/error/annotation_verifier.dart:458 — AnnotationVerifier._checkReopen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TodoFinder._scrapeTodoComment (cognitive 19) · ×1
  • TodoFinder._scrapeTodoComment (cognitive 19) pkg/analyzer/lib/src/error/todo_finder.dart:63 — TodoFinder._scrapeTodoComment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.endMetadata (cognitive 19) · ×1
  • AstBuilder.endMetadata (cognitive 19) pkg/analyzer/lib/src/fasta/ast_builder.dart:2495 — AstBuilder.endMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (5 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForBadFunctionUse (cognitive 19) · ×1
  • ErrorVerifier._checkForBadFunctionUse (cognitive 19) pkg/analyzer/lib/src/generated/error_verifier.dart:3659 — ErrorVerifier._checkForBadFunctionUse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier.visitCascadePropertyExtraction (cognitive 19) · ×1
  • FfiVerifier.visitCascadePropertyExtraction (cognitive 19) pkg/analyzer/lib/src/generated/ffi_verifier.dart:221 — FfiVerifier.visitCascadePropertyExtraction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FfiVerifier._validateAnnotations (cognitive 19) · ×1
  • FfiVerifier._validateAnnotations (cognitive 19) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1406 — FfiVerifier._validateAnnotations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementBuilder._linkTypeParameters (cognitive 19) · ×1
  • ElementBuilder._linkTypeParameters (cognitive 19) pkg/analyzer/lib/src/summary2/element_builder.dart:1182 — ElementBuilder._linkTypeParameters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (8 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InfoBuilder._buildConstantOffsets (cognitive 19) · ×1
  • _InfoBuilder._buildConstantOffsets (cognitive 19) pkg/analyzer/lib/src/summary2/informative_data.dart:706 — _InfoBuilder._buildConstantOffsets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandLineOptions.filterUnknownArguments (cognitive 19) · ×1
  • CommandLineOptions.filterUnknownArguments (cognitive 19) pkg/analyzer_cli/lib/src/options.dart:174 — CommandLineOptions.filterUnknownArguments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TracerVisitor.analyzeStoredIntoRecord (cognitive 19) · ×1
  • TracerVisitor.analyzeStoredIntoRecord (cognitive 19) pkg/compiler/lib/src/inferrer/node_tracer.dart:359 — TracerVisitor.analyzeStoredIntoRecord has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentEmitter.emitLazilyInitializedStatics (cognitive 19) · ×1
  • FragmentEmitter.emitLazilyInitializedStatics (cognitive 19) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1748 — FragmentEmitter.emitLazilyInitializedStatics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ModelEmitter.emitProgram (cognitive 19) · ×1
  • ModelEmitter.emitProgram (cognitive 19) pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart:247 — ModelEmitter.emitProgram has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 6 (8 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · JumpVisitor.visitBreakStatement (cognitive 19) · ×1
  • JumpVisitor.visitBreakStatement (cognitive 19) pkg/compiler/lib/src/js_model/locals.dart:366 — JumpVisitor.visitBreakStatement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._handleForeignRawFunctionRef (cognitive 19) · ×1
  • KernelSsaGraphBuilder._handleForeignRawFunctionRef (cognitive 19) pkg/compiler/lib/src/ssa/builder.dart:5825 — KernelSsaGraphBuilder._handleForeignRawFunctionRef has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._invokeJsInteropFunction (cognitive 19) · ×1
  • KernelSsaGraphBuilder._invokeJsInteropFunction (cognitive 19) pkg/compiler/lib/src/ssa/builder.dart:7009 — KernelSsaGraphBuilder._invokeJsInteropFunction has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (5 pts), ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._completeDynamicCallArgumentsList (cognitive 19) · ×1
  • KernelSsaGraphBuilder._completeDynamicCallArgumentsList (cognitive 19) pkg/compiler/lib/src/ssa/builder.dart:8188 — KernelSsaGraphBuilder._completeDynamicCallArgumentsList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DominatedUses.replaceWith (cognitive 19) · ×1
  • DominatedUses.replaceWith (cognitive 19) pkg/compiler/lib/src/ssa/nodes.dart:1583 — DominatedUses.replaceWith has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (9 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaDeadCodeEliminator.simplifyPhi (cognitive 19) · ×1
  • SsaDeadCodeEliminator.simplifyPhi (cognitive 19) pkg/compiler/lib/src/ssa/optimize.dart:3282 — SsaDeadCodeEliminator.simplifyPhi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordUseValueConverter.findInstanceValue (cognitive 19) · ×1
  • RecordUseValueConverter.findInstanceValue (cognitive 19) pkg/compiler/lib/src/universe/recorded_use.dart:457 — RecordUseValueConverter.findInstanceValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IsolateManager._handlePause (cognitive 19) · ×1
  • IsolateManager._handlePause (cognitive 19) pkg/dap_adapters/lib/src/isolate_manager.dart:674 — IsolateManager._handlePause has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventStreamManager.streamListen (cognitive 19) · ×1
  • EventStreamManager.streamListen (cognitive 19) pkg/dart_runtime_service/lib/src/event_streams.dart:303 — EventStreamManager.streamListen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler.emitLibrary (cognitive 19) · ×1
  • LibraryCompiler.emitLibrary (cognitive 19) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:905 — LibraryCompiler.emitLibrary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _TypeRecipeVisitor.visitFunctionType (cognitive 19) · ×1
  • _TypeRecipeVisitor.visitFunctionType (cognitive 19) pkg/dev_compiler/lib/src/kernel/type_recipe_generator.dart:396 — _TypeRecipeVisitor.visitFunctionType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Locations._locationsForModule (cognitive 19) · ×1
  • Locations._locationsForModule (cognitive 19) pkg/dwds/lib/src/debugging/location.dart:310 — Locations._locationsForModule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebkitDebugger._initialize (cognitive 19) · ×1
  • WebkitDebugger._initialize (cognitive 19) pkg/dwds/lib/src/debugging/webkit_debugger.dart:86 — WebkitDebugger._initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevHandler._startLocalDebugService (cognitive 19) · ×1
  • DevHandler._startLocalDebugService (cognitive 19) pkg/dwds/lib/src/handlers/dev_handler.dart:239 — DevHandler._startLocalDebugService has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevHandler._handleMessage (cognitive 19) · ×1
  • DevHandler._handleMessage (cognitive 19) pkg/dwds/lib/src/handlers/dev_handler.dart:477 — DevHandler._handleMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DwdsInjector.middleware (cognitive 19) · ×1
  • DwdsInjector.middleware (cognitive 19) pkg/dwds/lib/src/handlers/injector.dart:44 — DwdsInjector.middleware has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalCompiler._computeDelta (cognitive 19) · ×1
  • IncrementalCompiler._computeDelta (cognitive 19) pkg/front_end/lib/src/base/incremental_compiler.dart:352 — IncrementalCompiler._computeDelta has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _ConstructorDeclarationMixin.addSuperParameterDefaultValueCloners (cognitive 19) · ×1
  • _ConstructorDeclarationMixin.addSuperParameterDefaultValueCloners (cognitive 19) pkg/front_end/lib/src/fragment/constructor/declaration.dart:550 — _ConstructorDeclarationMixin.addSuperParameterDefaultValueCloners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FactoryEncoding.checkRedirectingFactory (cognitive 19) · ×1
  • FactoryEncoding.checkRedirectingFactory (cognitive 19) pkg/front_end/lib/src/fragment/factory/encoding.dart:565 — FactoryEncoding.checkRedirectingFactory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BodyBuilderImpl.handleType (cognitive 19) · ×1
  • BodyBuilderImpl.handleType (cognitive 19) pkg/front_end/lib/src/kernel/body_builder.dart:8724 — BodyBuilderImpl.handleType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementConstantEvaluator.visitForStatement (cognitive 19) · ×1
  • StatementConstantEvaluator.visitForStatement (cognitive 19) pkg/front_end/lib/src/kernel/constant_evaluator.dart:6258 — StatementConstantEvaluator.visitForStatement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartScopeBuilder2.addFound (cognitive 19) · ×1
  • DartScopeBuilder2.addFound (cognitive 19) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:117 — DartScopeBuilder2.addFound has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CfeSealedClassOperations.getSubclassAsInstanceOf (cognitive 19) · ×1
  • CfeSealedClassOperations.getSubclassAsInstanceOf (cognitive 19) pkg/front_end/lib/src/kernel/exhaustiveness.dart:531 — CfeSealedClassOperations.getSubclassAsInstanceOf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassMembersNodeBuilder.inferFieldType (cognitive 19) · ×1
  • ClassMembersNodeBuilder.inferFieldType (cognitive 19) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:466 — ClassMembersNodeBuilder.inferFieldType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuilderFactory._createDeclarationFromFragment (cognitive 19) · ×1
  • BuilderFactory._createDeclarationFromFragment (cognitive 19) pkg/front_end/lib/src/source/builder_factory.dart:577 — BuilderFactory._createDeclarationFromFragment has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 3 (5 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SourceLibraryBuilder.addImportsToScope (cognitive 19) · ×1
  • SourceLibraryBuilder.addImportsToScope (cognitive 19) pkg/front_end/lib/src/source/source_library_builder.dart:628 — SourceLibraryBuilder.addImportsToScope has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (4 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SyncContext._checkValidReturn (cognitive 19) · ×1
  • _SyncContext._checkValidReturn (cognitive 19) pkg/front_end/lib/src/type_inference/body_inference_context.dart:228 — _SyncContext._checkValidReturn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl._buildRedirectingFactoryTargetInvocation (cognitive 19) · ×1
  • InferenceVisitorImpl._buildRedirectingFactoryTargetInvocation (cognitive 19) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2749 — InferenceVisitorImpl._buildRedirectingFactoryTargetInvocation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Processor._premarkTopLevel (cognitive 19) · ×1
  • _Processor._premarkTopLevel (cognitive 19) pkg/front_end/lib/src/util/outline_extractor.dart:233 — _Processor._premarkTopLevel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Processor.findInScope (cognitive 19) · ×1
  • _Processor.findInScope (cognitive 19) pkg/front_end/lib/src/util/outline_extractor.dart:572 — _Processor.findInScope has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.out (cognitive 19) · ×1
  • Printer.out (cognitive 19) pkg/js_ast/lib/src/printer.dart:198 — Printer.out has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordType.equals (cognitive 19) · ×1
  • RecordType.equals (cognitive 19) pkg/kernel/lib/src/ast/types.dart:2663 — RecordType.equals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitTypeParameterList (cognitive 19) · ×1
  • _Visitor.visitTypeParameterList (cognitive 19) pkg/linter/lib/src/rules/avoid_types_as_parameter_names.dart:77 — _Visitor.visitTypeParameterList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitCompilationUnit (cognitive 19) · ×1
  • _Visitor.visitCompilationUnit (cognitive 19) pkg/linter/lib/src/rules/lines_longer_than_80_chars.dart:159 — _Visitor.visitCompilationUnit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkMethod (cognitive 19) · ×1
  • _Visitor._checkMethod (cognitive 19) pkg/linter/lib/src/rules/strict_top_level_inference.dart:194 — _Visitor._checkMethod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchBarElement.render (cognitive 19) · ×1
  • SearchBarElement.render (cognitive 19) pkg/observatory/lib/src/elements/containers/search_bar.dart:106 — SearchBarElement.render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProtobufHandler.beforeSummaryCreation (cognitive 19) · ×1
  • ProtobufHandler.beforeSummaryCreation (cognitive 19) pkg/vm/lib/transformations/type_flow/protobuf_handler.dart:128 — ProtobufHandler.beforeSummaryCreation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassInfo._initDispatchTargets (cognitive 19) · ×1
  • ClassInfo._initDispatchTargets (cognitive 19) pkg/vm/lib/transformations/type_flow/rta.dart:77 — ClassInfo._initDispatchTargets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TFADevirtualization.getDirectCall (cognitive 19) · ×1
  • TFADevirtualization.getDirectCall (cognitive 19) pkg/vm/lib/transformations/type_flow/transformer.dart:358 — TFADevirtualization.getDirectCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · used_names.analyze (cognitive 19) · ×1
  • used_names.analyze (cognitive 19) pkg/compiler/tool/used_names/used_names.js:11 — used_names.analyze has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (6 pts) (nesting depth added 8). Of this number, 14 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · graphexplorer.Table.refreshRows (cognitive 19) · ×1
  • graphexplorer.Table.refreshRows (cognitive 19) runtime/tools/graphexplorer/graphexplorer.js:1674 — graphexplorer.Table.refreshRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RelevanceDataCollector._argumentListContext (cognitive 18) · ×1
  • RelevanceDataCollector._argumentListContext (cognitive 18) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2172 — RelevanceDataCollector._argumentListContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnalysisTester._printStats (cognitive 18) · ×1
  • AnalysisTester._printStats (cognitive 18) pkg/analysis_server/tool/performance/utilities/analysis_tester.dart:156 — AnalysisTester._printStats has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorData.failureMessage (cognitive 18) · ×1
  • ErrorData.failureMessage (cognitive 18) pkg/analysis_server/tool/presubmit/verify_error_fix_status.dart:165 — ErrorData.failureMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringSearchUtilGenerator._findMethods (cognitive 18) · ×1
  • StringSearchUtilGenerator._findMethods (cognitive 18) pkg/analyzer/tool/generators/string_search_util_generator.dart:85 — StringSearchUtilGenerator._findMethods has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringSearchUtilGenerator._getAnnotationData (cognitive 18) · ×1
  • StringSearchUtilGenerator._getAnnotationData (cognitive 18) pkg/analyzer/tool/generators/string_search_util_generator.dart:113 — StringSearchUtilGenerator._getAnnotationData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Options.parse (cognitive 18) · ×1
  • Options.parse (cognitive 18) pkg/analyzer_utilities/tool/upgrade_sdk_language_version.dart:1177 — Options.parse has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 2 (5 pts), ternaries 3 (5 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FunctionTypeHandle.toString (cognitive 18) · ×1
  • _FunctionTypeHandle.toString (cognitive 18) pkg/dart2bytecode/lib/object_table.dart:979 — _FunctionTypeHandle.toString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Closures._buildContexts (cognitive 18) · ×1
  • Closures._buildContexts (cognitive 18) pkg/dart2wasm/lib/closures.dart:1540 — Closures._buildContexts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantCreator.visitInstanceConstant (cognitive 18) · ×1
  • ConstantCreator.visitInstanceConstant (cognitive 18) pkg/dart2wasm/lib/constants.dart:933 — ConstantCreator.visitInstanceConstant has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicDispatchTable.build (cognitive 18) · ×1
  • DynamicDispatchTable.build (cognitive 18) pkg/dart2wasm/lib/dynamic_dispatch_table.dart:52 — DynamicDispatchTable.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCollector.getFunctionName (cognitive 18) · ×1
  • FunctionCollector.getFunctionName (cognitive 18) pkg/dart2wasm/lib/functions.dart:357 — FunctionCollector.getFunctionName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Types.isTypeConstant (cognitive 18) · ×1
  • Types.isTypeConstant (cognitive 18) pkg/dart2wasm/lib/types.dart:121 — Types.isTypeConstant has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 18. 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.
D2 · Cognitive Complexity · C.m (cognitive 18) · ×1
  • C.m (cognitive 18) pkg/front_end/testcases/general/for_in_without_declaration.dart:21 — C.m has cognitive complexity 18 (threshold 15). Drivers by points: loops 18. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AstClass.kind (cognitive 18) · ×1
  • AstClass.kind (cognitive 18) pkg/front_end/tool/ast_model.dart:299 — AstClass.kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VerifyingVisitor.visitField (cognitive 18) · ×1
  • _VerifyingVisitor.visitField (cognitive 18) pkg/kernel/lib/verifier.dart:815 — _VerifyingVisitor.visitField has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _SnapshotGraph._readObjects (cognitive 18) · ×1
  • _SnapshotGraph._readObjects (cognitive 18) pkg/observatory/lib/object_graph.dart:969 — _SnapshotGraph._readObjects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.formatDuration (cognitive 18) · ×1
  • Utils.formatDuration (cognitive 18) pkg/observatory/lib/utils.dart:150 — Utils.formatDuration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConnectionTarget.connect (cognitive 18) · ×1
  • _ConnectionTarget.connect (cognitive 18) sdk/lib/_http/http_impl.dart:2709 — _ConnectionTarget.connect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _HttpParser._onDone (cognitive 18) · ×1
  • _HttpParser._onDone (cognitive 18) sdk/lib/_http/http_parser.dart:970 — _HttpParser._onDone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _WebSocketProtocolTransformer._controlFrameEnd (cognitive 18) · ×1
  • _WebSocketProtocolTransformer._controlFrameEnd (cognitive 18) sdk/lib/_http/websocket_impl.dart:564 — _WebSocketProtocolTransformer._controlFrameEnd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CustomHashMap._set (cognitive 18) · ×1
  • CustomHashMap._set (cognitive 18) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:125 — CustomHashMap._set has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonMLFormatter.body (cognitive 18) · ×1
  • JsonMLFormatter.body (cognitive 18) sdk/lib/_internal/js_dev_runtime/private/debugger.dart:417 — JsonMLFormatter.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkedSet.remove (cognitive 18) · ×1
  • LinkedSet.remove (cognitive 18) sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:215 — LinkedSet.remove has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Isolate.spawnUri (cognitive 18) · ×1
  • Isolate.spawnUri (cognitive 18) sdk/lib/_internal/vm/lib/isolate_patch.dart:432 — Isolate.spawnUri has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · int._parseBlock (cognitive 18) · ×1
  • int._parseBlock (cognitive 18) sdk/lib/_internal/vm_shared/lib/integers_patch.dart:275 — int._parseBlock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._uriEncode (cognitive 18) · ×1
  • _Uri._uriEncode (cognitive 18) sdk/lib/_internal/vm_shared/lib/uri_encode_patch.dart:10 — _Uri._uriEncode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChunkedJsonParser.parseStringEscape (cognitive 18) · ×1
  • _ChunkedJsonParser.parseStringEscape (cognitive 18) sdk/lib/_internal/wasm/common/convert_patch.dart:1377 — _ChunkedJsonParser.parseStringEscape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Object.hash (cognitive 18) · ×1
  • Object.hash (cognitive 18) sdk/lib/core/object.dart:152 — Object.hash has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FfiTransformer.convertDartTypeToNativeType (cognitive 18) · ×1
  • FfiTransformer.convertDartTypeToNativeType (cognitive 18) pkg/vm/lib/modular/transformations/ffi/common.dart:1256 — FfiTransformer.convertDartTypeToNativeType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiDefinitionTransformer.manualVisitInTopologicalOrder (cognitive 18) · ×1
  • _FfiDefinitionTransformer.manualVisitInTopologicalOrder (cognitive 18) pkg/vm/lib/modular/transformations/ffi/definitions.dart:185 — _FfiDefinitionTransformer.manualVisitInTopologicalOrder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Simplification.visitBinaryDoubleOp (cognitive 18) · ×1
  • Simplification.visitBinaryDoubleOp (cognitive 18) pkg/cfg/lib/passes/simplification.dart:609 — Simplification.visitBinaryDoubleOp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PropertyWitness.witnessToDart (cognitive 18) · ×1
  • PropertyWitness.witnessToDart (cognitive 18) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart:412 — PropertyWitness.witnessToDart has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseDirectives (cognitive 18) · ×1
  • Parser.parseDirectives (cognitive 18) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:467 — Parser.parseDirectives has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexTypeInfo.computeRest (cognitive 18) · ×1
  • ComplexTypeInfo.computeRest (cognitive 18) pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart:1091 — ComplexTypeInfo.computeRest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckNameResponse._addElementDeclaration (cognitive 18) · ×1
  • CheckNameResponse._addElementDeclaration (cognitive 18) pkg/analysis_server/lib/src/cider/rename.dart:214 — CheckNameResponse._addElementDeclaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitHighlightsComputer._isCallMethod (cognitive 18) · ×1
  • DartUnitHighlightsComputer._isCallMethod (cognitive 18) pkg/analysis_server/lib/src/computer/computer_highlights.dart:682 — DartUnitHighlightsComputer._isCallMethod has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, match/switch 2. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DartUnitOutlineComputer.compute (cognitive 18) · ×1
  • DartUnitOutlineComputer.compute (cognitive 18) pkg/analysis_server/lib/src/computer/computer_outline.dart:22 — DartUnitOutlineComputer.compute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 3 (7 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ContextManagerImpl._analyzeAnalysisOptionsYamlFiles (cognitive 18) · ×1
  • ContextManagerImpl._analyzeAnalysisOptionsYamlFiles (cognitive 18) pkg/analysis_server/lib/src/context_manager.dart:396 — ContextManagerImpl._analyzeAnalysisOptionsYamlFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SummaryWriter.summarize (cognitive 18) · ×1
  • SummaryWriter.summarize (cognitive 18) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_summary.dart:70 — SummaryWriter.summarize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginManager._computeFiles (cognitive 18) · ×1
  • PluginManager._computeFiles (cognitive 18) pkg/analysis_server/lib/src/plugin/plugin_manager.dart:770 — PluginManager._computeFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddKeyToConstructors._updateSuperInBody (cognitive 18) · ×1
  • AddKeyToConstructors._updateSuperInBody (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart:342 — AddKeyToConstructors._updateSuperInBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChangeTo._proposeField (cognitive 18) · ×1
  • ChangeTo._proposeField (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:249 — ChangeTo._proposeField has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _EnumDescription._indexFieldData (cognitive 18) · ×1
  • _EnumDescription._indexFieldData (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart:536 — _EnumDescription._indexFieldData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EncapsulateField.compute (cognitive 18) · ×1
  • EncapsulateField.compute (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/encapsulate_field.dart:44 — EncapsulateField.compute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FlutterConvertToStatelessWidget._isDefaultOverride (cognitive 18) · ×1
  • FlutterConvertToStatelessWidget._isDefaultOverride (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart:248 — FlutterConvertToStatelessWidget._isDefaultOverride has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterWrap._wrapMultipleWidgets (cognitive 18) · ×1
  • FlutterWrap._wrapMultipleWidgets (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart:53 — FlutterWrap._wrapMultipleWidgets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoveThisAlias._resolveNameInScope (cognitive 18) · ×1
  • RemoveThisAlias._resolveNameInScope (cognitive 18) pkg/analysis_server/lib/src/services/correction/dart/remove_this_alias.dart:192 — RemoveThisAlias._resolveNameInScope has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PubspecFixGenerator.computeFixes (cognitive 18) · ×1
  • PubspecFixGenerator.computeFixes (cognitive 18) pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart:75 — PubspecFixGenerator.computeFixes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PubspecFixGenerator._sortPubDependencies (cognitive 18) · ×1
  • PubspecFixGenerator._sortPubDependencies (cognitive 18) pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart:506 — PubspecFixGenerator._sortPubDependencies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportOrganizer.getLeadingComment (cognitive 18) · ×1
  • ImportOrganizer.getLeadingComment (cognitive 18) pkg/analysis_server/lib/src/services/correction/organize_imports.dart:452 — ImportOrganizer.getLeadingComment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WidgetDescriptionComputer._addContainerProperty (cognitive 18) · ×1
  • _WidgetDescriptionComputer._addContainerProperty (cognitive 18) pkg/analysis_server/lib/src/services/flutter/widget_descriptions.dart:167 — _WidgetDescriptionComputer._addContainerProperty has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ReferenceProcessor._canInlineBody (cognitive 18) · ×1
  • _ReferenceProcessor._canInlineBody (cognitive 18) pkg/analysis_server/lib/src/services/refactoring/legacy/inline_method.dart:723 — _ReferenceProcessor._canInlineBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameRefactoring.create (cognitive 18) · ×1
  • RenameRefactoring.create (cognitive 18) pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart:467 — RenameRefactoring.create has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RenameClassMemberRefactoringImpl._updateReferences (cognitive 18) · ×1
  • RenameClassMemberRefactoringImpl._updateReferences (cognitive 18) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:174 — RenameClassMemberRefactoringImpl._updateReferences has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _RenameClassMemberValidator._getLocalShadowingElement (cognitive 18) · ×1
  • _RenameClassMemberValidator._getLocalShadowingElement (cognitive 18) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_class_member.dart:473 — _RenameClassMemberValidator._getLocalShadowingElement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginsPage.generateContent (cognitive 18) · ×1
  • PluginsPage.generateContent (cognitive 18) pkg/analysis_server/lib/src/status/pages/plugins_page.dart:26 — PluginsPage.generateContent has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (7 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ServerBase.outputProcessor (cognitive 18) · ×1
  • ServerBase.outputProcessor (cognitive 18) pkg/analysis_server_client/lib/src/server_base.dart:106 — ServerBase.outputProcessor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnalysisDriver.performWork (cognitive 18) · ×1
  • AnalysisDriver.performWork (cognitive 18) pkg/analyzer/lib/src/dart/analysis/driver.dart:1205 — AnalysisDriver.performWork has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _IndexContributor.recordRelationOffset (cognitive 18) · ×1
  • _IndexContributor.recordRelationOffset (cognitive 18) pkg/analyzer/lib/src/dart/analysis/index.dart:556 — _IndexContributor.recordRelationOffset has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts) (nesting depth added 1). 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.
D2 · Cognitive Complexity · LibraryAnalyzer._reportImportDirectiveErrors (cognitive 18) · ×1
  • LibraryAnalyzer._reportImportDirectiveErrors (cognitive 18) pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart:695 — LibraryAnalyzer._reportImportDirectiveErrors has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 7 (8 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImpl._lexicallyFirst (cognitive 18) · ×1
  • AstNodeImpl._lexicallyFirst (cognitive 18) pkg/analyzer/lib/src/dart/ast/ast.dart:3461 — AstNodeImpl._lexicallyFirst has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 6. 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.
D2 · Cognitive Complexity · SimpleIdentifierImpl.inGetterContext (cognitive 18) · ×1
  • SimpleIdentifierImpl.inGetterContext (cognitive 18) pkg/analyzer/lib/src/dart/ast/ast.dart:54750 — SimpleIdentifierImpl.inGetterContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringLexemeHelper.StringLexemeHelper (cognitive 18) · ×1
  • StringLexemeHelper.StringLexemeHelper (cognitive 18) pkg/analyzer/lib/src/dart/ast/ast.dart:55713 — StringLexemeHelper.StringLexemeHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEvaluator.visitPrefixExpression (cognitive 18) · ×1
  • ConstantEvaluator.visitPrefixExpression (cognitive 18) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:307 — ConstantEvaluator.visitPrefixExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier.visitSetOrMapLiteral (cognitive 18) · ×1
  • ConstantVerifier.visitSetOrMapLiteral (cognitive 18) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:462 — ConstantVerifier.visitSetOrMapLiteral has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (6 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ConstantVerifier._checkVariableInitializer (cognitive 18) · ×1
  • ConstantVerifier._checkVariableInitializer (cognitive 18) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:696 — ConstantVerifier._checkVariableInitializer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstructorInvocationEvaluator._followConstantRedirectionChain (cognitive 18) · ×1
  • _ConstructorInvocationEvaluator._followConstantRedirectionChain (cognitive 18) pkg/analyzer/lib/src/dart/constant/evaluation.dart:3766 — _ConstructorInvocationEvaluator._followConstantRedirectionChain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl.instantiateTypeFormalsToBounds (cognitive 18) · ×1
  • TypeSystemImpl.instantiateTypeFormalsToBounds (cognitive 18) pkg/analyzer/lib/src/dart/element/type_system.dart:790 — TypeSystemImpl.instantiateTypeFormalsToBounds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeSystemImpl.isMoreTop (cognitive 18) · ×1
  • TypeSystemImpl.isMoreTop (cognitive 18) pkg/analyzer/lib/src/dart/element/type_system.dart:1150 — TypeSystemImpl.isMoreTop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TypeSystemImpl._isNonNullable (cognitive 18) · ×1
  • TypeSystemImpl._isNonNullable (cognitive 18) pkg/analyzer/lib/src/dart/element/type_system.dart:1860 — TypeSystemImpl._isNonNullable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodInvocationResolver.resolveImportPrefixed (cognitive 18) · ×1
  • MethodInvocationResolver.resolveImportPrefixed (cognitive 18) pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart:89 — MethodInvocationResolver.resolveImportPrefixed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver._resolveUnqualifiedNameRead (cognitive 18) · ×1
  • PropertyElementResolver._resolveUnqualifiedNameRead (cognitive 18) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:2165 — PropertyElementResolver._resolveUnqualifiedNameRead has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ScopeAnalyzer._resolveType (cognitive 18) · ×1
  • ScopeAnalyzer._resolveType (cognitive 18) pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:1651 — ScopeAnalyzer._resolveType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAnalyzer._resolveParsedDotShorthandInvocation (cognitive 18) · ×1
  • TypeAnalyzer._resolveParsedDotShorthandInvocation (cognitive 18) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:5464 — TypeAnalyzer._resolveParsedDotShorthandInvocation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImportsVerifier._wouldChangeResolution (cognitive 18) · ×1
  • ImportsVerifier._wouldChangeResolution (cognitive 18) pkg/analyzer/lib/src/error/imports_verifier.dart:554 — ImportsVerifier._wouldChangeResolution has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper (cognitive 18) · ×1
  • MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper (cognitive 18) pkg/analyzer/lib/src/error/must_call_super_verifier.dart:77 — MustCallSuperVerifier._findOverriddenMemberWithMustCallSuper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GatherUsedLocalElementsVisitor._matchParameters (cognitive 18) · ×1
  • GatherUsedLocalElementsVisitor._matchParameters (cognitive 18) pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart:638 — GatherUsedLocalElementsVisitor._matchParameters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.handleIdentifier (cognitive 18) · ×1
  • AstBuilder.handleIdentifier (cognitive 18) pkg/analyzer/lib/src/fasta/ast_builder.dart:4619 — AstBuilder.handleIdentifier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.handleRecoverDeclarationHeader (cognitive 18) · ×1
  • AstBuilder.handleRecoverDeclarationHeader (cognitive 18) pkg/analyzer/lib/src/fasta/ast_builder.dart:5570 — AstBuilder.handleRecoverDeclarationHeader has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AstBuilder._buildConstructorDeclaration (cognitive 18) · ×1
  • AstBuilder._buildConstructorDeclaration (cognitive 18) pkg/analyzer/lib/src/fasta/ast_builder.dart:6081 — AstBuilder._buildConstructorDeclaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocCommentBuilder._parseDocComment (cognitive 18) · ×1
  • DocCommentBuilder._parseDocComment (cognitive 18) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:267 — DocCommentBuilder._parseDocComment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NonAssignabilityReporterForArgument.createDiagnostic (cognitive 18) · ×1
  • NonAssignabilityReporterForArgument.createDiagnostic (cognitive 18) pkg/analyzer/lib/src/generated/error_detection_helpers.dart:388 — NonAssignabilityReporterForArgument.createDiagnostic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForConflictingClassTypeVariableErrorCodes (cognitive 18) · ×1
  • ErrorVerifier._checkForConflictingClassTypeVariableErrorCodes (cognitive 18) pkg/analyzer/lib/src/generated/error_verifier.dart:4082 — ErrorVerifier._checkForConflictingClassTypeVariableErrorCodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._primitiveNativeType (cognitive 18) · ×1
  • FfiVerifier._primitiveNativeType (cognitive 18) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1177 — FfiVerifier._primitiveNativeType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._validateAsFunction (cognitive 18) · ×1
  • FfiVerifier._validateAsFunction (cognitive 18) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1456 — FfiVerifier._validateAsFunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FfiVerifier._validateFromFunction (cognitive 18) · ×1
  • FfiVerifier._validateFromFunction (cognitive 18) pkg/analyzer/lib/src/generated/ffi_verifier.dart:1827 — FfiVerifier._validateFromFunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdkLibrariesReader_LibraryBuilder.visitMapLiteralEntry (cognitive 18) · ×1
  • SdkLibrariesReader_LibraryBuilder.visitMapLiteralEntry (cognitive 18) pkg/analyzer/lib/src/generated/sdk.dart:193 — SdkLibrariesReader_LibraryBuilder.visitMapLiteralEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ElementBuilder._linkFormalParameters (cognitive 18) · ×1
  • ElementBuilder._linkFormalParameters (cognitive 18) pkg/analyzer/lib/src/summary2/element_builder.dart:1027 — ElementBuilder._linkFormalParameters has cognitive complexity 18 (threshold 15). Drivers by points: loops 9 (11 pts), if/else 5 (6 pts), match/switch 1 (nesting depth added 3). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · EnclosingTypeParameterReferenceFlag.perform (cognitive 18) · ×1
  • EnclosingTypeParameterReferenceFlag.perform (cognitive 18) pkg/analyzer/lib/src/summary2/enclosing_type_parameters_flag.dart:44 — EnclosingTypeParameterReferenceFlag.perform has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 1 (4 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · FuzzyMatcher.score (cognitive 18) · ×1
  • FuzzyMatcher.score (cognitive 18) pkg/analyzer/lib/src/utilities/fuzzy_matcher.dart:444 — FuzzyMatcher.score has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InsertionPreparer.insertionLocation (cognitive 18) · ×1
  • _InsertionPreparer.insertionLocation (cognitive 18) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:3718 — _InsertionPreparer.insertionLocation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionTarget._computeDroppedToken (cognitive 18) · ×1
  • CompletionTarget._computeDroppedToken (cognitive 18) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:640 — CompletionTarget._computeDroppedToken has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionTarget._getContainingCommentToken (cognitive 18) · ×1
  • CompletionTarget._getContainingCommentToken (cognitive 18) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:689 — CompletionTarget._getContainingCommentToken has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OpTypeAstVisitor.visitSwitchPatternCase (cognitive 18) · ×1
  • _OpTypeAstVisitor.visitSwitchPatternCase (cognitive 18) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1683 — _OpTypeAstVisitor.visitSwitchPatternCase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OpTypeAstVisitor._argumentListContext (cognitive 18) · ×1
  • _OpTypeAstVisitor._argumentListContext (cognitive 18) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:1853 — _OpTypeAstVisitor._argumentListContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ExpectedDiagnostic.matches (cognitive 18) · ×1
  • ExpectedDiagnostic.matches (cognitive 18) pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart:123 — ExpectedDiagnostic.matches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ExpectedDiagnosticsUpdater._writeContent (cognitive 18) · ×1
  • _ExpectedDiagnosticsUpdater._writeContent (cognitive 18) pkg/analyzer_testing/lib/src/expected_diagnostics.dart:293 — _ExpectedDiagnosticsUpdater._writeContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTypeGraphBuilder._findLength (cognitive 18) · ×1
  • KernelTypeGraphBuilder._findLength (cognitive 18) pkg/compiler/lib/src/inferrer/builder.dart:1534 — KernelTypeGraphBuilder._findLength has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantEmitter.visitMap (cognitive 18) · ×1
  • ConstantEmitter.visitMap (cognitive 18) pkg/compiler/lib/src/js_backend/constant_emitter.dart:319 — ConstantEmitter.visitMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TypeVariableTests._setupDependencies (cognitive 18) · ×1
  • TypeVariableTests._setupDependencies (cognitive 18) pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart:350 — TypeVariableTests._setupDependencies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 5 (8 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · KClassEnv.convert (cognitive 18) · ×1
  • KClassEnv.convert (cognitive 18) pkg/compiler/lib/src/kernel/env.dart:388 — KClassEnv.convert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder.visitBreakStatement (cognitive 18) · ×1
  • KernelSsaGraphBuilder.visitBreakStatement (cognitive 18) pkg/compiler/lib/src/ssa/builder.dart:3454 — KernelSsaGraphBuilder.visitBreakStatement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._setupStateForInlining (cognitive 18) · ×1
  • KernelSsaGraphBuilder._setupStateForInlining (cognitive 18) pkg/compiler/lib/src/ssa/builder.dart:8333 — KernelSsaGraphBuilder._setupStateForInlining has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InlineData.cannotBeInlinedReductiveReason (cognitive 18) · ×1
  • InlineData.cannotBeInlinedReductiveReason (cognitive 18) pkg/compiler/lib/src/ssa/builder.dart:9044 — InlineData.cannotBeInlinedReductiveReason has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SsaCodeGenerator.visitLabeledBlockInfo (cognitive 18) · ×1
  • SsaCodeGenerator.visitLabeledBlockInfo (cognitive 18) pkg/compiler/lib/src/ssa/codegen.dart:1280 — SsaCodeGenerator.visitLabeledBlockInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.visitTypeEval (cognitive 18) · ×1
  • SsaCodeGenerator.visitTypeEval (cognitive 18) pkg/compiler/lib/src/ssa/codegen.dart:4131 — SsaCodeGenerator.visitTypeEval has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SsaInstructionSelection.visitIf (cognitive 18) · ×1
  • SsaInstructionSelection.visitIf (cognitive 18) pkg/compiler/lib/src/ssa/codegen_helpers.dart:480 — SsaInstructionSelection.visitIf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaSimplifyInterceptors.rewriteSelfInterceptorUses (cognitive 18) · ×1
  • SsaSimplifyInterceptors.rewriteSelfInterceptorUses (cognitive 18) pkg/compiler/lib/src/ssa/interceptor_simplifier.dart:391 — SsaSimplifyInterceptors.rewriteSelfInterceptorUses has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier._removeInstructionAndPureDeadInputs (cognitive 18) · ×1
  • SsaInstructionSimplifier._removeInstructionAndPureDeadInputs (cognitive 18) pkg/compiler/lib/src/ssa/optimize.dart:387 — SsaInstructionSimplifier._removeInstructionAndPureDeadInputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.handleIdentityCheck (cognitive 18) · ×1
  • SsaInstructionSimplifier.handleIdentityCheck (cognitive 18) pkg/compiler/lib/src/ssa/optimize.dart:1423 — SsaInstructionSimplifier.handleIdentityCheck has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitStringConcat (cognitive 18) · ×1
  • SsaInstructionSimplifier.visitStringConcat (cognitive 18) pkg/compiler/lib/src/ssa/optimize.dart:2349 — SsaInstructionSimplifier.visitStringConcat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Range.& (cognitive 18) · ×1
  • Range.& (cognitive 18) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:656 — Range.& has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaValueRangeAnalyzer.visitRemainder (cognitive 18) · ×1
  • SsaValueRangeAnalyzer.visitRemainder (cognitive 18) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:1083 — SsaValueRangeAnalyzer.visitRemainder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 4 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · IsolateManager._readyToResume (cognitive 18) · ×1
  • IsolateManager._readyToResume (cognitive 18) pkg/dap_adapters/lib/src/isolate_manager.dart:405 — IsolateManager._readyToResume has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackTraceLine.fromText (cognitive 18) · ×1
  • StackTraceLine.fromText (cognitive 18) pkg/dart2js_tools/lib/src/trace.dart:26 — StackTraceLine.fromText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompileSubcommandCommand.resolveTargetBinaries (cognitive 18) · ×1
  • CompileSubcommandCommand.resolveTargetBinaries (cognitive 18) pkg/dartdev/lib/src/commands/compile.dart:1221 — CompileSubcommandCommand.resolveTargetBinaries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendServerCompiler._readModules (cognitive 18) · ×1
  • FrontendServerCompiler._readModules (cognitive 18) pkg/dartpad_worker/lib/src/tools/frontend_server_compiler.dart:317 — FrontendServerCompiler._readModules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitMemberName (cognitive 18) · ×1
  • ProgramCompiler._emitMemberName (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler.dart:3190 — ProgramCompiler._emitMemberName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._isStaticInteropTearOff (cognitive 18) · ×1
  • ProgramCompiler._isStaticInteropTearOff (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler.dart:3551 — ProgramCompiler._isStaticInteropTearOff has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitInlineJSCode (cognitive 18) · ×1
  • ProgramCompiler._emitInlineJSCode (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler.dart:7209 — ProgramCompiler._emitInlineJSCode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitMemberName (cognitive 18) · ×1
  • LibraryCompiler._emitMemberName (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3705 — LibraryCompiler._emitMemberName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._isStaticInteropTearOff (cognitive 18) · ×1
  • LibraryCompiler._isStaticInteropTearOff (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4162 — LibraryCompiler._isStaticInteropTearOff has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitInlineJSCode (cognitive 18) · ×1
  • LibraryCompiler._emitInlineJSCode (cognitive 18) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8076 — LibraryCompiler._emitInlineJSCode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HotReloadDeltaInspector.compareGenerations (cognitive 18) · ×1
  • HotReloadDeltaInspector.compareGenerations (cognitive 18) pkg/dev_compiler/lib/src/kernel/hot_reload_delta_inspector.dart:29 — HotReloadDeltaInspector.compareGenerations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentWebSocket._listenWithRetry (cognitive 18) · ×1
  • PersistentWebSocket._listenWithRetry (cognitive 18) pkg/dwds/lib/src/sockets.dart:174 — PersistentWebSocket._listenWithRetry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LookupResult._fromBuilders (cognitive 18) · ×1
  • LookupResult._fromBuilders (cognitive 18) pkg/front_end/lib/src/base/lookup_result.dart:98 — LookupResult._fromBuilders has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LookupResultIterator.moveNext (cognitive 18) · ×1
  • LookupResultIterator.moveNext (cognitive 18) pkg/front_end/lib/src/base/scope.dart:348 — LookupResultIterator.moveNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (18 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAliasBuilderImpl._unaliasDeclaration (cognitive 18) · ×1
  • TypeAliasBuilderImpl._unaliasDeclaration (cognitive 18) pkg/front_end/lib/src/builder/type_alias_builder.dart:458 — TypeAliasBuilderImpl._unaliasDeclaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegularConstructorEncoding._build (cognitive 18) · ×1
  • RegularConstructorEncoding._build (cognitive 18) pkg/front_end/lib/src/fragment/constructor/encoding.dart:270 — RegularConstructorEncoding._build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endForStatement (cognitive 18) · ×1
  • BodyBuilderImpl.endForStatement (cognitive 18) pkg/front_end/lib/src/kernel/body_builder.dart:4101 — BodyBuilderImpl.endForStatement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.handleThisExpression (cognitive 18) · ×1
  • BodyBuilderImpl.handleThisExpression (cognitive 18) pkg/front_end/lib/src/kernel/body_builder.dart:8659 — BodyBuilderImpl.handleThisExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MapConstantBuilder.addSpread (cognitive 18) · ×1
  • MapConstantBuilder.addSpread (cognitive 18) pkg/front_end/lib/src/kernel/constant_collection_builders.dart:300 — MapConstantBuilder.addSpread has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantsTransformer.visitStringConcatenation (cognitive 18) · ×1
  • ConstantsTransformer.visitStringConcatenation (cognitive 18) pkg/front_end/lib/src/kernel/constant_evaluator.dart:2406 — ConstantsTransformer.visitStringConcatenation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartScopeBuilder2._filterScopesWithArtificialNodes (cognitive 18) · ×1
  • DartScopeBuilder2._filterScopesWithArtificialNodes (cognitive 18) pkg/front_end/lib/src/kernel/dart_scope_calculator.dart:545 — DartScopeBuilder2._filterScopesWithArtificialNodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DynamicModuleValidator._verifyCallable (cognitive 18) · ×1
  • _DynamicModuleValidator._verifyCallable (cognitive 18) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:906 — _DynamicModuleValidator._verifyCallable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThisAccessGenerator.buildSelectorAccess (cognitive 18) · ×1
  • ThisAccessGenerator.buildSelectorAccess (cognitive 18) pkg/front_end/lib/src/kernel/expression_generator.dart:6976 — ThisAccessGenerator.buildSelectorAccess has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassMembersNodeBuilder.inferSetterType (cognitive 18) · ×1
  • ClassMembersNodeBuilder.inferSetterType (cognitive 18) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:378 — ClassMembersNodeBuilder.inferSetterType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationNameSpaceBuilder.buildNameSpace (cognitive 18) · ×1
  • DeclarationNameSpaceBuilder.buildNameSpace (cognitive 18) pkg/front_end/lib/src/source/name_space_builder.dart:41 — DeclarationNameSpaceBuilder.buildNameSpace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.beginMethod (cognitive 18) · ×1
  • OutlineBuilder.beginMethod (cognitive 18) pkg/front_end/lib/src/source/outline_builder.dart:2295 — OutlineBuilder.beginMethod has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceDeclarationBuilderMixin._buildMember (cognitive 18) · ×1
  • SourceDeclarationBuilderMixin._buildMember (cognitive 18) pkg/front_end/lib/src/source/source_builder_mixins.dart:277 — SourceDeclarationBuilderMixin._buildMember has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (18 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceClassBuilder._checkTypes (cognitive 18) · ×1
  • SourceClassBuilder._checkTypes (cognitive 18) pkg/front_end/lib/src/source/source_class_builder.dart:1742 — SourceClassBuilder._checkTypes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SourceEnumBuilder._createSynthesizedMembers (cognitive 18) · ×1
  • SourceEnumBuilder._createSynthesizedMembers (cognitive 18) pkg/front_end/lib/src/source/source_enum_builder.dart:162 — SourceEnumBuilder._createSynthesizedMembers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLibraryBuilder.finishForwarders (cognitive 18) · ×1
  • SourceLibraryBuilder.finishForwarders (cognitive 18) pkg/front_end/lib/src/source/source_library_builder.dart:1198 — SourceLibraryBuilder.finishForwarders has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.resolveParts (cognitive 18) · ×1
  • SourceLoader.resolveParts (cognitive 18) pkg/front_end/lib/src/source/source_loader.dart:1656 — SourceLoader.resolveParts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceLoader.checkOverrides (cognitive 18) · ×1
  • SourceLoader.checkOverrides (cognitive 18) pkg/front_end/lib/src/source/source_loader.dart:2763 — SourceLoader.checkOverrides has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitIfNullSuperIndexSet (cognitive 18) · ×1
  • InferenceVisitorImpl.visitIfNullSuperIndexSet (cognitive 18) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7088 — InferenceVisitorImpl.visitIfNullSuperIndexSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 4, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitCompoundIndexSet (cognitive 18) · ×1
  • InferenceVisitorImpl.visitCompoundIndexSet (cognitive 18) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462 — InferenceVisitorImpl.visitCompoundIndexSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FileInfoHelper.getContent (cognitive 18) · ×1
  • FileInfoHelper.getContent (cognitive 18) pkg/front_end/lib/src/util/import_export_etc_helper.dart:31 — FileInfoHelper.getContent has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 6 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Printer.visitVariableDeclarationList (cognitive 18) · ×1
  • Printer.visitVariableDeclarationList (cognitive 18) pkg/js_ast/lib/src/printer.dart:843 — Printer.visitVariableDeclarationList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitFormalParameterList (cognitive 18) · ×1
  • _Visitor.visitFormalParameterList (cognitive 18) pkg/linter/lib/src/rules/always_put_required_named_parameters_first.dart:40 — _Visitor.visitFormalParameterList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._offsetAndLengthForFragment (cognitive 18) · ×1
  • _Visitor._offsetAndLengthForFragment (cognitive 18) pkg/linter/lib/src/rules/analyzer_public_api.dart:325 — _Visitor._offsetAndLengthForFragment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitPrimaryConstructorDeclaration (cognitive 18) · ×1
  • _Visitor.visitPrimaryConstructorDeclaration (cognitive 18) pkg/linter/lib/src/rules/annotate_overrides.dart:74 — _Visitor.visitPrimaryConstructorDeclaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _ConstructorChecker._checkInitializer (cognitive 18) · ×1
  • _ConstructorChecker._checkInitializer (cognitive 18) pkg/linter/lib/src/rules/prefer_initializing_formals.dart:142 — _ConstructorChecker._checkInitializer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _Visitor._reportIfNeeded (cognitive 18) · ×1
  • _Visitor._reportIfNeeded (cognitive 18) pkg/linter/lib/src/rules/simplify_variable_pattern.dart:88 — _Visitor._reportIfNeeded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor._checkConstructor (cognitive 18) · ×1
  • _Visitor._checkConstructor (cognitive 18) pkg/linter/lib/src/rules/use_key_in_widget_constructors.dart:82 — _Visitor._checkConstructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _Visitor.afterLibrary (cognitive 18) · ×1
  • _Visitor.afterLibrary (cognitive 18) pkg/linter/lib/src/rules/use_late_for_private_fields_and_variables.dart:54 — _Visitor.afterLibrary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackTraceHeader.writeToStringBuffer (cognitive 18) · ×1
  • StackTraceHeader.writeToStringBuffer (cognitive 18) pkg/native_stack_traces/lib/src/convert.dart:295 — StackTraceHeader.writeToStringBuffer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetCommand.complete (cognitive 18) · ×1
  • SetCommand.complete (cognitive 18) pkg/observatory/lib/src/elements/debugger.dart:731 — SetCommand.complete has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClearCommand.run (cognitive 18) · ×1
  • ClearCommand.run (cognitive 18) pkg/observatory/lib/src/elements/debugger.dart:866 — ClearCommand.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerStackElement.updateStackFrames (cognitive 18) · ×1
  • DebuggerStackElement.updateStackFrames (cognitive 18) pkg/observatory/lib/src/elements/debugger.dart:2384 — DebuggerStackElement.updateStackFrames has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DebuggerInputElement._onKeyDown (cognitive 18) · ×1
  • DebuggerInputElement._onKeyDown (cognitive 18) pkg/observatory/lib/src/elements/debugger.dart:3258 — DebuggerInputElement._onKeyDown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeSection.deserialize (cognitive 18) · ×1
  • CodeSection.deserialize (cognitive 18) pkg/wasm_builder/lib/src/serialize/sections.dart:715 — CodeSection.deserialize has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DataSection.deserialize (cognitive 18) · ×1
  • DataSection.deserialize (cognitive 18) pkg/wasm_builder/lib/src/serialize/sections.dart:826 — DataSection.deserialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Matchers.noSuchMethod (cognitive 18) · ×1
  • Matchers.noSuchMethod (cognitive 18) pkg/vm/lib/testing/il_matchers.dart:892 — Matchers.noSuchMethod has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.writeMetadata (cognitive 18) · ×1
  • Printer.writeMetadata (cognitive 18) pkg/kernel/lib/text/ast_to_text.dart:731 — Printer.writeMetadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.writeFunction (cognitive 18) · ×1
  • Printer.writeFunction (cognitive 18) pkg/kernel/lib/text/ast_to_text.dart:825 — Printer.writeFunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _TreeShakerPass2.calculateRemovedLibraryDeps (cognitive 18) · ×1
  • _TreeShakerPass2.calculateRemovedLibraryDeps (cognitive 18) pkg/vm/lib/transformations/type_flow/transformer.dart:2390 — _TreeShakerPass2.calculateRemovedLibraryDeps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PRESUBMIT._CheckFormat (cognitive 18) · ×1
  • PRESUBMIT._CheckFormat (cognitive 18) PRESUBMIT.py:58 — PRESUBMIT._CheckFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · embedder_layering_check.CheckFile (cognitive 18) · ×1
  • embedder_layering_check.CheckFile (cognitive 18) runtime/tools/embedder_layering_check.py:28 — embedder_layering_check.CheckFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpectedCompletionsVisitor.safelyRecordEntity (cognitive 17) · ×1
  • ExpectedCompletionsVisitor.safelyRecordEntity (cognitive 17) pkg/analysis_server/tool/code_completion/visitors.dart:182 — ExpectedCompletionsVisitor.safelyRecordEntity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Document.outerHtml (cognitive 17) · ×1
  • Document.outerHtml (cognitive 17) pkg/analyzer_utilities/lib/html_dom.dart:17 — Document.outerHtml has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FieldDeclaration.toString (cognitive 17) · ×1
  • FieldDeclaration.toString (cognitive 17) pkg/dart2bytecode/lib/declarations.dart:492 — FieldDeclaration.toString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _Allocator._enterScope (cognitive 17) · ×1
  • _Allocator._enterScope (cognitive 17) pkg/dart2bytecode/lib/local_vars.dart:757 — _Allocator._enterScope has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstructorAllocatorCodeGenerator.generateConstructorAllocator (cognitive 17) · ×1
  • ConstructorAllocatorCodeGenerator.generateConstructorAllocator (cognitive 17) pkg/dart2wasm/lib/code_generator.dart:4719 — ConstructorAllocatorCodeGenerator.generateConstructorAllocator has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4 (6 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DryRunSummarizer._analyzeImports (cognitive 17) · ×1
  • DryRunSummarizer._analyzeImports (cognitive 17) pkg/dart2wasm/lib/dry_run.dart:134 — DryRunSummarizer._analyzeImports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Translator.translate (cognitive 17) · ×1
  • Translator.translate (cognitive 17) pkg/dart2wasm/lib/translator.dart:525 — Translator.translate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Types.classForType (cognitive 17) · ×1
  • Types.classForType (cognitive 17) pkg/dart2wasm/lib/types.dart:140 — Types.classForType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RuntimeTypeInformation._buildTypeRules (cognitive 17) · ×1
  • RuntimeTypeInformation._buildTypeRules (cognitive 17) pkg/dart2wasm/lib/types.dart:1238 — RuntimeTypeInformation._buildTypeRules has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Analysis.variableLengthOf (cognitive 17) · ×1
  • Analysis.variableLengthOf (cognitive 17) pkg/heap_snapshot/lib/analysis.dart:571 — Analysis.variableLengthOf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedWorldClassHierarchy._initializeTopologicallySortedClasses (cognitive 17) · ×1
  • ClosedWorldClassHierarchy._initializeTopologicallySortedClasses (cognitive 17) pkg/kernel/lib/class_hierarchy.dart:1489 — ClosedWorldClassHierarchy._initializeTopologicallySortedClasses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Configuration.toString (cognitive 17) · ×1
  • Configuration.toString (cognitive 17) pkg/smith/lib/configuration.dart:646 — Configuration.toString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MethodParser.parseInto (cognitive 17) · ×1
  • MethodParser.parseInto (cognitive 17) pkg/vm_service/tool/dart/generate_dart_common.dart:1325 — MethodParser.parseInto has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFuzz.emitMethodCall (cognitive 17) · ×1
  • DartFuzz.emitMethodCall (cognitive 17) runtime/tools/dartfuzz/dartfuzz.dart:2467 — DartFuzz.emitMethodCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HttpHeaders._add (cognitive 17) · ×1
  • _HttpHeaders._add (cognitive 17) sdk/lib/_http/http_headers.dart:322 — _HttpHeaders._add has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · _HttpClient._openUrl (cognitive 17) · ×1
  • _HttpClient._openUrl (cognitive 17) sdk/lib/_http/http_impl.dart:3032 — _HttpClient._openUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _WebSocketPerMessageDeflate.processOutgoingMessage (cognitive 17) · ×1
  • _WebSocketPerMessageDeflate.processOutgoingMessage (cognitive 17) sdk/lib/_http/websocket_impl.dart:931 — _WebSocketPerMessageDeflate.processOutgoingMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Utf8Decoder.decode8 (cognitive 17) · ×1
  • _Utf8Decoder.decode8 (cognitive 17) sdk/lib/_internal/wasm/common/convert_patch.dart:2596 — _Utf8Decoder.decode8 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · int._parseBlock (cognitive 17) · ×1
  • int._parseBlock (cognitive 17) sdk/lib/_internal/wasm/common/int_patch.dart:202 — int._parseBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtypeTestCacheStub._generate (cognitive 17) · ×1
  • SubtypeTestCacheStub._generate (cognitive 17) pkg/native_compiler/lib/back_end/arm64/stub_code_generator.dart:995 — SubtypeTestCacheStub._generate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _JsonUtf8Stringifier.writeStringSlice (cognitive 17) · ×1
  • _JsonUtf8Stringifier.writeStringSlice (cognitive 17) sdk/lib/convert/json.dart:1134 — _JsonUtf8Stringifier.writeStringSlice has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _AcceptStructuredClone.walk (cognitive 17) · ×1
  • _AcceptStructuredClone.walk (cognitive 17) sdk/lib/html/html_common/conversions.dart:223 — _AcceptStructuredClone.walk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _FileStream._readBlock (cognitive 17) · ×1
  • _FileStream._readBlock (cognitive 17) sdk/lib/io/file_impl.dart:93 — _FileStream._readBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FileSystemEntity._absoluteWindowsPath (cognitive 17) · ×1
  • FileSystemEntity._absoluteWindowsPath (cognitive 17) sdk/lib/io/file_system_entity.dart:585 — FileSystemEntity._absoluteWindowsPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Loop.addBody (cognitive 17) · ×1
  • Loop.addBody (cognitive 17) pkg/cfg/lib/ir/loops.dart:47 — Loop.addBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeFinalizer.generateJsMethods (cognitive 17) · ×1
  • RuntimeFinalizer.generateJsMethods (cognitive 17) pkg/dart2wasm/lib/js/runtime_generator.dart:60 — RuntimeFinalizer.generateJsMethods has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiDefinitionTransformer.visitClass (cognitive 17) · ×1
  • _FfiDefinitionTransformer.visitClass (cognitive 17) pkg/vm/lib/modular/transformations/ffi/definitions.dart:269 — _FfiDefinitionTransformer.visitClass has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantPropagation.transform (cognitive 17) · ×1
  • ConstantPropagation.transform (cognitive 17) pkg/cfg/lib/passes/constant_propagation.dart:696 — ConstantPropagation.transform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantPropagation._transformPhis (cognitive 17) · ×1
  • ConstantPropagation._transformPhis (cognitive 17) pkg/cfg/lib/passes/constant_propagation.dart:739 — ConstantPropagation._transformPhis has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (7 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Unboxing._findUnboxedInput (cognitive 17) · ×1
  • Unboxing._findUnboxedInput (cognitive 17) pkg/native_compiler/lib/passes/unboxing.dart:125 — Unboxing._findUnboxedInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotSerializer.getCluster (cognitive 17) · ×1
  • SnapshotSerializer.getCluster (cognitive 17) pkg/native_compiler/lib/snapshot/snapshot.dart:365 — SnapshotSerializer.getCluster has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SpaceCreator.createCastSpace (cognitive 17) · ×1
  • SpaceCreator.createCastSpace (cognitive 17) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart:687 — SpaceCreator.createCastSpace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlowModel.rebaseForward (cognitive 17) · ×1
  • FlowModel.rebaseForward (cognitive 17) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart:3910 — FlowModel.rebaseForward has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlowLinkReader._diffCore (cognitive 17) · ×1
  • FlowLinkReader._diffCore (cognitive 17) pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_link.dart:212 — FlowLinkReader._diffCore has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 6 (7 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Parser.parseExpression (cognitive 17) · ×1
  • Parser.parseExpression (cognitive 17) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:6946 — Parser.parseExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsUtilOptimizer._treatmentForProcedure (cognitive 17) · ×1
  • JsUtilOptimizer._treatmentForProcedure (cognitive 17) pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart:254 — JsUtilOptimizer._treatmentForProcedure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartUnitHoverComputer._getTypeOfDeclarationOrReference (cognitive 17) · ×1
  • DartUnitHoverComputer._getTypeOfDeclarationOrReference (cognitive 17) pkg/analysis_server/lib/src/computer/computer_hover.dart:394 — DartUnitHoverComputer._getTypeOfDeclarationOrReference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrateHandler._validateMigrationTargets (cognitive 17) · ×1
  • MigrateHandler._validateMigrationTargets (cognitive 17) pkg/analysis_server/lib/src/lsp/handlers/custom/handler_migrate.dart:115 — MigrateHandler._validateMigrationTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HoverHandler.toHover (cognitive 17) · ×1
  • HoverHandler.toHover (cognitive 17) pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart:61 — HoverHandler.toHover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InitializeMessageHandler.handle (cognitive 17) · ×1
  • InitializeMessageHandler.handle (cognitive 17) pkg/analysis_server/lib/src/lsp/handlers/handler_initialize.dart:22 — InitializeMessageHandler.handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SuggestionBuilder.suggestConstructor (cognitive 17) · ×1
  • SuggestionBuilder.suggestConstructor (cognitive 17) pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart:165 — SuggestionBuilder.suggestConstructor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BulkFixProcessor._formatCode (cognitive 17) · ×1
  • BulkFixProcessor._formatCode (cognitive 17) pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart:869 — BulkFixProcessor._formatCode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMissingEnumCaseClauses._importPrefix (cognitive 17) · ×1
  • AddMissingEnumCaseClauses._importPrefix (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart:123 — AddMissingEnumCaseClauses._importPrefix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BindToField._whetherToCreateNewField (cognitive 17) · ×1
  • BindToField._whetherToCreateNewField (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/bind_to_field.dart:206 — BindToField._whetherToCreateNewField has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertFlutterChild.compute (cognitive 17) · ×1
  • ConvertFlutterChild.compute (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/convert_flutter_child.dart:25 — ConvertFlutterChild.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateConstructorForFinalFields._fieldsToWrite (cognitive 17) · ×1
  • CreateConstructorForFinalFields._fieldsToWrite (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/create_constructor_for_final_fields.dart:111 — CreateConstructorForFinalFields._fieldsToWrite has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterWrap.producers (cognitive 17) · ×1
  • FlutterWrap.producers (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/flutter_wrap.dart:21 — FlutterWrap.producers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ImportLibraryCombinatorMultiple.compute (cognitive 17) · ×1
  • _ImportLibraryCombinatorMultiple.compute (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/import_library.dart:984 — _ImportLibraryCombinatorMultiple.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JoinIfWithOuter.compute (cognitive 17) · ×1
  • JoinIfWithOuter.compute (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/join_if_with_outer.dart:25 — JoinIfWithOuter.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ReplaceFinalWithConst.compute (cognitive 17) · ×1
  • ReplaceFinalWithConst.compute (cognitive 17) pkg/analysis_server/lib/src/services/correction/dart/replace_final_with_const.dart:26 — ReplaceFinalWithConst.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WidgetDescriptionComputer._toValue (cognitive 17) · ×1
  • _WidgetDescriptionComputer._toValue (cognitive 17) pkg/analysis_server/lib/src/services/flutter/widget_descriptions.dart:513 — _WidgetDescriptionComputer._toValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AvailableWithDeclaration.hasSelectedFormalParametersToConvertToNamed (cognitive 17) · ×1
  • _AvailableWithDeclaration.hasSelectedFormalParametersToConvertToNamed (cognitive 17) pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart:446 — _AvailableWithDeclaration.hasSelectedFormalParametersToConvertToNamed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractLocalRefactoringImpl._declarationKeywordAndType (cognitive 17) · ×1
  • ExtractLocalRefactoringImpl._declarationKeywordAndType (cognitive 17) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_local.dart:79 — ExtractLocalRefactoringImpl._declarationKeywordAndType has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractMethodRefactoringImpl._initializeReturnType (cognitive 17) · ×1
  • ExtractMethodRefactoringImpl._initializeReturnType (cognitive 17) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:843 — ExtractMethodRefactoringImpl._initializeReturnType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtractWidgetRefactoringImpl._replaceInvocationsWithInstantiations (cognitive 17) · ×1
  • ExtractWidgetRefactoringImpl._replaceInvocationsWithInstantiations (cognitive 17) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart:386 — ExtractWidgetRefactoringImpl._replaceInvocationsWithInstantiations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YamlNodeLocator._searchWithin (cognitive 17) · ×1
  • YamlNodeLocator._searchWithin (cognitive 17) pkg/analysis_server/lib/src/utilities/yaml_node_locator.dart:36 — YamlNodeLocator._searchWithin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginServer._computeDiagnosticsFromPlugin (cognitive 17) · ×1
  • PluginServer._computeDiagnosticsFromPlugin (cognitive 17) pkg/analysis_server_plugin/lib/src/plugin_server.dart:545 — PluginServer._computeDiagnosticsFromPlugin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParsedOptionalChecksData.parse (cognitive 17) · ×1
  • _ParsedOptionalChecksData.parse (cognitive 17) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1406 — _ParsedOptionalChecksData.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _ContextLocator._createContextRoots (cognitive 17) · ×1
  • _ContextLocator._createContextRoots (cognitive 17) pkg/analyzer/lib/src/dart/analysis/context_locator.dart:343 — _ContextLocator._createContextRoots has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 1 (3 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextRootImpl._includedFilesInFolder (cognitive 17) · ×1
  • ContextRootImpl._includedFilesInFolder (cognitive 17) pkg/analyzer/lib/src/dart/analysis/context_root.dart:100 — ContextRootImpl._includedFilesInFolder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryContext._loadBundle (cognitive 17) · ×1
  • LibraryContext._loadBundle (cognitive 17) pkg/analyzer/lib/src/dart/analysis/library_context.dart:264 — LibraryContext._loadBundle has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5 (7 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SingleFileByteStore._lookup (cognitive 17) · ×1
  • SingleFileByteStore._lookup (cognitive 17) pkg/analyzer/lib/src/dart/analysis/single_file_byte_store.dart:609 — SingleFileByteStore._lookup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVisitor.visitSetOrMapLiteral (cognitive 17) · ×1
  • ConstantVisitor.visitSetOrMapLiteral (cognitive 17) pkg/analyzer/lib/src/dart/constant/evaluation.dart:1222 — ConstantVisitor.visitSetOrMapLiteral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConstantTypeChecker._checkGenericFunctionType (cognitive 17) · ×1
  • _ConstantTypeChecker._checkGenericFunctionType (cognitive 17) pkg/analyzer/lib/src/dart/constant/potentially_constant.dart:467 — _ConstantTypeChecker._checkGenericFunctionType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterfaceLeastUpperBoundHelper.compute (cognitive 17) · ×1
  • InterfaceLeastUpperBoundHelper.compute (cognitive 17) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:24 — InterfaceLeastUpperBoundHelper.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeTypeEqualityVisitor.visitFunctionType (cognitive 17) · ×1
  • RuntimeTypeEqualityVisitor.visitFunctionType (cognitive 17) pkg/analyzer/lib/src/dart/element/runtime_type_equality.dart:41 — RuntimeTypeEqualityVisitor.visitFunctionType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssignmentExpressionResolver.resolveDirect (cognitive 17) · ×1
  • AssignmentExpressionResolver.resolveDirect (cognitive 17) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:194 — AssignmentExpressionResolver.resolveDirect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyElementResolver.resolveDotShorthand (cognitive 17) · ×1
  • PropertyElementResolver.resolveDotShorthand (cognitive 17) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:279 — PropertyElementResolver.resolveDotShorthand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScopeAnalyzer._lookupBreakOrContinueTarget (cognitive 17) · ×1
  • ScopeAnalyzer._lookupBreakOrContinueTarget (cognitive 17) pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:1260 — ScopeAnalyzer._lookupBreakOrContinueTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SwitchExhaustiveness.visitSwitchMember (cognitive 17) · ×1
  • SwitchExhaustiveness.visitSwitchMember (cognitive 17) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:158 — SwitchExhaustiveness.visitSwitchMember has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NullSafetyDeadCodeVerifier._verifyUnassignedVariable (cognitive 17) · ×1
  • NullSafetyDeadCodeVerifier._verifyUnassignedVariable (cognitive 17) pkg/analyzer/lib/src/error/dead_code_verifier.dart:457 — NullSafetyDeadCodeVerifier._verifyUnassignedVariable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, loops 1 (3 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportsVerifier.addImports (cognitive 17) · ×1
  • ImportsVerifier.addImports (cognitive 17) pkg/analyzer/lib/src/error/imports_verifier.dart:62 — ImportsVerifier.addImports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocCommentBuilder._endBlockDocDirectiveTag (cognitive 17) · ×1
  • DocCommentBuilder._endBlockDocDirectiveTag (cognitive 17) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:168 — DocCommentBuilder._endBlockDocDirectiveTag has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _CharacterSequenceFromMultiLineComment.next (cognitive 17) · ×1
  • _CharacterSequenceFromMultiLineComment.next (cognitive 17) pkg/analyzer/lib/src/fasta/doc_comment_builder.dart:968 — _CharacterSequenceFromMultiLineComment.next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ErrorVerifier._checkForDeferredPrefixCollisions (cognitive 17) · ×1
  • ErrorVerifier._checkForDeferredPrefixCollisions (cognitive 17) pkg/analyzer/lib/src/generated/error_verifier.dart:4852 — ErrorVerifier._checkForDeferredPrefixCollisions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ErrorVerifier._checkForUndefinedConstructorInInitializerImplicit (cognitive 17) · ×1
  • ErrorVerifier._checkForUndefinedConstructorInInitializerImplicit (cognitive 17) pkg/analyzer/lib/src/generated/error_verifier.dart:7542 — ErrorVerifier._checkForUndefinedConstructorInInitializerImplicit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IgnoreInfo.isIgnoreComment (cognitive 17) · ×1
  • IgnoreInfo.isIgnoreComment (cognitive 17) pkg/analyzer/lib/src/ignore_comments/ignore_info.dart:212 — IgnoreInfo.isIgnoreComment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ResolutionSink.writeType (cognitive 17) · ×1
  • ResolutionSink.writeType (cognitive 17) pkg/analyzer/lib/src/summary2/bundle_writer.dart:1013 — ResolutionSink.writeType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _PropertyInducingElementTypeInference.perform (cognitive 17) · ×1
  • _PropertyInducingElementTypeInference.perform (cognitive 17) pkg/analyzer/lib/src/summary2/top_level_inference.dart:192 — _PropertyInducingElementTypeInference.perform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlazeWorkspacePackage.isInTestDirectory (cognitive 17) · ×1
  • BlazeWorkspacePackage.isInTestDirectory (cognitive 17) pkg/analyzer/lib/src/workspace/blaze.dart:634 — BlazeWorkspacePackage.isInTestDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlazeFileWatcherIsolate.handleRequest (cognitive 17) · ×1
  • BlazeFileWatcherIsolate.handleRequest (cognitive 17) pkg/analyzer/lib/src/workspace/blaze_watcher.dart:177 — BlazeFileWatcherIsolate.handleRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartEditBuilderImpl._getVisibleType (cognitive 17) · ×1
  • DartEditBuilderImpl._getVisibleType (cognitive 17) pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart:1480 — DartEditBuilderImpl._getVisibleType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionTarget.executableElement (cognitive 17) · ×1
  • CompletionTarget.executableElement (cognitive 17) pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart:319 — CompletionTarget.executableElement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PubPackageResolutionTest.assertDiagnosticsIn (cognitive 17) · ×1
  • PubPackageResolutionTest.assertDiagnosticsIn (cognitive 17) pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart:267 — PubPackageResolutionTest.assertDiagnosticsIn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PubPackageResolutionTest.unexpectedMessage (cognitive 17) · ×1
  • PubPackageResolutionTest.unexpectedMessage (cognitive 17) pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart:501 — PubPackageResolutionTest.unexpectedMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferrerEngine._updateSideEffects (cognitive 17) · ×1
  • InferrerEngine._updateSideEffects (cognitive 17) pkg/compiler/lib/src/inferrer/engine.dart:160 — InferrerEngine._updateSideEffects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferrerEngine.typeOfNativeBehavior (cognitive 17) · ×1
  • InferrerEngine.typeOfNativeBehavior (cognitive 17) pkg/compiler/lib/src/inferrer/engine.dart:194 — InferrerEngine.typeOfNativeBehavior has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MapTypeInformation.computeType (cognitive 17) · ×1
  • MapTypeInformation.computeType (cognitive 17) pkg/compiler/lib/src/inferrer/type_graph_nodes.dart:2167 — MapTypeInformation.computeType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordTypeMask._isNonTriviallyDisjoint (cognitive 17) · ×1
  • RecordTypeMask._isNonTriviallyDisjoint (cognitive 17) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:280 — RecordTypeMask._isNonTriviallyDisjoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentEmitter.emitConstructor (cognitive 17) · ×1
  • FragmentEmitter.emitConstructor (cognitive 17) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:943 — FragmentEmitter.emitConstructor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FragmentEmitter.emitInstanceMethod (cognitive 17) · ×1
  • FragmentEmitter.emitInstanceMethod (cognitive 17) pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart:1167 — FragmentEmitter.emitInstanceMethod has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JsKernelToElementMap.readFromDataSource (cognitive 17) · ×1
  • JsKernelToElementMap.readFromDataSource (cognitive 17) pkg/compiler/lib/src/js_model/element_map_impl.dart:275 — JsKernelToElementMap.readFromDataSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KLibraryEnv._ensureMemberMaps (cognitive 17) · ×1
  • KLibraryEnv._ensureMemberMaps (cognitive 17) pkg/compiler/lib/src/kernel/env.dart:87 — KLibraryEnv._ensureMemberMaps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.define (cognitive 17) · ×1
  • SsaCodeGenerator.define (cognitive 17) pkg/compiler/lib/src/ssa/codegen.dart:781 — SsaCodeGenerator.define has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaCodeGenerator.sequentializeCopies (cognitive 17) · ×1
  • SsaCodeGenerator.sequentializeCopies (cognitive 17) pkg/compiler/lib/src/ssa/codegen.dart:1440 — SsaCodeGenerator.sequentializeCopies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaInstructionSimplifier.visitInvokeDynamicGetter (cognitive 17) · ×1
  • SsaInstructionSimplifier.visitInvokeDynamicGetter (cognitive 17) pkg/compiler/lib/src/ssa/optimize.dart:2017 — SsaInstructionSimplifier.visitInvokeDynamicGetter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaRedundantPhiEliminator.visitGraph (cognitive 17) · ×1
  • SsaRedundantPhiEliminator.visitGraph (cognitive 17) pkg/compiler/lib/src/ssa/optimize.dart:3651 — SsaRedundantPhiEliminator.visitGraph has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValueSet.kill (cognitive 17) · ×1
  • ValueSet.kill (cognitive 17) pkg/compiler/lib/src/ssa/value_set.dart:53 — ValueSet.kill has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResolutionWorldBuilder.registerStaticUse (cognitive 17) · ×1
  • ResolutionWorldBuilder.registerStaticUse (cognitive 17) pkg/compiler/lib/src/universe/resolution_world_builder.dart:577 — ResolutionWorldBuilder.registerStaticUse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setlet.removeWhere (cognitive 17) · ×1
  • Setlet.removeWhere (cognitive 17) pkg/compiler/lib/src/util/setlet.dart:213 — Setlet.removeWhere has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadInfo.resolveUrisToPathsBatch (cognitive 17) · ×1
  • ThreadInfo.resolveUrisToPathsBatch (cognitive 17) pkg/dap_adapters/lib/src/isolate_manager.dart:1521 — ThreadInfo.resolveUrisToPathsBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DdsRpcHandlers.lookupResolvedPackageUris (cognitive 17) · ×1
  • DdsRpcHandlers.lookupResolvedPackageUris (cognitive 17) pkg/dart_runtime_service_dds/lib/src/dds_rpcs.dart:225 — DdsRpcHandlers.lookupResolvedPackageUris has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · EvalPackageResolver.collectDependencies (cognitive 17) · ×1
  • EvalPackageResolver.collectDependencies (cognitive 17) pkg/dartdev/lib/src/eval_packages.dart:42 — EvalPackageResolver.collectDependencies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (7 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontendServerClient._readCompileOutput (cognitive 17) · ×1
  • FrontendServerClient._readCompileOutput (cognitive 17) pkg/dartpad_worker/lib/src/tools/frontend_server_client.dart:221 — FrontendServerClient._readCompileOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Workspace.listDirectory (cognitive 17) · ×1
  • _Workspace.listDirectory (cognitive 17) pkg/dartpad_worker/lib/src/worker.dart:443 — _Workspace.listDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.getDelimited (cognitive 17) · ×1
  • MiniJsParser.getDelimited (cognitive 17) pkg/dev_compiler/lib/src/js_ast/builder.dart:676 — MiniJsParser.getDelimited has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniJsParser.parseFun (cognitive 17) · ×1
  • MiniJsParser.parseFun (cognitive 17) pkg/dev_compiler/lib/src/js_ast/builder.dart:1019 — MiniJsParser.parseFun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.out (cognitive 17) · ×1
  • Printer.out (cognitive 17) pkg/dev_compiler/lib/src/js_ast/printer.dart:150 — Printer.out has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._initializeFields (cognitive 17) · ×1
  • ProgramCompiler._initializeFields (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:2365 — ProgramCompiler._initializeFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitTopLevelFields (cognitive 17) · ×1
  • ProgramCompiler._emitTopLevelFields (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:3022 — ProgramCompiler._emitTopLevelFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitArgumentInitializers (cognitive 17) · ×1
  • ProgramCompiler._emitArgumentInitializers (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:4293 — ProgramCompiler._emitArgumentInitializers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._parentMasksToWidth (cognitive 17) · ×1
  • ProgramCompiler._parentMasksToWidth (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler.dart:6261 — ProgramCompiler._parentMasksToWidth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LibraryCompiler._emitArgumentInitializers (cognitive 17) · ×1
  • LibraryCompiler._emitArgumentInitializers (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:4889 — LibraryCompiler._emitArgumentInitializers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._parentMasksToWidth (cognitive 17) · ×1
  • LibraryCompiler._parentMasksToWidth (cognitive 17) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6950 — LibraryCompiler._parentMasksToWidth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExpressionCompilerWorker._collectTransitiveDependencies (cognitive 17) · ×1
  • ExpressionCompilerWorker._collectTransitiveDependencies (cognitive 17) pkg/dev_compiler/lib/src/kernel/expression_compiler_worker.dart:578 — ExpressionCompilerWorker._collectTransitiveDependencies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Modules.initialize (cognitive 17) · ×1
  • Modules.initialize (cognitive 17) pkg/dwds/lib/src/debugging/modules.dart:41 — Modules.initialize has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · MetadataBuilder.buildAnnotations (cognitive 17) · ×1
  • MetadataBuilder.buildAnnotations (cognitive 17) pkg/front_end/lib/src/builder/metadata_builder.dart:74 — MetadataBuilder.buildAnnotations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeLabeler.visitTypedefTearOffConstant (cognitive 17) · ×1
  • TypeLabeler.visitTypedefTearOffConstant (cognitive 17) pkg/front_end/lib/src/codes/type_labeler.dart:566 — TypeLabeler.visitTypedefTearOffConstant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endArguments (cognitive 17) · ×1
  • BodyBuilderImpl.endArguments (cognitive 17) pkg/front_end/lib/src/kernel/body_builder.dart:2925 — BodyBuilderImpl.endArguments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DynamicCallValidator._DynamicCallValidator (cognitive 17) · ×1
  • _DynamicCallValidator._DynamicCallValidator (cognitive 17) pkg/front_end/lib/src/kernel/dynamic_module_validator.dart:1117 — _DynamicCallValidator._DynamicCallValidator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExplicitExtensionInstanceAccessGenerator.fromBuilder (cognitive 17) · ×1
  • ExplicitExtensionInstanceAccessGenerator.fromBuilder (cognitive 17) pkg/front_end/lib/src/kernel/expression_generator.dart:3118 — ExplicitExtensionInstanceAccessGenerator.fromBuilder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTarget.installForwardingConstructors (cognitive 17) · ×1
  • KernelTarget.installForwardingConstructors (cognitive 17) pkg/front_end/lib/src/kernel/kernel_target.dart:932 — KernelTarget.installForwardingConstructors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Resolver._finishFunction (cognitive 17) · ×1
  • Resolver._finishFunction (cognitive 17) pkg/front_end/lib/src/kernel/resolver.dart:1413 — Resolver._finishFunction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ComputeDefaultTypeContext.computeDefaultTypesForVariables (cognitive 17) · ×1
  • ComputeDefaultTypeContext.computeDefaultTypesForVariables (cognitive 17) pkg/front_end/lib/src/kernel/type_algorithms.dart:973 — ComputeDefaultTypeContext.computeDefaultTypesForVariables has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BuilderFactory._createClassBuilderFromFragments (cognitive 17) · ×1
  • BuilderFactory._createClassBuilderFromFragments (cognitive 17) pkg/front_end/lib/src/source/builder_factory.dart:407 — BuilderFactory._createClassBuilderFromFragments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuilderFactory._createMethodBuilder (cognitive 17) · ×1
  • BuilderFactory._createMethodBuilder (cognitive 17) pkg/front_end/lib/src/source/builder_factory.dart:1059 — BuilderFactory._createMethodBuilder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.beginFields (cognitive 17) · ×1
  • OutlineBuilder.beginFields (cognitive 17) pkg/front_end/lib/src/source/outline_builder.dart:4081 — OutlineBuilder.beginFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitMapOrSetLiteral (cognitive 17) · ×1
  • InferenceVisitorImpl.visitMapOrSetLiteral (cognitive 17) pkg/front_end/lib/src/type_inference/inference_visitor.dart:5258 — InferenceVisitorImpl.visitMapOrSetLiteral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitIfNullIndexSet (cognitive 17) · ×1
  • InferenceVisitorImpl.visitIfNullIndexSet (cognitive 17) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6840 — InferenceVisitorImpl.visitIfNullIndexSet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitCompoundSuperIndexSet (cognitive 17) · ×1
  • InferenceVisitorImpl.visitCompoundSuperIndexSet (cognitive 17) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8713 — InferenceVisitorImpl.visitCompoundSuperIndexSet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitExtensionCompoundIndexSet (cognitive 17) · ×1
  • InferenceVisitorImpl.visitExtensionCompoundIndexSet (cognitive 17) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8902 — InferenceVisitorImpl.visitExtensionCompoundIndexSet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MiniJsParser.getRegExp (cognitive 17) · ×1
  • MiniJsParser.getRegExp (cognitive 17) pkg/js_ast/lib/src/builder.dart:554 — MiniJsParser.getRegExp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplacementVisitor.visitFunctionType (cognitive 17) · ×1
  • ReplacementVisitor.visitFunctionType (cognitive 17) pkg/kernel/lib/src/replacement_visitor.dart:15 — ReplacementVisitor.visitFunctionType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitPrimaryConstructorBody (cognitive 17) · ×1
  • _Visitor.visitPrimaryConstructorBody (cognitive 17) pkg/linter/lib/src/rules/initialize_in_field_declaration.dart:59 — _Visitor.visitPrimaryConstructorBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitComment (cognitive 17) · ×1
  • _Visitor.visitComment (cognitive 17) pkg/linter/lib/src/rules/unintended_html_in_doc_comment.dart:200 — _Visitor.visitComment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitFunctionExpression (cognitive 17) · ×1
  • _Visitor.visitFunctionExpression (cognitive 17) pkg/linter/lib/src/rules/unnecessary_lambdas.dart:153 — _Visitor.visitFunctionExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.checkMethodCallback (cognitive 17) · ×1
  • _Visitor.checkMethodCallback (cognitive 17) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:1208 — _Visitor.checkMethodCallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitInstanceCreationExpression (cognitive 17) · ×1
  • _Visitor.visitInstanceCreationExpression (cognitive 17) pkg/linter/lib/src/rules/valid_regexps.dart:34 — _Visitor.visitInstanceCreationExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, error handling 1 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstanceRef.toJson (cognitive 17) · ×1
  • InstanceRef.toJson (cognitive 17) pkg/vm_service/lib/src/vm_service.dart:5211 — InstanceRef.toJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BinaryenInlineHintSection.deserialize (cognitive 17) · ×1
  • BinaryenInlineHintSection.deserialize (cognitive 17) pkg/wasm_builder/lib/src/serialize/sections.dart:1236 — BinaryenInlineHintSection.deserialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnaryOperation.apply (cognitive 17) · ×1
  • UnaryOperation.apply (cognitive 17) pkg/vm/lib/transformations/type_flow/summary.dart:960 — UnaryOperation.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SummaryCollector._mergeVariableValues (cognitive 17) · ×1
  • SummaryCollector._mergeVariableValues (cognitive 17) pkg/vm/lib/transformations/type_flow/summary_collector.dart:1352 — SummaryCollector._mergeVariableValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · showTables (cognitive 17) · ×1
  • showTables (cognitive 17) runtime/tools/graphexplorer/graphexplorer.js:1835 — showTables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 1846, a function literal at line 1863, onchange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · safeSerialize (cognitive 17) · ×1
  • safeSerialize (cognitive 17) REDACTED:367 — safeSerialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AbstractScanner.tokenize (cognitive 16) · ×1
  • AbstractScanner.tokenize (cognitive 16) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:938 — AbstractScanner.tokenize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeShapeMetricsComputer._computeInContext (cognitive 16) · ×1
  • CodeShapeMetricsComputer._computeInContext (cognitive 16) pkg/analysis_server/tool/code_completion/code_metrics.dart:1293 — CodeShapeMetricsComputer._computeInContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (6 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlutterMetricsComputer._computeInContext (cognitive 16) · ×1
  • FlutterMetricsComputer._computeInContext (cognitive 16) pkg/analysis_server/tool/code_completion/flutter_metrics.dart:182 — FlutterMetricsComputer._computeInContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (6 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ConcreteAstVisitorGenerator._writeGeneralizing (cognitive 16) · ×1
  • _ConcreteAstVisitorGenerator._writeGeneralizing (cognitive 16) pkg/analyzer/tool/ast/generate.dart:305 — _ConcreteAstVisitorGenerator._writeGeneralizing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator.visitVariable (cognitive 16) · ×1
  • AstCodeGenerator.visitVariable (cognitive 16) pkg/dart2wasm/lib/code_generator.dart:795 — AstCodeGenerator.visitVariable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstCodeGenerator.visitStringConcatenation (cognitive 16) · ×1
  • AstCodeGenerator.visitStringConcatenation (cognitive 16) pkg/dart2wasm/lib/code_generator.dart:2956 — AstCodeGenerator.visitStringConcatenation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConstantCreator.visitAuxiliaryConstant (cognitive 16) · ×1
  • ConstantCreator.visitAuxiliaryConstant (cognitive 16) pkg/dart2wasm/lib/constants.dart:1653 — ConstantCreator.visitAuxiliaryConstant has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstructorInfo.ConstructorInfo (cognitive 16) · ×1
  • ConstructorInfo.ConstructorInfo (cognitive 16) pkg/dart2wasm/lib/constructor_info.dart:35 — ConstructorInfo.ConstructorInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Intrinsifier.generateStaticGetterIntrinsic (cognitive 16) · ×1
  • Intrinsifier.generateStaticGetterIntrinsic (cognitive 16) pkg/dart2wasm/lib/intrinsics.dart:1189 — Intrinsifier.generateStaticGetterIntrinsic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Translator._filterInferredType (cognitive 16) · ×1
  • Translator._filterInferredType (cognitive 16) pkg/dart2wasm/lib/translator.dart:2151 — Translator._filterInferredType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Types.emitAsCheck (cognitive 16) · ×1
  • Types.emitAsCheck (cognitive 16) pkg/dart2wasm/lib/types.dart:531 — Types.emitAsCheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage (cognitive 16) · ×1
  • _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage (cognitive 16) pkg/front_end/tool/coverage_merger.dart:1300 — _AstIndexerAndIgnoreCollectorBody._recordIfIsCallToNotExpectedCoverage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (4 pts) (nesting depth added 1). 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.
D2 · Cognitive Complexity · _SnapshotGraph._buildOwnedSizes (cognitive 16) · ×1
  • _SnapshotGraph._buildOwnedSizes (cognitive 16) pkg/observatory/lib/object_graph.dart:1266 — _SnapshotGraph._buildOwnedSizes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DartFuzz.emitLiteral (cognitive 16) · ×1
  • DartFuzz.emitLiteral (cognitive 16) runtime/tools/dartfuzz/dartfuzz.dart:2026 — DartFuzz.emitLiteral has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _HttpHeaders._addContentLength (cognitive 16) · ×1
  • _HttpHeaders._addContentLength (cognitive 16) sdk/lib/_http/http_headers.dart:379 — _HttpHeaders._addContentLength has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomHashMap.putIfAbsent (cognitive 16) · ×1
  • CustomHashMap.putIfAbsent (cognitive 16) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:160 — CustomHashMap.putIfAbsent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSNumber.compareTo (cognitive 16) · ×1
  • JSNumber.compareTo (cognitive 16) sdk/lib/_internal/js_runtime/lib/js_number.dart:33 — JSNumber.compareTo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Expando.[]= (cognitive 16) · ×1
  • Expando.[]= (cognitive 16) sdk/lib/_internal/vm/lib/expando_patch.dart:51 — Expando.[]= has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OneByteString.indexOf (cognitive 16) · ×1
  • _OneByteString.indexOf (cognitive 16) sdk/lib/_internal/vm/lib/string_patch.dart:1090 — _OneByteString.indexOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_OneByteString.contains) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _OneByteString.contains (cognitive 16) · ×1
  • _OneByteString.contains (cognitive 16) sdk/lib/_internal/vm/lib/string_patch.dart:1113 — _OneByteString.contains has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (_OneByteString.indexOf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _Utf8Decoder.decode16 (cognitive 16) · ×1
  • _Utf8Decoder.decode16 (cognitive 16) sdk/lib/_internal/wasm/common/convert_patch.dart:2676 — _Utf8Decoder.decode16 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FunctionType.== (cognitive 16) · ×1
  • _FunctionType.== (cognitive 16) sdk/lib/_internal/wasm/common/type.dart:468 — _FunctionType.== has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _StreamController._recordCancel (cognitive 16) · ×1
  • _StreamController._recordCancel (cognitive 16) sdk/lib/async/stream_controller.dart:722 — _StreamController._recordCancel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SplayTreeMap.update (cognitive 16) · ×1
  • SplayTreeMap.update (cognitive 16) sdk/lib/collection/splay_tree.dart:562 — SplayTreeMap.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Base64Decoder._trimPaddingChars (cognitive 16) · ×1
  • _Base64Decoder._trimPaddingChars (cognitive 16) sdk/lib/convert/base64.dart:801 — _Base64Decoder._trimPaddingChars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Uri._Uri (cognitive 16) · ×1
  • _Uri._Uri (cognitive 16) sdk/lib/core/uri.dart:1933 — _Uri._Uri has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UriData.contentAsBytes (cognitive 16) · ×1
  • UriData.contentAsBytes (cognitive 16) sdk/lib/core/uri.dart:4148 — UriData.contentAsBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstToIr.visitTryCatch (cognitive 16) · ×1
  • AstToIr.visitTryCatch (cognitive 16) pkg/cfg/lib/front_end/ast_to_ir.dart:1423 — AstToIr.visitTryCatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ScopeBuilder._visitFunction (cognitive 16) · ×1
  • _ScopeBuilder._visitFunction (cognitive 16) pkg/cfg/lib/front_end/computed_scopes.dart:127 — _ScopeBuilder._visitFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListIterable.join (cognitive 16) · ×1
  • ListIterable.join (cognitive 16) sdk/lib/internal/iterable.dart:155 — ListIterable.join has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiDefinitionTransformer._checkCompoundClass (cognitive 16) · ×1
  • _FfiDefinitionTransformer._checkCompoundClass (cognitive 16) pkg/vm/lib/modular/transformations/ffi/definitions.dart:350 — _FfiDefinitionTransformer._checkCompoundClass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FfiUseSiteTransformer._extendsOrImplementsSealedClass (cognitive 16) · ×1
  • _FfiUseSiteTransformer._extendsOrImplementsSealedClass (cognitive 16) pkg/vm/lib/modular/transformations/ffi/use_sites.dart:2026 — _FfiUseSiteTransformer._extendsOrImplementsSealedClass has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (nesting depth added 3). 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.
D2 · Cognitive Complexity · FormattedMessage.toJson (cognitive 16) · ×1
  • FormattedMessage.toJson (cognitive 16) pkg/_fe_analyzer_shared/lib/src/messages/codes.dart:297 — FormattedMessage.toJson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForCondition.computeNext (cognitive 16) · ×1
  • ForCondition.computeNext (cognitive 16) pkg/_fe_analyzer_shared/lib/src/parser/literal_entry_info_impl.dart:93 — ForCondition.computeNext has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseSuperInitializerExpression (cognitive 16) · ×1
  • Parser.parseSuperInitializerExpression (cognitive 16) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:4930 — Parser.parseSuperInitializerExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parsePrecedenceExpression (cognitive 16) · ×1
  • Parser.parsePrecedenceExpression (cognitive 16) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7064 — Parser.parsePrecedenceExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.parseExpressionStatementOrDeclaration (cognitive 16) · ×1
  • Parser.parseExpressionStatementOrDeclaration (cognitive 16) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:9818 — Parser.parseExpressionStatementOrDeclaration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _StringCanonicalizer.canonicalizeBytes (cognitive 16) · ×1
  • _StringCanonicalizer.canonicalizeBytes (cognitive 16) pkg/_fe_analyzer_shared/lib/src/scanner/string_canonicalizer.dart:194 — _StringCanonicalizer.canonicalizeBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utf8BytesScanner.passIdentifierCharAllowDollar (cognitive 16) · ×1
  • Utf8BytesScanner.passIdentifierCharAllowDollar (cognitive 16) pkg/_fe_analyzer_shared/lib/src/scanner/utf8_bytes_scanner.dart:156 — Utf8BytesScanner.passIdentifierCharAllowDollar has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 2 (4 pts), loops 2 (nesting depth added 2). 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.
D2 · Cognitive Complexity · JsUtilOptimizer._lowerToCallUnchecked (cognitive 16) · ×1
  • JsUtilOptimizer._lowerToCallUnchecked (cognitive 16) pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart:931 — JsUtilOptimizer._lowerToCallUnchecked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticInteropMockValidator._implements (cognitive 16) · ×1
  • StaticInteropMockValidator._implements (cognitive 16) pkg/_js_interop_checks/lib/src/transformations/static_interop_mock_validator.dart:252 — StaticInteropMockValidator._implements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LegacyAnalysisServer.updateContent (cognitive 16) · ×1
  • LegacyAnalysisServer.updateContent (cognitive 16) pkg/analysis_server/lib/src/legacy_analysis_server.dart:1158 — LegacyAnalysisServer.updateContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DartCodeActionsProducer.getAssistActions (cognitive 16) · ×1
  • DartCodeActionsProducer.getAssistActions (cognitive 16) pkg/analysis_server/lib/src/lsp/handlers/code_actions/dart.dart:131 — DartCodeActionsProducer.getAssistActions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationSummaryBuilder._writeStepFixes (cognitive 16) · ×1
  • MigrationSummaryBuilder._writeStepFixes (cognitive 16) pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_summary_builder.dart:130 — MigrationSummaryBuilder._writeStepFixes has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), ternaries 4 (7 pts), if/else 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletionHandler.handle (cognitive 16) · ×1
  • CompletionHandler.handle (cognitive 16) pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart:99 — CompletionHandler.handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PluginWatcher._persistContentTrust (cognitive 16) · ×1
  • PluginWatcher._persistContentTrust (cognitive 16) pkg/analysis_server/lib/src/plugin/plugin_watcher.dart:502 — PluginWatcher._persistContentTrust has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper.addParametersFromSuperConstructor (cognitive 16) · ×1
  • DeclarationHelper.addParametersFromSuperConstructor (cognitive 16) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:625 — DeclarationHelper.addParametersFromSuperConstructor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclarationHelper._suggestTopLevelFunction (cognitive 16) · ×1
  • DeclarationHelper._suggestTopLevelFunction (cognitive 16) pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart:2824 — DeclarationHelper._suggestTopLevelFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitEmptyStatement (cognitive 16) · ×1
  • InScopeCompletionPass.visitEmptyStatement (cognitive 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1075 — InScopeCompletionPass.visitEmptyStatement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass.visitFieldFormalParameter (cognitive 16) · ×1
  • InScopeCompletionPass.visitFieldFormalParameter (cognitive 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:1447 — InScopeCompletionPass.visitFieldFormalParameter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InScopeCompletionPass._suggestRecordLiteralNamedFields (cognitive 16) · ×1
  • InScopeCompletionPass._suggestRecordLiteralNamedFields (cognitive 16) pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart:4498 — InScopeCompletionPass._suggestRecordLiteralNamedFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilePathProducer.suggestions (cognitive 16) · ×1
  • FilePathProducer.suggestions (cognitive 16) pkg/analysis_server/lib/src/services/completion/yaml/producer.dart:56 — FilePathProducer.suggestions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 1 (4 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMissingEnumLikeCaseClauses.compute (cognitive 16) · ×1
  • AddMissingEnumLikeCaseClauses.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:30 — AddMissingEnumLikeCaseClauses.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMissingEnumLikeCaseClauses._caseValues (cognitive 16) · ×1
  • AddMissingEnumLikeCaseClauses._caseValues (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart:91 — AddMissingEnumLikeCaseClauses._caseValues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddSuperConstructorInvocation.producers (cognitive 16) · ×1
  • AddSuperConstructorInvocation.producers (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/add_super_constructor_invocation.dart:19 — AddSuperConstructorInvocation.producers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChangeTo._proposeFunction (cognitive 16) · ×1
  • ChangeTo._proposeFunction (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/change_to.dart:289 — ChangeTo._proposeFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChangeTypeAnnotation.compute (cognitive 16) · ×1
  • ChangeTypeAnnotation.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/change_type_annotation.dart:32 — ChangeTypeAnnotation.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertIntoForIndex.compute (cognitive 16) · ×1
  • ConvertIntoForIndex.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart:26 — ConvertIntoForIndex.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConvertToExpressionFunctionBody.compute (cognitive 16) · ×1
  • ConvertToExpressionFunctionBody.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart:32 — ConvertToExpressionFunctionBody.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConvertToIfNull._useToConvertNullsToBools (cognitive 16) · ×1
  • ConvertToIfNull._useToConvertNullsToBools (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_if_null.dart:106 — ConvertToIfNull._useToConvertNullsToBools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvertToPrimaryConstructor.compute (cognitive 16) · ×1
  • ConvertToPrimaryConstructor.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_primary_constructor.dart:49 — ConvertToPrimaryConstructor.compute has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 7. 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.
D2 · Cognitive Complexity · ConvertToSuperParameters._findConstructor (cognitive 16) · ×1
  • ConvertToSuperParameters._findConstructor (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart:314 — ConvertToSuperParameters._findConstructor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateMethodOrFunction.compute (cognitive 16) · ×1
  • CreateMethodOrFunction.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/create_method_or_function.dart:80 — CreateMethodOrFunction.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImportLibrary._namesForExtensionMember (cognitive 16) · ×1
  • ImportLibrary._namesForExtensionMember (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/import_library.dart:553 — ImportLibrary._namesForExtensionMember has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveComparison.compute (cognitive 16) · ×1
  • RemoveComparison.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart:57 — RemoveComparison.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RemoveTypeAnnotation.compute (cognitive 16) · ×1
  • RemoveTypeAnnotation.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/remove_type_annotation.dart:38 — RemoveTypeAnnotation.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameMethodParameter.compute (cognitive 16) · ×1
  • RenameMethodParameter.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/rename_method_parameter.dart:32 — RenameMethodParameter.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SortChildPropertyLast.compute (cognitive 16) · ×1
  • SortChildPropertyLast.compute (cognitive 16) pkg/analysis_server/lib/src/services/correction/dart/sort_child_property_last.dart:33 — SortChildPropertyLast.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MemberSorter._sortClassMembers (cognitive 16) · ×1
  • MemberSorter._sortClassMembers (cognitive 16) pkg/analysis_server/lib/src/services/correction/sort_members.dart:112 — MemberSorter._sortClassMembers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WidgetDescriptionComputer._addProperties (cognitive 16) · ×1
  • _WidgetDescriptionComputer._addProperties (cognitive 16) pkg/analysis_server/lib/src/services/flutter/widget_descriptions.dart:263 — _WidgetDescriptionComputer._addProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RefactoringProcessor.compute (cognitive 16) · ×1
  • RefactoringProcessor.compute (cognitive 16) pkg/analysis_server/lib/src/services/refactoring/framework/refactoring_processor.dart:67 — RefactoringProcessor.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ExtractMethodAnalyzer.visitSimpleIdentifier (cognitive 16) · ×1
  • _ExtractMethodAnalyzer.visitSimpleIdentifier (cognitive 16) pkg/analysis_server/lib/src/services/refactoring/legacy/extract_method.dart:1164 — _ExtractMethodAnalyzer.visitSimpleIdentifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenameImportRefactoringImpl.buildChange (cognitive 16) · ×1
  • RenameImportRefactoringImpl.buildChange (cognitive 16) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_import.dart:62 — RenameImportRefactoringImpl.buildChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BaseUnitMemberValidator._validateWillShadow (cognitive 16) · ×1
  • _BaseUnitMemberValidator._validateWillShadow (cognitive 16) pkg/analysis_server/lib/src/services/refactoring/legacy/rename_unit_member.dart:254 — _BaseUnitMemberValidator._validateWillShadow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VisibleRangesComputer._patternVariableRange (cognitive 16) · ×1
  • VisibleRangesComputer._patternVariableRange (cognitive 16) pkg/analysis_server/lib/src/services/refactoring/legacy/visible_ranges_computer.dart:143 — VisibleRangesComputer._patternVariableRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), match/switch 2 (5 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SurveyManager.checkForSurveys (cognitive 16) · ×1
  • SurveyManager.checkForSurveys (cognitive 16) pkg/analysis_server/lib/src/services/user_prompts/survey_manager.dart:60 — SurveyManager.checkForSurveys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LibraryCyclesPerformanceComponent._LibraryCyclesPerformanceComponent (cognitive 16) · ×1
  • _LibraryCyclesPerformanceComponent._LibraryCyclesPerformanceComponent (cognitive 16) pkg/analysis_server/lib/src/status/pages/performance_page.dart:165 — _LibraryCyclesPerformanceComponent._LibraryCyclesPerformanceComponent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NodeModulesPerformanceComponent._findNodeModules (cognitive 16) · ×1
  • _NodeModulesPerformanceComponent._findNodeModules (cognitive 16) pkg/analysis_server/lib/src/status/pages/performance_page.dart:373 — _NodeModulesPerformanceComponent._findNodeModules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatusPage.generateContent (cognitive 16) · ×1
  • StatusPage.generateContent (cognitive 16) pkg/analysis_server/lib/src/status/pages/status_page.dart:24 — StatusPage.generateContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimingPage._generateDetails (cognitive 16) · ×1
  • TimingPage._generateDetails (cognitive 16) pkg/analysis_server/lib/src/status/pages/timing_page.dart:98 — TimingPage._generateDetails has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AstWriter._getName (cognitive 16) · ×1
  • AstWriter._getName (cognitive 16) pkg/analysis_server/lib/src/status/utilities/ast_writer.dart:138 — AstWriter._getName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PluginServer._canUseParsedResult (cognitive 16) · ×1
  • PluginServer._canUseParsedResult (cognitive 16) pkg/analysis_server_plugin/lib/src/plugin_server.dart:513 — PluginServer._canUseParsedResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ParsedErrorProcessorsData.parse (cognitive 16) · ×1
  • _ParsedErrorProcessorsData.parse (cognitive 16) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:550 — _ParsedErrorProcessorsData.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ContextLocator._loadWorkspaceDetailsFromPubspec (cognitive 16) · ×1
  • _ContextLocator._loadWorkspaceDetailsFromPubspec (cognitive 16) pkg/analyzer/lib/src/dart/analysis/context_locator.dart:699 — _ContextLocator._loadWorkspaceDetailsFromPubspec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnalysisDriver.dispose2 (cognitive 16) · ×1
  • AnalysisDriver.dispose2 (cognitive 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:757 — AnalysisDriver.dispose2 has cognitive complexity 16 (threshold 15). Drivers by points: loops 11 (16 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AnalysisDriver.getLibraryByUri (cognitive 16) · ×1
  • AnalysisDriver.getLibraryByUri (cognitive 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:919 — AnalysisDriver.getLibraryByUri has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DiscoverAvailableFilesJob._discoverChildren (cognitive 16) · ×1
  • _DiscoverAvailableFilesJob._discoverChildren (cognitive 16) pkg/analyzer/lib/src/dart/analysis/driver.dart:3182 — _DiscoverAvailableFilesJob._discoverChildren has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvictingFileByteStore._cleanUpFolder (cognitive 16) · ×1
  • EvictingFileByteStore._cleanUpFolder (cognitive 16) pkg/analyzer/lib/src/dart/analysis/file_byte_store.dart:154 — EvictingFileByteStore._cleanUpFolder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 3 (6 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileKind.collectTransitive (cognitive 16) · ×1
  • FileKind.collectTransitive (cognitive 16) pkg/analyzer/lib/src/dart/analysis/file_state.dart:346 — FileKind.collectTransitive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryAnalyzer._resolveDocImports (cognitive 16) · ×1
  • LibraryAnalyzer._resolveDocImports (cognitive 16) pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart:801 — LibraryAnalyzer._resolveDocImports has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstNodeImpl._containsOffset (cognitive 16) · ×1
  • AstNodeImpl._containsOffset (cognitive 16) pkg/analyzer/lib/src/dart/ast/ast.dart:3401 — AstNodeImpl._containsOffset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChildEntities.syntacticEntities (cognitive 16) · ×1
  • ChildEntities.syntacticEntities (cognitive 16) pkg/analyzer/lib/src/dart/ast/ast.dart:7609 — ChildEntities.syntacticEntities has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstantVerifier.visitConstantPattern (cognitive 16) · ×1
  • ConstantVerifier.visitConstantPattern (cognitive 16) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:130 — ConstantVerifier.visitConstantPattern has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (16 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantVerifier._validateSwitchStatement_nullSafety (cognitive 16) · ×1
  • ConstantVerifier._validateSwitchStatement_nullSafety (cognitive 16) pkg/analyzer/lib/src/dart/constant/constant_verifier.dart:1221 — ConstantVerifier._validateSwitchStatement_nullSafety has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionState.isIdentical (cognitive 16) · ×1
  • FunctionState.isIdentical (cognitive 16) pkg/analyzer/lib/src/dart/constant/value.dart:1450 — FunctionState.isIdentical has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementDisplayStringBuilder._writeFormalParameters (cognitive 16) · ×1
  • ElementDisplayStringBuilder._writeFormalParameters (cognitive 16) pkg/analyzer/lib/src/dart/element/display_string_builder.dart:404 — ElementDisplayStringBuilder._writeFormalParameters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TypeParameterElementImpl.computeVarianceInType (cognitive 16) · ×1
  • TypeParameterElementImpl.computeVarianceInType (cognitive 16) pkg/analyzer/lib/src/dart/element/element.dart:11698 — TypeParameterElementImpl.computeVarianceInType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeastUpperBoundHelper._futureOr (cognitive 16) · ×1
  • LeastUpperBoundHelper._futureOr (cognitive 16) pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:796 — LeastUpperBoundHelper._futureOr has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ElementNameUnion.contains (cognitive 16) · ×1
  • ElementNameUnion.contains (cognitive 16) pkg/analyzer/lib/src/dart/element/name_union.dart:54 — ElementNameUnion.contains has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubtypeHelper._interfaceArguments (cognitive 16) · ×1
  • SubtypeHelper._interfaceArguments (cognitive 16) pkg/analyzer/lib/src/dart/element/subtype.dart:44 — SubtypeHelper._interfaceArguments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementOrDecrementResolver._resolveResult (cognitive 16) · ×1
  • IncrementOrDecrementResolver._resolveResult (cognitive 16) pkg/analyzer/lib/src/dart/resolver/increment_or_decrement_resolver.dart:225 — IncrementOrDecrementResolver._resolveResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PropertyElementResolver.resolveCascadeProperty (cognitive 16) · ×1
  • PropertyElementResolver.resolveCascadeProperty (cognitive 16) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:189 — PropertyElementResolver.resolveCascadeProperty has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeAnalyzer._buildCalledConstructorTypeReference (cognitive 16) · ×1
  • ScopeAnalyzer._buildCalledConstructorTypeReference (cognitive 16) pkg/analyzer/lib/src/dart/resolver/scope_analyzer.dart:1093 — ScopeAnalyzer._buildCalledConstructorTypeReference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _WhyNotPromotedVisitor.visitPropertyNotPromotedForNonInherentReason (cognitive 16) · ×1
  • _WhyNotPromotedVisitor.visitPropertyNotPromotedForNonInherentReason (cognitive 16) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:6142 — _WhyNotPromotedVisitor.visitPropertyNotPromotedForNonInherentReason has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 5 (7 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TypedLiteralResolver._computeSetOrMapResolution (cognitive 16) · ×1
  • TypedLiteralResolver._computeSetOrMapResolution (cognitive 16) pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart:249 — TypedLiteralResolver._computeSetOrMapResolution has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnnotationVerifier._findUndefinedUseResultParameter (cognitive 16) · ×1
  • AnnotationVerifier._findUndefinedUseResultParameter (cognitive 16) pkg/analyzer/lib/src/error/annotation_verifier.dart:688 — AnnotationVerifier._findUndefinedUseResultParameter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BestPracticesVerifier._checkForUnnecessaryNoSuchMethod (cognitive 16) · ×1
  • BestPracticesVerifier._checkForUnnecessaryNoSuchMethod (cognitive 16) pkg/analyzer/lib/src/error/best_practices_verifier.dart:1432 — BestPracticesVerifier._checkForUnnecessaryNoSuchMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadPosition.of (cognitive 16) · ×1
  • ReadPosition.of (cognitive 16) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:591 — ReadPosition.of has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3, match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MustCallSuperVerifier.checkMethodDeclaration (cognitive 16) · ×1
  • MustCallSuperVerifier.checkMethodDeclaration (cognitive 16) pkg/analyzer/lib/src/error/must_call_super_verifier.dart:19 — MustCallSuperVerifier.checkMethodDeclaration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeArgumentsVerifier._checkInvocationTypeArguments (cognitive 16) · ×1
  • TypeArgumentsVerifier._checkInvocationTypeArguments (cognitive 16) pkg/analyzer/lib/src/error/type_arguments_verifier.dart:538 — TypeArgumentsVerifier._checkInvocationTypeArguments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.buildInitializerTargetExpressionRecovery (cognitive 16) · ×1
  • AstBuilder.buildInitializerTargetExpressionRecovery (cognitive 16) pkg/analyzer/lib/src/fasta/ast_builder.dart:758 — AstBuilder.buildInitializerTargetExpressionRecovery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 1 (3 pts), loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryManifestBuilder._computeHashForRequirements (cognitive 16) · ×1
  • LibraryManifestBuilder._computeHashForRequirements (cognitive 16) pkg/analyzer/lib/src/fine/library_manifest.dart:1144 — LibraryManifestBuilder._computeHashForRequirements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManifestNode.match (cognitive 16) · ×1
  • ManifestNode.match (cognitive 16) pkg/analyzer/lib/src/fine/manifest_ast.dart:137 — ManifestNode.match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequirementsManifest._recordPrefixScopeLookups (cognitive 16) · ×1
  • RequirementsManifest._recordPrefixScopeLookups (cognitive 16) pkg/analyzer/lib/src/fine/requirements.dart:2845 — RequirementsManifest._recordPrefixScopeLookups has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 2 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ErrorVerifier.visitSuperFormalParameter (cognitive 16) · ×1
  • ErrorVerifier.visitSuperFormalParameter (cognitive 16) pkg/analyzer/lib/src/generated/error_verifier.dart:2142 — ErrorVerifier.visitSuperFormalParameter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorVerifier._checkForConstConstructorWithNonConstSuper (cognitive 16) · ×1
  • ErrorVerifier._checkForConstConstructorWithNonConstSuper (cognitive 16) pkg/analyzer/lib/src/generated/error_verifier.dart:4407 — ErrorVerifier._checkForConstConstructorWithNonConstSuper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ErrorVerifier._checkForFunctionBodyCompleteness (cognitive 16) · ×1
  • ErrorVerifier._checkForFunctionBodyCompleteness (cognitive 16) pkg/analyzer/lib/src/generated/error_verifier.dart:5704 — ErrorVerifier._checkForFunctionBodyCompleteness has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _MixinInference._inferSingle (cognitive 16) · ×1
  • _MixinInference._inferSingle (cognitive 16) pkg/analyzer/lib/src/summary2/types_builder.dart:588 — _MixinInference._inferSingle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _OpTypeAstVisitor.visitFieldDeclaration (cognitive 16) · ×1
  • _OpTypeAstVisitor.visitFieldDeclaration (cognitive 16) pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart:777 — _OpTypeAstVisitor.visitFieldDeclaration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Compiler.computeTimings (cognitive 16) · ×1
  • Compiler.computeTimings (cognitive 16) pkg/compiler/lib/src/compiler.dart:1103 — Compiler.computeTimings has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (9 pts), loops 3 (5 pts), if/else 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DartTypeToStringVisitor.run (cognitive 16) · ×1
  • _DartTypeToStringVisitor.run (cognitive 16) pkg/compiler/lib/src/elements/types.dart:1527 — _DartTypeToStringVisitor.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTypeGraphBuilder.visitConstructor (cognitive 16) · ×1
  • KernelTypeGraphBuilder.visitConstructor (cognitive 16) pkg/compiler/lib/src/inferrer/builder.dart:311 — KernelTypeGraphBuilder.visitConstructor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelTypeGraphBuilder.visitSwitchStatement (cognitive 16) · ×1
  • KernelTypeGraphBuilder.visitSwitchStatement (cognitive 16) pkg/compiler/lib/src/inferrer/builder.dart:615 — KernelTypeGraphBuilder.visitSwitchStatement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferrerEngine._addOverrideTypeInputs (cognitive 16) · ×1
  • InferrerEngine._addOverrideTypeInputs (cognitive 16) pkg/compiler/lib/src/inferrer/engine.dart:1104 — InferrerEngine._addOverrideTypeInputs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelGlobalTypeInferenceElementData.compress (cognitive 16) · ×1
  • KernelGlobalTypeInferenceElementData.compress (cognitive 16) pkg/compiler/lib/src/inferrer/engine.dart:1903 — KernelGlobalTypeInferenceElementData.compress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordTypeMask.containsMask (cognitive 16) · ×1
  • RecordTypeMask.containsMask (cognitive 16) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:252 — RecordTypeMask.containsMask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeModelBuilder.computeModel (cognitive 16) · ×1
  • ScopeModelBuilder.computeModel (cognitive 16) pkg/compiler/lib/src/ir/scope_visitor.dart:86 — ScopeModelBuilder.computeModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ScopeModelBuilder.attachCapturedScopeVariables (cognitive 16) · ×1
  • ScopeModelBuilder.attachCapturedScopeVariables (cognitive 16) pkg/compiler/lib/src/ir/scope_visitor.dart:187 — ScopeModelBuilder.attachCapturedScopeVariables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstantiationStubGenerator.generateStubs (cognitive 16) · ×1
  • InstantiationStubGenerator.generateStubs (cognitive 16) pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart:149 — InstantiationStubGenerator.generateStubs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FieldVisitor.visitFields (cognitive 16) · ×1
  • FieldVisitor.visitFields (cognitive 16) pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart:36 — FieldVisitor.visitFields has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts) (nesting depth added 1). 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.
D2 · Cognitive Complexity · ProgramBuilder._buildFields (cognitive 16) · ×1
  • ProgramBuilder._buildFields (cognitive 16) pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart:1177 — ProgramBuilder._buildFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeTypeGenerator.generateIsTests (cognitive 16) · ×1
  • RuntimeTypeGenerator.generateIsTests (cognitive 16) pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart:109 — RuntimeTypeGenerator.generateIsTests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsKernelToElementMap.getFunctionType (cognitive 16) · ×1
  • JsKernelToElementMap.getFunctionType (cognitive 16) pkg/compiler/lib/src/js_model/element_map_impl.dart:861 — JsKernelToElementMap.getFunctionType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · JsKernelToElementMap._computeClosureName (cognitive 16) · ×1
  • JsKernelToElementMap._computeClosureName (cognitive 16) pkg/compiler/lib/src/js_model/element_map_impl.dart:2142 — JsKernelToElementMap._computeClosureName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JClosedWorld.needsNoSuchMethod (cognitive 16) · ×1
  • JClosedWorld.needsNoSuchMethod (cognitive 16) pkg/compiler/lib/src/js_model/js_world.dart:369 — JClosedWorld.needsNoSuchMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelToElementMap.getFunctionType (cognitive 16) · ×1
  • KernelToElementMap.getFunctionType (cognitive 16) pkg/compiler/lib/src/kernel/element_map_impl.dart:559 — KernelToElementMap.getFunctionType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelToElementMap.getLocalFunction (cognitive 16) · ×1
  • KernelToElementMap.getLocalFunction (cognitive 16) pkg/compiler/lib/src/kernel/element_map_impl.dart:1607 — KernelToElementMap.getLocalFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._buildInitializers (cognitive 16) · ×1
  • KernelSsaGraphBuilder._buildInitializers (cognitive 16) pkg/compiler/lib/src/ssa/builder.dart:1151 — KernelSsaGraphBuilder._buildInitializers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._buildExternalNativeFunctionNode (cognitive 16) · ×1
  • KernelSsaGraphBuilder._buildExternalNativeFunctionNode (cognitive 16) pkg/compiler/lib/src/ssa/builder.dart:2107 — KernelSsaGraphBuilder._buildExternalNativeFunctionNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KernelSsaGraphBuilder._handleSwitch (cognitive 16) · ×1
  • KernelSsaGraphBuilder._handleSwitch (cognitive 16) pkg/compiler/lib/src/ssa/builder.dart:3829 — KernelSsaGraphBuilder._handleSwitch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SsaValueRangeAnalyzer.visitBoundsCheck (cognitive 16) · ×1
  • SsaValueRangeAnalyzer.visitBoundsCheck (cognitive 16) pkg/compiler/lib/src/ssa/value_range_analyzer.dart:908 — SsaValueRangeAnalyzer.visitBoundsCheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MemberUsage.MemberUsage (cognitive 16) · ×1
  • MemberUsage.MemberUsage (cognitive 16) pkg/compiler/lib/src/universe/member_usage.dart:49 — MemberUsage.MemberUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MemberUsage.dataEquals (cognitive 16) · ×1
  • MemberUsage.dataEquals (cognitive 16) pkg/compiler/lib/src/universe/member_usage.dart:251 — MemberUsage.dataEquals has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. 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.
D2 · Cognitive Complexity · IsolateManager._resume (cognitive 16) · ×1
  • IsolateManager._resume (cognitive 16) pkg/dap_adapters/lib/src/isolate_manager.dart:327 — IsolateManager._resume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InstallCommand._installExecutablesOnPath (cognitive 16) · ×1
  • InstallCommand._installExecutablesOnPath (cognitive 16) pkg/dartdev/lib/src/commands/install.dart:616 — InstallCommand._installExecutablesOnPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.ifOut (cognitive 16) · ×1
  • Printer.ifOut (cognitive 16) pkg/dev_compiler/lib/src/js_ast/printer.dart:342 — Printer.ifOut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Printer.nameSpecifierOut (cognitive 16) · ×1
  • Printer.nameSpecifierOut (cognitive 16) pkg/dev_compiler/lib/src/js_ast/printer.dart:1577 — Printer.nameSpecifierOut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (8 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SourceMapPrintingContext.exitNode (cognitive 16) · ×1
  • SourceMapPrintingContext.exitNode (cognitive 16) pkg/dev_compiler/lib/src/js_ast/source_map_printer.dart:109 — SourceMapPrintingContext.exitNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgramCompiler._emitArgumentGroups (cognitive 16) · ×1
  • ProgramCompiler._emitArgumentGroups (cognitive 16) pkg/dev_compiler/lib/src/kernel/compiler.dart:7162 — ProgramCompiler._emitArgumentGroups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3, ternaries 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._initializeFields (cognitive 16) · ×1
  • LibraryCompiler._initializeFields (cognitive 16) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:2686 — LibraryCompiler._initializeFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._rewriteInvocationWithHotReloadChecks (cognitive 16) · ×1
  • LibraryCompiler._rewriteInvocationWithHotReloadChecks (cognitive 16) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7784 — LibraryCompiler._rewriteInvocationWithHotReloadChecks has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (7 pts), if/else 4 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibraryCompiler._emitArgumentGroups (cognitive 16) · ×1
  • LibraryCompiler._emitArgumentGroups (cognitive 16) pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8029 — LibraryCompiler._emitArgumentGroups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3, ternaries 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DevCompilerConstants.getFieldValueFromAnnotation (cognitive 16) · ×1
  • DevCompilerConstants.getFieldValueFromAnnotation (cognitive 16) pkg/dev_compiler/lib/src/kernel/constants.dart:27 — DevCompilerConstants.getFieldValueFromAnnotation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DTDClient._streamListen (cognitive 16) · ×1
  • DTDClient._streamListen (cognitive 16) pkg/dtd_impl/lib/src/dtd_client.dart:96 — DTDClient._streamListen has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (4 pts), error handling 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · MetadataProvider._processMetadata (cognitive 16) · ×1
  • MetadataProvider._processMetadata (cognitive 16) pkg/dwds/lib/src/debugging/metadata/provider.dart:164 — MetadataProvider._processMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 1 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComputedMutableNameSpaceImpl.addLocalMember (cognitive 16) · ×1
  • ComputedMutableNameSpaceImpl.addLocalMember (cognitive 16) pkg/front_end/lib/src/base/name_space.dart:55 — ComputedMutableNameSpaceImpl.addLocalMember has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionTypeBuilderImpl.buildAliased (cognitive 16) · ×1
  • FunctionTypeBuilderImpl.buildAliased (cognitive 16) pkg/front_end/lib/src/builder/function_type_builder.dart:115 — FunctionTypeBuilderImpl.buildAliased has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeAliasBuilderImpl.unaliasTypeArguments (cognitive 16) · ×1
  • TypeAliasBuilderImpl.unaliasTypeArguments (cognitive 16) pkg/front_end/lib/src/builder/type_alias_builder.dart:534 — TypeAliasBuilderImpl.unaliasTypeArguments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl.endMetadata (cognitive 16) · ×1
  • BodyBuilderImpl.endMetadata (cognitive 16) pkg/front_end/lib/src/kernel/body_builder.dart:4830 — BodyBuilderImpl.endMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl._buildForLoopVariableDeclarations (cognitive 16) · ×1
  • BodyBuilderImpl._buildForLoopVariableDeclarations (cognitive 16) pkg/front_end/lib/src/kernel/body_builder.dart:10997 — BodyBuilderImpl._buildForLoopVariableDeclarations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BodyBuilderImpl._computeForInElement (cognitive 16) · ×1
  • BodyBuilderImpl._computeForInElement (cognitive 16) pkg/front_end/lib/src/kernel/body_builder.dart:11078 — BodyBuilderImpl._computeForInElement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyBuilderImpl._prepareInitializers (cognitive 16) · ×1
  • BodyBuilderImpl._prepareInitializers (cognitive 16) pkg/front_end/lib/src/kernel/body_builder.dart:11349 — BodyBuilderImpl._prepareInitializers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConstantEvaluator.visitInstanceCreation (cognitive 16) · ×1
  • ConstantEvaluator.visitInstanceCreation (cognitive 16) pkg/front_end/lib/src/kernel/constant_evaluator.dart:3689 — ConstantEvaluator.visitInstanceCreation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelayedAssignment.handleAssignment (cognitive 16) · ×1
  • DelayedAssignment.handleAssignment (cognitive 16) pkg/front_end/lib/src/kernel/expression_generator.dart:6074 — DelayedAssignment.handleAssignment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InternalSwitchStatementCase.toTextInternal (cognitive 16) · ×1
  • InternalSwitchStatementCase.toTextInternal (cognitive 16) pkg/front_end/lib/src/kernel/internal_ast.dart:193 — InternalSwitchStatementCase.toTextInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InternalPatternSwitchCase.toTextInternal) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · InternalPatternSwitchCase.toTextInternal (cognitive 16) · ×1
  • InternalPatternSwitchCase.toTextInternal (cognitive 16) pkg/front_end/lib/src/kernel/internal_ast.dart:7480 — InternalPatternSwitchCase.toTextInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InternalSwitchStatementCase.toTextInternal) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · KernelTarget._makeMixinApplicationConstructor (cognitive 16) · ×1
  • KernelTarget._makeMixinApplicationConstructor (cognitive 16) pkg/front_end/lib/src/kernel/kernel_target.dart:1033 — KernelTarget._makeMixinApplicationConstructor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NominalParameterNameSpace.addTypeParameters (cognitive 16) · ×1
  • NominalParameterNameSpace.addTypeParameters (cognitive 16) pkg/front_end/lib/src/source/nominal_parameter_name_space.dart:16 — NominalParameterNameSpace.addTypeParameters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutlineBuilder.beginClassDeclaration (cognitive 16) · ×1
  • OutlineBuilder.beginClassDeclaration (cognitive 16) pkg/front_end/lib/src/source/outline_builder.dart:1089 — OutlineBuilder.beginClassDeclaration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferredMapOrSetElementInferenceContext.inferElementType (cognitive 16) · ×1
  • InferredMapOrSetElementInferenceContext.inferElementType (cognitive 16) pkg/front_end/lib/src/type_inference/element_inference.dart:529 — InferredMapOrSetElementInferenceContext.inferElementType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitIndexSet (cognitive 16) · ×1
  • InferenceVisitorImpl.visitIndexSet (cognitive 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6349 — InferenceVisitorImpl.visitIndexSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitExtensionIfNullIndexSet (cognitive 16) · ×1
  • InferenceVisitorImpl.visitExtensionIfNullIndexSet (cognitive 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7283 — InferenceVisitorImpl.visitExtensionIfNullIndexSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InferenceVisitorImpl.dispatchPatternSchema (cognitive 16) · ×1
  • InferenceVisitorImpl.dispatchPatternSchema (cognitive 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:11405 — InferenceVisitorImpl.dispatchPatternSchema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 1 (3 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitObjectPattern (cognitive 16) · ×1
  • InferenceVisitorImpl.visitObjectPattern (cognitive 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:12695 — InferenceVisitorImpl.visitObjectPattern has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InferenceVisitorImpl.visitMapPattern (cognitive 16) · ×1
  • InferenceVisitorImpl.visitMapPattern (cognitive 16) pkg/front_end/lib/src/type_inference/inference_visitor.dart:13093 — InferenceVisitorImpl.visitMapPattern has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionAccessCandidate.isMoreSpecificThan (cognitive 16) · ×1
  • ExtensionAccessCandidate.isMoreSpecificThan (cognitive 16) pkg/front_end/lib/src/type_inference/object_access_target.dart:1460 — ExtensionAccessCandidate.isMoreSpecificThan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementalJavaScriptBundler.invalidate (cognitive 16) · ×1
  • IncrementalJavaScriptBundler.invalidate (cognitive 16) pkg/frontend_server/lib/src/javascript_bundle.dart:107 — IncrementalJavaScriptBundler.invalidate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResidentFrontendServer._getResidentCompilerForEntrypoint (cognitive 16) · ×1
  • ResidentFrontendServer._getResidentCompilerForEntrypoint (cognitive 16) pkg/frontend_server/lib/src/resident_frontend_server.dart:314 — ResidentFrontendServer._getResidentCompilerForEntrypoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Printer.visitObjectInitializer (cognitive 16) · ×1
  • Printer.visitObjectInitializer (cognitive 16) pkg/js_ast/lib/src/printer.dart:1599 — Printer.visitObjectInitializer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringToSource.writeString (cognitive 16) · ×1
  • StringToSource.writeString (cognitive 16) pkg/js_ast/lib/src/strings.dart:75 — StringToSource.writeString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypedefTearOffConstant.== (cognitive 16) · ×1
  • TypedefTearOffConstant.== (cognitive 16) pkg/kernel/lib/src/ast/constants.dart:1216 — TypedefTearOffConstant.== has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionList.ExpressionList (cognitive 16) · ×1
  • ExpressionList.ExpressionList (cognitive 16) pkg/kernel/lib/src/ast/expressions.dart:16 — ExpressionList.ExpressionList has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. 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.
D2 · Cognitive Complexity · Types.areTypeArgumentsOfSubtypeKernel (cognitive 16) · ×1
  • Types.areTypeArgumentsOfSubtypeKernel (cognitive 16) pkg/kernel/lib/src/types.dart:1214 — Types.areTypeArgumentsOfSubtypeKernel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitRegularFormalParameter (cognitive 16) · ×1
  • _Visitor.visitRegularFormalParameter (cognitive 16) pkg/linter/lib/src/rules/always_specify_types.dart:134 — _Visitor.visitRegularFormalParameter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitComment (cognitive 16) · ×1
  • _Visitor.visitComment (cognitive 16) pkg/linter/lib/src/rules/comment_references.dart:41 — _Visitor.visitComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.visitConditionalExpression (cognitive 16) · ×1
  • _Visitor.visitConditionalExpression (cognitive 16) pkg/linter/lib/src/rules/prefer_null_aware_operators.dart:36 — _Visitor.visitConditionalExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DependOnReferencedPackages.registerNodeProcessors (cognitive 16) · ×1
  • DependOnReferencedPackages.registerNodeProcessors (cognitive 16) pkg/linter/lib/src/rules/pub/depend_on_referenced_packages.dart:26 — DependOnReferencedPackages.registerNodeProcessors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.checkMethods (cognitive 16) · ×1
  • _Visitor.checkMethods (cognitive 16) pkg/linter/lib/src/rules/public_member_api_docs.dart:74 — _Visitor.checkMethods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Visitor.parametersMatch (cognitive 16) · ×1
  • _Visitor.parametersMatch (cognitive 16) pkg/linter/lib/src/rules/unnecessary_lambdas.dart:107 — _Visitor.parametersMatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerLocation._parseScriptLine (cognitive 16) · ×1
  • DebuggerLocation._parseScriptLine (cognitive 16) pkg/observatory/lib/src/debugger/debugger_location.dart:77 — DebuggerLocation._parseScriptLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AllocationProfileElement.render (cognitive 16) · ×1
  • AllocationProfileElement.render (cognitive 16) pkg/observatory/lib/src/elements/allocation_profile.dart:104 — AllocationProfileElement.render has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerFrameElement.render (cognitive 16) · ×1
  • DebuggerFrameElement.render (cognitive 16) pkg/observatory/lib/src/elements/debugger.dart:2572 — DebuggerFrameElement.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SampleProfileLoadingProgress._run (cognitive 16) · ×1
  • SampleProfileLoadingProgress._run (cognitive 16) pkg/observatory/lib/src/repositories/sample_profile.dart:47 — SampleProfileLoadingProgress._run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SampleProfile.buildFunctionTrie (cognitive 16) · ×1
  • SampleProfile.buildFunctionTrie (cognitive 16) pkg/observatory/lib/src/sample_profile/sample_profile.dart:1233 — SampleProfile.buildFunctionTrie has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SampleProfile.buildCodeTrie) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SampleProfile.buildCodeTrie (cognitive 16) · ×1
  • SampleProfile.buildCodeTrie (cognitive 16) pkg/observatory/lib/src/sample_profile/sample_profile.dart:1288 — SampleProfile.buildCodeTrie has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SampleProfile.buildFunctionTrie) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _TokenIterator.moveNextPattern (cognitive 16) · ×1
  • _TokenIterator.moveNextPattern (cognitive 16) runtime/tools/heapsnapshot/lib/src/expression.dart:481 — _TokenIterator.moveNextPattern has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlowGraph._collectInstructions (cognitive 16) · ×1
  • FlowGraph._collectInstructions (cognitive 16) pkg/vm/lib/testing/il_matchers.dart:42 — FlowGraph._collectInstructions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PrettyPrinter._formatBlock (cognitive 16) · ×1
  • PrettyPrinter._formatBlock (cognitive 16) pkg/vm/lib/testing/il_matchers.dart:257 — PrettyPrinter._formatBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DispatchableInvocation._collectTargetsForConcreteType (cognitive 16) · ×1
  • _DispatchableInvocation._collectTargetsForConcreteType (cognitive 16) pkg/vm/lib/transformations/type_flow/analysis.dart:736 — _DispatchableInvocation._collectTargetsForConcreteType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DispatchableInvocation._collectTargetsForDynamicallyExtendableType (cognitive 16) · ×1
  • _DispatchableInvocation._collectTargetsForDynamicallyExtendableType (cognitive 16) pkg/vm/lib/transformations/type_flow/analysis.dart:836 — _DispatchableInvocation._collectTargetsForDynamicallyExtendableType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConeType.intersection (cognitive 16) · ×1
  • ConeType.intersection (cognitive 16) pkg/vm/lib/transformations/type_flow/types.dart:998 — ConeType.intersection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PRESUBMIT.CheckNodeTextExpectationsCollectorUpdatingIsDisabled (cognitive 16) · ×1
  • PRESUBMIT.CheckNodeTextExpectationsCollectorUpdatingIsDisabled (cognitive 16) pkg/analyzer/PRESUBMIT.py:83 — PRESUBMIT.CheckNodeTextExpectationsCollectorUpdatingIsDisabled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Near-duplicate member family (6 members, 47 shared lines) · ×1
  • Near-duplicate member family (6 members, 47 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1382 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1382-1461 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1463-1539 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1727-1921 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1923-2011 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2013-2121 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2315-2478 — These 6 members are variants of one another: a block of 47 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 22 shared lines) · ×1
  • Near-duplicate member family (4 members, 22 shared lines) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:533 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:533-599 | sdk/lib/_internal/js_runtime/lib/js_number.dart:624-689 | sdk/lib/_internal/vm/lib/integers.dart:444-511 | sdk/lib/_internal/wasm/common/boxed_int.dart:338-405 — These 4 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 153 shared lines) · ×1
  • Near-duplicate member family (3 members, 153 shared lines) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1504-1757 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1523-1775 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2112-2359 — These 3 members are variants of one another: a block of 153 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 131 shared lines) · ×1
  • Near-duplicate member family (3 members, 131 shared lines) sdk/lib/_internal/vm/lib/convert_patch.dart:1303 — sdk/lib/_internal/vm/lib/convert_patch.dart:1303-1459 | sdk/lib/_internal/wasm/common/convert_patch.dart:1489-1645 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1181-1337 — These 3 members are variants of one another: a block of 131 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 66 shared lines) · ×1
  • Near-duplicate member family (3 members, 66 shared lines) pkg/front_end/lib/src/dill/dill_class_builder.dart:40 — pkg/front_end/lib/src/dill/dill_class_builder.dart:40-226 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:35-204 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:39-367 — These 3 members are variants of one another: a block of 66 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 18 shared lines) · ×1
  • Near-duplicate member family (3 members, 18 shared lines) pkg/wasm_builder/lib/src/serialize/sections.dart:1184 — pkg/wasm_builder/lib/src/serialize/sections.dart:1184-1205 | pkg/wasm_builder/lib/src/serialize/sections.dart:1236-1264 | pkg/wasm_builder/lib/src/serialize/sections.dart:1292-1313 — These 3 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (318 shared lines) · ×1
  • Near-duplicate member pair (318 shared lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:6706 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6706-7038 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7395-7748 — These two members are variants of one another: 318 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (131 shared lines) · ×1
  • Near-duplicate member pair (131 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7088 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7088-7281 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7283-7553 — These two members are variants of one another: 131 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (127 shared lines) · ×1
  • Near-duplicate member pair (127 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462-8711 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8902-9174 — These two members are variants of one another: 127 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (99 shared lines) · ×1
  • Near-duplicate member pair (99 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8462-8711 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8713-8900 — These two members are variants of one another: 99 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (96 shared lines) · ×1
  • Near-duplicate member pair (96 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8713 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8713-8900 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8902-9174 — These two members are variants of one another: 96 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6685 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6685-6838 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8902-9174 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6349 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6349-6480 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6482-6589 — These two members are variants of one another: 61 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (51 shared lines) · ×1
  • Near-duplicate member pair (51 shared lines) pkg/dev_compiler/lib/src/js_ast/builder.dart:1421 — pkg/dev_compiler/lib/src/js_ast/builder.dart:1421-1502 | pkg/js_ast/lib/src/builder.dart:1236-1309 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1670 — pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1670-1803 | pkg/native_compiler/lib/back_end/arm64/code_generator.dart:1805-1920 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2541 — pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2541-2584 | pkg/analysis_server/tool/code_completion/relevance_table_generator.dart:2617-2660 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (26 shared lines) · ×1
  • Near-duplicate member pair (26 shared lines) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1060 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1060-1093 | sdk/lib/_internal/wasm/common/compact_hash.dart:980-1013 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) sdk/lib/internal/internal.dart:215 — sdk/lib/internal/internal.dart:215-223 | sdk/lib/internal/internal.dart:225-234 | sdk/lib/internal/internal.dart:236-255 | sdk/lib/internal/internal.dart:257-278 | sdk/lib/internal/internal.dart:280-303 | sdk/lib/internal/internal.dart:305-330 | sdk/lib/internal/internal.dart:332-359 | sdk/lib/internal/internal.dart:361-390 | sdk/lib/internal/internal.dart:392-423 | sdk/lib/internal/internal.dart:425-458 | sdk/lib/internal/internal.dart:460-495 | sdk/lib/internal/internal.dart:497-534 | sdk/lib/internal/internal.dart:536-575 | sdk/lib/internal/internal.dart:577-618 | sdk/lib/internal/internal.dart:620-663 | sdk/lib/internal/internal.dart:665-710 — These 16 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 16 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 16 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:157 — pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:157-176 | pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:178-197 | pkg/observatory/lib/src/elements/heap_snapshot.dart:968-993 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1049-1065 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1067-1092 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1108-1129 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1131-1146 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1148-1172 | pkg/observatory/lib/src/elements/process_snapshot.dart:454-470 | pkg/observatory/lib/src/elements/process_snapshot.dart:472-497 — These 10 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 10 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 10 times.
D4 · Code Duplication · Edited copy of a member (121 corresponding lines) · ×1
  • Edited copy of a member (121 corresponding lines) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:116 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:116-248 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:438-558 — These two members are one piece of code written twice and then edited apart: 121 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (174 corresponding lines) · ×1
  • Edited copy of a member (174 corresponding lines) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1091-1276 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:429-602 — These two members are one piece of code written twice and then edited apart: 174 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (136 corresponding lines) · ×1
  • Edited copy of a member (136 corresponding lines) pkg/dart_runtime_service_dds/lib/devtools_server.dart:547 — pkg/dart_runtime_service_dds/lib/devtools_server.dart:547-690 | pkg/dds/lib/devtools_server.dart:510-645 — These two members are one piece of code written twice and then edited apart: 136 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (100 corresponding lines) · ×1
  • Edited copy of a member (100 corresponding lines) pkg/front_end/parser_testcases/patterns/const_patterns.dart:18 — pkg/front_end/parser_testcases/patterns/const_patterns.dart:18-117 | pkg/front_end/testcases/patterns/const_patterns.dart:18-123 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (137 corresponding lines) · ×1
  • Edited copy of a member (137 corresponding lines) pkg/dev_compiler/lib/src/kernel/compiler.dart:1170 — pkg/dev_compiler/lib/src/kernel/compiler.dart:1170-1311 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:1463-1599 — These two members are one piece of code written twice and then edited apart: 137 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (145 corresponding lines) · ×1
  • Edited copy of a member (145 corresponding lines) pkg/front_end/lib/src/type_inference/inference_visitor.dart:2123 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:2123-2313 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6006-6150 — These two members are one piece of code written twice and then edited apart: 145 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (158 corresponding lines) · ×1
  • Edited copy of a member (158 corresponding lines) pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:509 — pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart:509-691 | pkg/front_end/lib/src/source/source_type_alias_builder.dart:165-322 — These two members are one piece of code written twice and then edited apart: 158 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (130 corresponding lines) · ×1
  • Edited copy of a member (130 corresponding lines) pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:53 — pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:53-187 | pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart:493-622 — These two members are one piece of code written twice and then edited apart: 130 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (86 corresponding lines) · ×1
  • Edited copy of a member (86 corresponding lines) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:164 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:164-270 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:272-357 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (112 corresponding lines) · ×1
  • Edited copy of a member (112 corresponding lines) pkg/compiler/lib/src/js_model/element_map_impl.dart:683 — pkg/compiler/lib/src/js_model/element_map_impl.dart:683-796 | pkg/compiler/lib/src/kernel/element_map_impl.dart:355-466 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (107 corresponding lines) · ×1
  • Edited copy of a member (107 corresponding lines) pkg/front_end/lib/src/source/outline_builder.dart:1416 — pkg/front_end/lib/src/source/outline_builder.dart:1416-1522 | pkg/front_end/lib/src/source/outline_builder.dart:2788-2898 — These two members are one piece of code written twice and then edited apart: 107 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:216 — pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:216-298 | pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:234-357 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (110 corresponding lines) · ×1
  • Edited copy of a member (110 corresponding lines) pkg/front_end/lib/src/fragment/constructor/encoding.dart:270 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:270-379 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:552-681 — These two members are one piece of code written twice and then edited apart: 110 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (92 corresponding lines) · ×1
  • Edited copy of a member (92 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:82 — pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:82-179 | pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart:181-272 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (113 corresponding lines) · ×1
  • Edited copy of a member (113 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:35 — pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:35-155 | pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:513-625 — These two members are one piece of code written twice and then edited apart: 113 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (90 corresponding lines) · ×1
  • Edited copy of a member (90 corresponding lines) sdk/lib/_internal/wasm/common/convert_patch.dart:2742 — sdk/lib/_internal/wasm/common/convert_patch.dart:2742-2831 | sdk/lib/convert/utf.dart:575-665 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) sdk/lib/core/uri.dart:2282 — sdk/lib/core/uri.dart:2282-2360 | sdk/lib/core/uri.dart:4746-4825 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (124 corresponding lines) · ×1
  • Edited copy of a member (124 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:2593 — pkg/compiler/lib/src/js/rewrite_async.dart:2593-2734 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:2769-2892 — These two members are one piece of code written twice and then edited apart: 124 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) pkg/observatory/lib/src/elements/cpu_profile.dart:82 — pkg/observatory/lib/src/elements/cpu_profile.dart:82-153 | pkg/observatory/lib/src/elements/native_memory_profiler.dart:77-144 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:171 — pkg/analysis_server/lib/src/services/correction/dart/create_class.dart:171-260 | pkg/analysis_server/lib/src/services/correction/dart/create_mixin.dart:134-199 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (95 corresponding lines) · ×1
  • Edited copy of a member (95 corresponding lines) pkg/front_end/lib/src/kernel/constant_evaluator.dart:1721 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:1721-1815 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:1817-1918 — These two members are one piece of code written twice and then edited apart: 95 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 84+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 84+ corresponding lines) pkg/front_end/lib/src/source/fragment_factory_impl.dart:1915 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:1915-1998 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:2000-2083 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:2085-2178 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 84 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 107+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 107+ corresponding lines) pkg/compiler/lib/src/js/size_estimator.dart:720 — pkg/compiler/lib/src/js/size_estimator.dart:720-826 | pkg/dev_compiler/lib/src/js_ast/printer.dart:958-1073 | pkg/js_ast/lib/src/printer.dart:1093-1213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 107 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (94 corresponding lines) · ×1
  • Edited copy of a member (94 corresponding lines) pkg/compiler/lib/src/js/rewrite_async.dart:2118 — pkg/compiler/lib/src/js/rewrite_async.dart:2118-2220 | pkg/dev_compiler/lib/src/compiler/rewrite_async.dart:2300-2393 — These two members are one piece of code written twice and then edited apart: 94 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 76+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 76+ corresponding lines) pkg/front_end/lib/src/kernel/resolver.dart:373 — pkg/front_end/lib/src/kernel/resolver.dart:373-451 | pkg/front_end/lib/src/kernel/resolver.dart:661-736 | pkg/front_end/lib/src/kernel/resolver.dart:738-817 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 76 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) pkg/dart2bytecode/lib/declarations.dart:649 — pkg/dart2bytecode/lib/declarations.dart:649-708 | pkg/dart2bytecode/lib/declarations.dart:1122-1178 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) pkg/dart2wasm/lib/code_generator.dart:2300 — pkg/dart2wasm/lib/code_generator.dart:2300-2357 | pkg/dart2wasm/lib/code_generator.dart:2416-2474 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) pkg/analyzer/lib/src/generated/error_verifier.dart:552 — pkg/analyzer/lib/src/generated/error_verifier.dart:552-628 | pkg/analyzer/lib/src/generated/error_verifier.dart:1005-1068 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 49+ corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:531 — pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:531-579 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1637-1686 | pkg/analyzer/lib/src/summary2/ast_binary_reader.dart:1772-1821 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:104 — pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:104-166 | pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart:168-233 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 60+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 60+ corresponding lines) pkg/front_end/lib/src/fragment/field/encoding.dart:1286 — pkg/front_end/lib/src/fragment/field/encoding.dart:1286-1349 | pkg/front_end/lib/src/fragment/field/encoding.dart:1509-1568 | pkg/front_end/lib/src/fragment/field/encoding.dart:1570-1639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 60 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:382 — pkg/analyzer/lib/src/dart/element/greatest_lower_bound.dart:382-419 | pkg/analyzer/lib/src/dart/element/least_upper_bound.dart:853-890 | pkg/analyzer/lib/src/dart/element/top_merge.dart:279-316 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 56+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 56+ corresponding lines) pkg/analyzer/lib/src/summary2/element_builder.dart:547 — pkg/analyzer/lib/src/summary2/element_builder.dart:547-621 | pkg/analyzer/lib/src/summary2/element_builder.dart:664-727 | pkg/analyzer/lib/src/summary2/element_builder.dart:796-851 | pkg/analyzer/lib/src/summary2/element_builder.dart:853-908 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 56 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (102 corresponding lines) · ×1
  • Edited copy of a member (102 corresponding lines) sdk/lib/_internal/js_runtime/lib/js_helper.dart:2612 — sdk/lib/_internal/js_runtime/lib/js_helper.dart:2612-2713 | sdk/lib/_internal/js_runtime/lib/js_helper.dart:2759-2861 — These two members are one piece of code written twice and then edited apart: 102 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 30+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:371 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:371-414 | sdk/lib/_internal/js_runtime/lib/js_array.dart:480-518 | sdk/lib/_internal/wasm/js_common/js_array.dart:322-352 | sdk/lib/collection/list.dart:379-408 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 35+ corresponding lines) pkg/observatory/lib/src/elements/class_view.dart:65 — pkg/observatory/lib/src/elements/class_view.dart:65-103 | pkg/observatory/lib/src/elements/field_view.dart:55-90 | pkg/observatory/lib/src/elements/function_view.dart:57-92 | pkg/observatory/lib/src/elements/instance_view.dart:62-100 | pkg/observatory/lib/src/elements/library_view.dart:59-93 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) pkg/observatory/lib/src/elements/field_view.dart:169 — pkg/observatory/lib/src/elements/field_view.dart:169-199 | pkg/observatory/lib/src/elements/function_view.dart:152-182 | pkg/observatory/lib/src/elements/instance_view.dart:170-197 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 41+ corresponding lines) pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4548 — pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4548-4591 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4593-4633 | pkg/analyzer/lib/src/dart/resolver/type_analyzer.dart:4635-4676 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) pkg/analyzer/lib/src/generated/error_verifier.dart:2257 — pkg/analyzer/lib/src/generated/error_verifier.dart:2257-2310 | pkg/analyzer/lib/src/generated/error_verifier.dart:2312-2361 | pkg/analyzer/lib/src/generated/error_verifier.dart:2363-2421 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 50 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 37+ corresponding lines) pkg/analyzer/lib/src/dart/element/type.dart:972 — pkg/analyzer/lib/src/dart/element/type.dart:972-1008 | pkg/analyzer/lib/src/dart/element/type.dart:1010-1046 | pkg/analyzer/lib/src/dart/element/type.dart:1048-1084 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 33+ corresponding lines) pkg/observatory/lib/src/elements/class_instances.dart:182 — pkg/observatory/lib/src/elements/class_instances.dart:182-214 | pkg/observatory/lib/src/elements/class_instances.dart:216-251 | pkg/observatory/lib/src/elements/class_instances.dart:253-288 | pkg/observatory/lib/src/elements/class_instances.dart:290-324 | pkg/observatory/lib/src/elements/class_instances.dart:326-360 | pkg/observatory/lib/src/elements/object_common.dart:182-215 | pkg/observatory/lib/src/elements/object_common.dart:217-250 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 39+ corresponding lines) pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:286 — pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:286-329 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:534-572 | pkg/analyzer/lib/src/error/lookup_failure_reporter.dart:806-847 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 43+ corresponding lines) pkg/analyzer/tool/generators/ast_generator.dart:527 — pkg/analyzer/tool/generators/ast_generator.dart:527-570 | pkg/analyzer/tool/generators/ast_generator.dart:572-614 | pkg/analyzer/tool/generators/ast_generator.dart:1158-1201 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 25+ corresponding lines) pkg/analyzer/lib/src/summary2/bundle_writer.dart:138 — pkg/analyzer/lib/src/summary2/bundle_writer.dart:138-170 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:326-350 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:368-399 | pkg/analyzer/lib/src/summary2/bundle_writer.dart:661-689 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:71 — pkg/analysis_server/lib/src/services/refactoring/add_constructor_name.dart:71-106 | pkg/analysis_server/lib/src/services/refactoring/add_import_prefix.dart:77-112 | pkg/analysis_server/lib/src/services/refactoring/remove_constructor_name.dart:32-69 | pkg/analysis_server/lib/src/services/refactoring/remove_import_prefix.dart:33-61 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) pkg/front_end/tool/coverage_merger.dart:1163 — pkg/front_end/tool/coverage_merger.dart:1163-1188 | pkg/front_end/tool/coverage_merger.dart:1230-1260 | pkg/front_end/tool/coverage_merger.dart:1262-1292 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:101 — sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:101-122 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart:153-175 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:109-132 | sdk/lib/_internal/js_dev_runtime/private/linked_hash_set.dart:134-155 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1092 — pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1092-1128 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1210-1245 | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart:1378-1413 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 35+ corresponding lines) pkg/analyzer/tool/ast/generate.dart:419 — pkg/analyzer/tool/ast/generate.dart:419-460 | pkg/analyzer/tool/ast/generate.dart:493-527 | pkg/analyzer/tool/ast/generate.dart:570-613 | pkg/analyzer/tool/ast/generate.dart:745-789 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) pkg/compiler/lib/src/ssa/builder.dart:6653 — pkg/compiler/lib/src/ssa/builder.dart:6653-6688 | pkg/compiler/lib/src/ssa/builder.dart:6690-6724 | pkg/compiler/lib/src/ssa/builder.dart:6726-6760 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 25+ corresponding lines) sdk/lib/_internal/js_runtime/lib/collection_patch.dart:25 — sdk/lib/_internal/js_runtime/lib/collection_patch.dart:25-55 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:509-539 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:611-641 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1030-1060 | sdk/lib/_internal/vm/lib/hash_factories.dart:23-47 | sdk/lib/_internal/vm/lib/hash_factories.dart:55-79 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:11-36 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:600-624 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 29+ corresponding lines) pkg/front_end/lib/src/kernel/expression_generator.dart:2824 — pkg/front_end/lib/src/kernel/expression_generator.dart:2824-2852 | pkg/front_end/lib/src/kernel/expression_generator.dart:2854-2885 | pkg/front_end/lib/src/kernel/expression_generator.dart:3293-3323 | pkg/front_end/lib/src/kernel/expression_generator.dart:3325-3358 | pkg/front_end/lib/src/kernel/expression_generator.dart:3683-3718 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 29+ corresponding lines) pkg/analyzer/lib/src/summary2/element_builder.dart:248 — pkg/analyzer/lib/src/summary2/element_builder.dart:248-278 | pkg/analyzer/lib/src/summary2/element_builder.dart:280-309 | pkg/analyzer/lib/src/summary2/element_builder.dart:311-340 | pkg/analyzer/lib/src/summary2/element_builder.dart:342-371 | pkg/analyzer/lib/src/summary2/element_builder.dart:729-757 | pkg/analyzer/lib/src/summary2/element_builder.dart:759-794 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 25+ corresponding lines) pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_editable_arguments.dart:38 — pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_editable_arguments.dart:38-68 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmentation.dart:26-57 | pkg/analysis_server/lib/src/lsp/handlers/custom/handler_augmented.dart:26-57 | pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart:33-59 | pkg/analysis_server/lib/src/lsp/handlers/handler_references.dart:35-59 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) pkg/analyzer/tool/ast/generate.dart:529 — pkg/analyzer/tool/ast/generate.dart:529-568 | pkg/analyzer/tool/ast/generate.dart:915-1005 | pkg/analyzer/tool/ast/generate.dart:1060-1110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 20+ corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:533 — pkg/analyzer/lib/src/fine/library_manifest.dart:533-552 | pkg/analyzer/lib/src/fine/library_manifest.dart:554-573 | pkg/analyzer/lib/src/fine/library_manifest.dart:613-632 | pkg/analyzer/lib/src/fine/library_manifest.dart:634-653 | pkg/analyzer/lib/src/fine/library_manifest.dart:655-674 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 24+ corresponding lines) sdk/lib/_internal/wasm/common/typed_data.dart:2475 — sdk/lib/_internal/wasm/common/typed_data.dart:2475-2499 | sdk/lib/_internal/wasm/common/typed_data.dart:2539-2563 | sdk/lib/_internal/wasm/common/typed_data.dart:2603-2627 | sdk/lib/_internal/wasm/common/typed_data.dart:2667-2691 | sdk/lib/_internal/wasm/common/typed_data.dart:2731-2754 | sdk/lib/_internal/wasm/common/typed_data.dart:2775-2798 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 19+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:18326 — pkg/analyzer/lib/src/dart/ast/ast.dart:18326-18344 | pkg/analyzer/lib/src/dart/ast/ast.dart:40011-40031 | pkg/analyzer/lib/src/dart/ast/ast.dart:41268-41288 | pkg/analyzer/lib/src/dart/ast/ast.dart:44461-44481 | pkg/analyzer/lib/src/dart/ast/ast.dart:58510-58529 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 10+ corresponding lines) pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:796 — pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:796-806 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1137-1148 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1242-1253 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1584-1595 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1717-1727 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1729-1738 | pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart:1740-1750 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 17+ corresponding lines) pkg/analyzer/lib/src/fine/library_manifest.dart:1943 — pkg/analyzer/lib/src/fine/library_manifest.dart:1943-1966 | pkg/analyzer/lib/src/fine/library_manifest.dart:2208-2231 | pkg/analyzer/lib/src/fine/library_manifest.dart:2233-2249 | pkg/analyzer/lib/src/fine/library_manifest.dart:2251-2267 | pkg/analyzer/lib/src/fine/library_manifest.dart:2269-2285 | pkg/analyzer/lib/src/fine/library_manifest.dart:2287-2303 | pkg/analyzer/lib/src/fine/library_manifest.dart:2305-2322 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 8+ corresponding lines) pkg/kernel/lib/src/ast/expressions.dart:136 — pkg/kernel/lib/src/ast/expressions.dart:136-143 | pkg/kernel/lib/src/ast/expressions.dart:251-265 | pkg/kernel/lib/src/ast/functions.dart:74-88 | pkg/kernel/lib/src/ast/functions.dart:174-188 | pkg/kernel/lib/src/ast/functions.dart:266-280 | pkg/kernel/lib/src/ast/types.dart:87-94 | pkg/kernel/lib/src/ast/types.dart:170-177 | pkg/kernel/lib/src/ast/types.dart:291-305 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 24+ corresponding lines) pkg/front_end/lib/src/fragment/method/encoding.dart:1135 — pkg/front_end/lib/src/fragment/method/encoding.dart:1135-1164 | pkg/front_end/lib/src/fragment/util.dart:174-197 | pkg/front_end/lib/src/fragment/util.dart:199-222 | pkg/front_end/lib/src/fragment/util.dart:252-275 | pkg/front_end/lib/src/fragment/util.dart:277-300 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 19+ corresponding lines) pkg/kernel/lib/src/tool/check_equivalence.dart:137 — pkg/kernel/lib/src/tool/check_equivalence.dart:137-159 | pkg/kernel/lib/src/tool/check_equivalence.dart:219-241 | pkg/kernel/lib/src/tool/check_equivalence.dart:267-289 | pkg/kernel/lib/src/tool/check_equivalence.dart:291-313 | pkg/kernel/lib/src/tool/check_equivalence.dart:315-337 | pkg/kernel/lib/src/tool/check_equivalence.dart:363-381 | pkg/kernel/lib/src/tool/check_equivalence.dart:383-405 | pkg/kernel/lib/src/tool/check_equivalence.dart:407-429 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 12+ corresponding lines) pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:85 — pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:85-96 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:123-135 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:301-317 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:485-498 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:770-784 | pkg/analyzer/lib/src/summary2/ast_binary_writer.dart:1033-1045 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 18+ corresponding lines) pkg/front_end/lib/src/fragment/field/declaration.dart:432 — pkg/front_end/lib/src/fragment/field/declaration.dart:432-452 | pkg/front_end/lib/src/fragment/field/declaration.dart:673-692 | pkg/front_end/lib/src/fragment/field/declaration.dart:705-726 | pkg/front_end/lib/src/fragment/getter/declaration.dart:184-201 | pkg/front_end/lib/src/fragment/method/declaration.dart:172-191 | pkg/front_end/lib/src/fragment/setter/declaration.dart:187-206 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:276 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:276-285 | sdk/lib/_internal/js_runtime/lib/js_array.dart:378-389 | sdk/lib/_internal/wasm/js_common/js_array.dart:224-234 | sdk/lib/_internal/wasm/js_common/js_array.dart:236-246 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:634-642 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2125-2136 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 12+ corresponding lines) pkg/analyzer/lib/src/dart/element/element.dart:476 — pkg/analyzer/lib/src/dart/element/element.dart:476-487 | pkg/analyzer/lib/src/dart/element/element.dart:1060-1076 | pkg/analyzer/lib/src/dart/element/element.dart:2590-2601 | pkg/analyzer/lib/src/dart/element/element.dart:3281-3292 | pkg/analyzer/lib/src/dart/element/element.dart:3463-3474 | pkg/analyzer/lib/src/dart/element/element.dart:9171-9186 | pkg/analyzer/lib/src/dart/element/element.dart:9427-9438 | pkg/analyzer/lib/src/dart/element/element.dart:11056-11071 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 17+ corresponding lines) pkg/front_end/lib/src/source/fragment_factory_impl.dart:182 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:182-198 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:211-229 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:264-280 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:282-300 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:381-397 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:399-416 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:473-490 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:525-541 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 9+ corresponding lines) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1267 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1267-1275 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1388-1396 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1514-1522 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1638-1646 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1833-1841 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1937-1945 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2423-2431 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2551-2559 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 6+ corresponding lines) sdk/lib/_internal/js_shared/lib/rti.dart:2419 — sdk/lib/_internal/js_shared/lib/rti.dart:2419-2424 | sdk/lib/_internal/js_shared/lib/rti.dart:2433-2447 | sdk/lib/_internal/js_shared/lib/rti.dart:2474-2488 | sdk/lib/_internal/js_shared/lib/rti.dart:2513-2523 | sdk/lib/_internal/js_shared/lib/rti.dart:2582-2596 | sdk/lib/_internal/js_shared/lib/rti.dart:2683-2697 | sdk/lib/_internal/js_shared/lib/rti.dart:2766-2780 | sdk/lib/_internal/js_shared/lib/rti.dart:2806-2827 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 15+ corresponding lines) pkg/observatory/lib/src/app/page.dart:597 — pkg/observatory/lib/src/app/page.dart:597-611 | pkg/observatory/lib/src/app/page.dart:682-696 | pkg/observatory/lib/src/app/page.dart:711-725 | pkg/observatory/lib/src/app/page.dart:740-755 | pkg/observatory/lib/src/app/page.dart:776-792 | pkg/observatory/lib/src/app/page.dart:806-822 | pkg/observatory/lib/src/app/page.dart:836-850 | pkg/observatory/lib/src/app/page.dart:864-880 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) pkg/front_end/lib/src/kernel/internal_ast.dart:6993 — pkg/front_end/lib/src/kernel/internal_ast.dart:6993-7009 | pkg/front_end/lib/src/kernel/internal_ast.dart:7043-7057 | pkg/front_end/lib/src/kernel/internal_ast.dart:7611-7624 | pkg/kernel/lib/src/ast/patterns.dart:607-622 | pkg/kernel/lib/src/ast/patterns.dart:1172-1185 | pkg/kernel/lib/src/ast/patterns.dart:2142-2154 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:12 — pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:12-24 | pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:26-33 | pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:51-58 | pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:60-74 | pkg/analysis_server/tool/benchmark_tools/legacy_messages.dart:130-145 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) pkg/analyzer/lib/src/dart/ast/ast.dart:22734 — pkg/analyzer/lib/src/dart/ast/ast.dart:22734-22746 | pkg/analyzer/lib/src/dart/ast/ast.dart:29357-29367 | pkg/analyzer/lib/src/dart/ast/ast.dart:40117-40127 | pkg/analyzer/lib/src/dart/ast/ast.dart:54248-54258 | pkg/analyzer/lib/src/dart/ast/ast.dart:60004-60014 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 13+ corresponding lines) pkg/dev_compiler/lib/src/js_ast/template.dart:211 — pkg/dev_compiler/lib/src/js_ast/template.dart:211-224 | pkg/dev_compiler/lib/src/js_ast/template.dart:294-310 | pkg/dev_compiler/lib/src/js_ast/template.dart:312-324 | pkg/dev_compiler/lib/src/js_ast/template.dart:344-358 | pkg/js_ast/lib/src/template.dart:236-248 | pkg/js_ast/lib/src/template.dart:250-262 | pkg/js_ast/lib/src/template.dart:318-333 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) pkg/observatory/lib/src/repositories/inbound_references.dart:8 — pkg/observatory/lib/src/repositories/inbound_references.dart:8-15 | pkg/observatory/lib/src/repositories/persistent_handles.dart:8-12 | pkg/observatory/lib/src/repositories/ports.dart:8-12 | pkg/observatory/lib/src/repositories/retaining_path.dart:8-15 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) pkg/kernel/lib/binary/ast_to_binary.dart:1711 — pkg/kernel/lib/binary/ast_to_binary.dart:1711-1720 | pkg/kernel/lib/binary/ast_to_binary.dart:1740-1749 | pkg/kernel/lib/binary/ast_to_binary.dart:1857-1866 | pkg/kernel/lib/binary/ast_to_binary.dart:1896-1908 | pkg/kernel/lib/binary/ast_to_binary.dart:1910-1922 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) pkg/compiler/lib/src/inferrer/typemasks/dictionary_type_mask.dart:69 — pkg/compiler/lib/src/inferrer/typemasks/dictionary_type_mask.dart:69-80 | pkg/compiler/lib/src/inferrer/typemasks/set_type_mask.dart:59-68 | pkg/compiler/lib/src/inferrer/typemasks/value_type_mask.dart:40-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 7+ corresponding lines) pkg/wasm_builder/lib/src/ir/function.dart:214 — pkg/wasm_builder/lib/src/ir/function.dart:214-220 | pkg/wasm_builder/lib/src/ir/global.dart:122-128 | pkg/wasm_builder/lib/src/ir/memory.dart:119-125 | pkg/wasm_builder/lib/src/ir/table.dart:108-114 | pkg/wasm_builder/lib/src/ir/tags.dart:87-95 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) sdk/lib/_internal/js_runtime/lib/constant_map.dart:82 — sdk/lib/_internal/js_runtime/lib/constant_map.dart:82-84 | sdk/lib/collection/maps.dart:88-92 | sdk/lib/internal/cast.dart:321-325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 2+ corresponding lines) sdk/lib/_internal/js_runtime/lib/js_array.dart:276 — sdk/lib/_internal/js_runtime/lib/js_array.dart:276-278 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:376-377 | sdk/lib/_internal/wasm/common/typed_data.dart:2134-2135 | sdk/lib/collection/list.dart:184-185 | sdk/lib/collection/set.dart:139-140 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 3+ corresponding lines) pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:29 — pkg/front_end/parser_testcases/error_recovery/issue_26810.dart:29-31 | pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart:29-31 | pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart:29-31 | pkg/front_end/testcases/general/error_recovery/issue_26810.dart:36-38 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 1+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 1+ corresponding lines) sdk/lib/_internal/vm/lib/typed_data_patch.dart:374 — sdk/lib/_internal/vm/lib/typed_data_patch.dart:374-374 | sdk/lib/_internal/wasm/common/typed_data.dart:2132-2132 | sdk/lib/internal/iterable.dart:459-460 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (125–128 lines × 2) · ×1
  • Duplicated block (125–128 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1149 — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1149-1276 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart:478-602 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart` as WHOLE FILES: this scan already matched 44 separate duplicated blocks between them, totalling at least 867 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 `pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:1149` 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.
D4 · Code Duplication · Duplicated block (123–124 lines × 2) · ×1
  • Duplicated block (123–124 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6908 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6908-7030 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7595-7718 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6908` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (121 lines × 2) · ×1
  • Duplicated block (121 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:2690 — pkg/dev_compiler/lib/src/kernel/compiler.dart:2690-2810 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:3000-3120 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:2690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (117 lines × 2) · ×1
  • Duplicated block (117 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6338 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6338-6454 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7027-7143 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6338` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (116 lines × 2) · ×1
  • Duplicated block (116 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6706 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6706-6821 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7395-7510 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (88 lines × 2) · ×1
  • Duplicated block (88 lines × 2) pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:158 — pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:158-245 | pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:468-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/constant_evaluator.dart:158` 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.
D4 · Code Duplication · Duplicated block (82 lines × 2) · ×1
  • Duplicated block (82 lines × 2) pkg/front_end/parser_testcases/patterns/const_patterns.dart:36 — pkg/front_end/parser_testcases/patterns/const_patterns.dart:36-117 | pkg/front_end/testcases/patterns/const_patterns.dart:42-123 — before extracting anything, compare `pkg/front_end/parser_testcases/patterns/const_patterns.dart` and `pkg/front_end/testcases/patterns/const_patterns.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/parser_testcases/patterns/const_patterns.dart:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (78–79 lines × 2) · ×1
  • Duplicated block (78–79 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6825 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6825-6903 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:7514-7591 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6825` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (68–71 lines × 2) · ×1
  • Duplicated block (68–71 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7212 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7212-7279 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7477-7547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (70 lines × 2) · ×1
  • Duplicated block (70 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5057 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5057-5126 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:5667-5736 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5057` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (112 lines × 2) · ×1
  • Duplicated block (112 lines × 2) sdk/lib/_internal/wasm/common/convert_patch.dart:1494 — sdk/lib/_internal/wasm/common/convert_patch.dart:1494-1605 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1186-1297 — `sdk/lib/_internal/wasm/common/convert_patch.dart` and `sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart` 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 12 separate duplicated blocks between them, totalling at least 265 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 `sdk/lib/_internal/wasm/common/convert_patch.dart:1494` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (68–69 lines × 2) · ×1
  • Duplicated block (68–69 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:7755 — pkg/dev_compiler/lib/src/kernel/compiler.dart:7755-7822 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8622-8690 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:7755` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) pkg/compiler/lib/src/js/size_estimator.dart:732 — pkg/compiler/lib/src/js/size_estimator.dart:732-797 | pkg/js_ast/lib/src/printer.dart:1107-1172 — before extracting anything, compare `pkg/compiler/lib/src/js/size_estimator.dart` and `pkg/js_ast/lib/src/printer.dart` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 154 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 · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_number.dart:535 — sdk/lib/_internal/js_dev_runtime/private/js_number.dart:535-599 | sdk/lib/_internal/js_runtime/lib/js_number.dart:625-689 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_number.dart` and `sdk/lib/_internal/js_runtime/lib/js_number.dart` as WHOLE FILES: this scan already matched 11 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:6008 — pkg/dev_compiler/lib/src/kernel/compiler.dart:6008-6069 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6697-6758 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:6008` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (58–62 lines × 2) · ×1
  • Duplicated block (58–62 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8602 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8602-8659 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9066-9127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:8602` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8245 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8245-8302 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:9114-9171 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 · Duplicated block (50–57 lines × 3) · ×1
  • Duplicated block (50–57 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:8639 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:8639-8689 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8840-8889 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9103-9159 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:8639` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53–54 lines × 2) · ×1
  • Duplicated block (53–54 lines × 2) pkg/analyzer/lib/src/fasta/ast_builder.dart:234 — pkg/analyzer/lib/src/fasta/ast_builder.dart:234-287 | pkg/analyzer/lib/src/fasta/ast_builder.dart:506-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fasta/ast_builder.dart:234` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (51–52 lines × 2) · ×1
  • Duplicated block (51–52 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6842 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6842-6892 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8464-8515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6842` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `IfNullIndexSet` in one and `CompoundIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (51 lines × 3) · ×1
  • Duplicated block (51 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1665 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1665-1715 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1683-1733 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2267-2317 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1665` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:5228 — pkg/front_end/lib/src/kernel/body_builder.dart:5228-5278 | pkg/front_end/lib/src/source/outline_builder.dart:3749-3799 — before extracting anything, compare `pkg/front_end/lib/src/kernel/body_builder.dart` and `pkg/front_end/lib/src/source/outline_builder.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (48 lines × 3) · ×1
  • Duplicated block (48 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6593 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6593-6640 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6687-6734 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8904-8951 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6593` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionIndexGet` in one and `ExtensionIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (39–48 lines × 2) · ×1
  • Duplicated block (39–48 lines × 2) pkg/dart2wasm/lib/list_factory_specializer.dart:113 — pkg/dart2wasm/lib/list_factory_specializer.dart:113-160 | pkg/vm/lib/modular/specializer/list_factory_specializer.dart:135-173 — before extracting anything, compare `pkg/dart2wasm/lib/list_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/list_factory_specializer.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 151 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.
D4 · Code Duplication · Duplicated block (28–44 lines × 2) · ×1
  • Duplicated block (28–44 lines × 2) pkg/analyzer/lib/src/error/error_handler_verifier.dart:324 — pkg/analyzer/lib/src/error/error_handler_verifier.dart:324-351 | pkg/analyzer/lib/src/error/error_handler_verifier.dart:357-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/error_handler_verifier.dart:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:8085 — pkg/dev_compiler/lib/src/kernel/compiler.dart:8085-8128 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:8954-8997 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:168 — pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:168-208 | pkg/analyzer/lib/src/dart/element/replacement_visitor.dart:274-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.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:51 — pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:51-89 | pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:146-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart:51` 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.
D4 · Code Duplication · Duplicated block (37–39 lines × 2) · ×1
  • Duplicated block (37–39 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6385 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6385-6423 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6494-6530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6385` 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 `node` to `IndexSet` in one and `SuperIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (37–38 lines × 3) · ×1
  • Duplicated block (37–38 lines × 3) pkg/front_end/lib/src/source/fragment_factory_impl.dart:1917 — pkg/front_end/lib/src/source/fragment_factory_impl.dart:1917-1953 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:2002-2038 | pkg/front_end/lib/src/source/fragment_factory_impl.dart:2087-2124 — 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 `pkg/front_end/lib/src/source/fragment_factory_impl.dart:1917` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/front_end/lib/src/source/fragment_factory_impl.dart:2127` calls `identical` and `pkg/front_end/lib/src/source/fragment_factory_impl.dart:2041` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (42–44 lines × 2) · ×1
  • Duplicated block (42–44 lines × 2) sdk/lib/_internal/wasm/js/string_patch.dart:154 — sdk/lib/_internal/wasm/js/string_patch.dart:154-197 | sdk/lib/_internal/wasm/standalone/string_patch.dart:112-153 — `sdk/lib/_internal/wasm/js/string_patch.dart` and `sdk/lib/_internal/wasm/standalone/string_patch.dart` 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 7 separate duplicated blocks between them, totalling at least 131 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 `sdk/lib/_internal/wasm/js/string_patch.dart:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 · Duplicated block (37 lines × 3) · ×1
  • Duplicated block (37 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:561 — pkg/front_end/lib/src/fragment/getter/encoding.dart:561-597 | pkg/front_end/lib/src/fragment/method/encoding.dart:541-577 | pkg/front_end/lib/src/fragment/setter/encoding.dart:582-618 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:561` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (35–36 lines × 3) · ×1
  • Duplicated block (35–36 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:695 — pkg/front_end/lib/src/fragment/getter/encoding.dart:695-730 | pkg/front_end/lib/src/fragment/method/encoding.dart:658-692 | pkg/front_end/lib/src/fragment/setter/encoding.dart:727-762 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35 lines × 6) · ×1
  • Duplicated block (35 lines × 6) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1384 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1384-1418 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1465-1499 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1729-1763 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1925-1959 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2015-2049 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2317-2351 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1384` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionTearOff` in one and `ExtensionGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (27–35 lines × 2) · ×1
  • Duplicated block (27–35 lines × 2) pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1240 — pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1240-1266 | pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1320-1354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/type_inference/type_analyzer_operations.dart:1240` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (31–35 lines × 2) · ×1
  • Duplicated block (31–35 lines × 2) pkg/front_end/lib/src/fragment/constructor/declaration.dart:845 — pkg/front_end/lib/src/fragment/constructor/declaration.dart:845-875 | pkg/front_end/lib/src/fragment/constructor/declaration.dart:1347-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (34–35 lines × 2) · ×1
  • Duplicated block (34–35 lines × 2) pkg/front_end/lib/src/kernel/body_builder.dart:9425 — pkg/front_end/lib/src/kernel/body_builder.dart:9425-9458 | pkg/front_end/lib/src/kernel/body_builder.dart:9547-9581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/body_builder.dart:9425` 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.
D4 · Code Duplication · Duplicated block (24–34 lines × 5) · ×1
  • Duplicated block (24–34 lines × 5) pkg/analyzer/tool/ast/generate.dart:420 — pkg/analyzer/tool/ast/generate.dart:420-447 | pkg/analyzer/tool/ast/generate.dart:494-517 | pkg/analyzer/tool/ast/generate.dart:571-603 | pkg/analyzer/tool/ast/generate.dart:658-686 | pkg/analyzer/tool/ast/generate.dart:746-779 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/ast/generate.dart:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32–34 lines × 2) · ×1
  • Duplicated block (32–34 lines × 2) sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:763 — sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:763-794 | sdk/lib/_internal/js_runtime/lib/async_patch.dart:529-562 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart` and `sdk/lib/_internal/js_runtime/lib/async_patch.dart` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 174 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 `sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart:763` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32–33 lines × 3) · ×1
  • Duplicated block (32–33 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6959 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6959-6991 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7166-7197 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7428-7460 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6959` 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 `node` to `IfNullIndexSet` in one and `IfNullSuperIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (31–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:209 — pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:209-239 | pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart:284-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–33 lines × 2) · ×1
  • Duplicated block (20–33 lines × 2) pkg/front_end/lib/src/kernel/constant_evaluator.dart:1629 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:1629-1661 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:2180-2199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/kernel/constant_evaluator.dart:1629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) pkg/front_end/lib/src/kernel/resolver.dart:384 — pkg/front_end/lib/src/kernel/resolver.dart:384-416 | pkg/front_end/lib/src/kernel/resolver.dart:672-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1773 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1773-1804 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2361-2392 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7329-7360 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1773` it does not close everything it opens, so those 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 `node` to `ExtensionIncDec` in one and `ExtensionCompoundSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6412 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6412-6443 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6776-6806 — both copies are in the same file, so extract the 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 `node` to `IndexSet` in one and `ExtensionIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) pkg/front_end/lib/src/base/incremental_compiler.dart:3267 — pkg/front_end/lib/src/base/incremental_compiler.dart:3267-3297 | pkg/front_end/lib/src/base/incremental_compiler.dart:3633-3662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/base/incremental_compiler.dart:3267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–30 lines × 3) · ×1
  • Duplicated block (24–30 lines × 3) pkg/analyzer/tool/ast/generate.dart:381 — pkg/analyzer/tool/ast/generate.dart:381-404 | pkg/analyzer/tool/ast/generate.dart:616-640 | pkg/analyzer/tool/ast/generate.dart:704-733 — 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 `pkg/analyzer/tool/ast/generate.dart:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–30 lines × 2) · ×1
  • Duplicated block (26–30 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2943 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2943-2968 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3233-3262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2943` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) sdk/lib/_internal/vm/lib/convert_patch.dart:1431 — sdk/lib/_internal/vm/lib/convert_patch.dart:1431-1459 | sdk/lib/_internal/wasm/common/convert_patch.dart:1617-1645 | sdk/lib/_internal/wasm/js_compatibility/convert_patch.dart:1309-1337 — before extracting anything, compare `sdk/lib/_internal/vm/lib/convert_patch.dart` and `sdk/lib/_internal/wasm/common/convert_patch.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 214 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 `sdk/lib/_internal/vm/lib/convert_patch.dart:1431` 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.
D4 · Code Duplication · Duplicated block (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1417 — pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1417-1444 | pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1837-1861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/analysis_options/analysis_options_parse_model.dart:1417` 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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) pkg/compiler/lib/src/ssa/builder.dart:4164 — pkg/compiler/lib/src/ssa/builder.dart:4164-4190 | pkg/compiler/lib/src/ssa/builder.dart:4250-4277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/compiler/lib/src/ssa/builder.dart:4164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–28 lines × 2) · ×1
  • Duplicated block (21–28 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:149 — pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:149-169 | pkg/dds/lib/src/devtools/memory_profile.dart:173-200 — before extracting anything, compare `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart` and `pkg/dds/lib/src/devtools/memory_profile.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 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 `pkg/dart_runtime_service/lib/src/io/devtools/memory_profile.dart:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 4) · ×1
  • Duplicated block (27 lines × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7118 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7118-7144 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7378-7404 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8728-8754 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8986-9012 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `IfNullSuperIndexSet` in one and `ExtensionIfNullIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×1
  • Duplicated block (27 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:525 — pkg/front_end/lib/src/fragment/getter/encoding.dart:525-551 | pkg/front_end/lib/src/fragment/method/encoding.dart:500-526 | pkg/front_end/lib/src/fragment/setter/encoding.dart:545-571 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart: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.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) pkg/linter/lib/src/rules/use_build_context_synchronously.dart:351 — pkg/linter/lib/src/rules/use_build_context_synchronously.dart:351-375 | pkg/linter/lib/src/rules/use_build_context_synchronously.dart:379-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25–26 lines × 4) · ×1
  • Duplicated block (25–26 lines × 4) pkg/analysis_server/lib/src/status/pages/assists_page.dart:27 — pkg/analysis_server/lib/src/status/pages/assists_page.dart:27-52 | pkg/analysis_server/lib/src/status/pages/code_completion_page.dart:28-52 | pkg/analysis_server/lib/src/status/pages/fixes_page.dart:27-52 | pkg/analysis_server/lib/src/status/pages/refactorings_page.dart:28-53 — 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 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analysis_server/lib/src/status/pages/assists_page.dart:27` it does not close everything it opens, so those 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, `pkg/analysis_server/lib/src/status/pages/assists_page.dart:53` calls `producerTimeAndDetails` and `pkg/analysis_server/lib/src/status/pages/code_completion_page.dart:53` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24–26 lines × 3) · ×1
  • Duplicated block (24–26 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7027 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7027-7050 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7231-7255 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7498-7523 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:7027` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (22–26 lines × 3) · ×1
  • Duplicated block (22–26 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1530 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1530-1555 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1548-1573 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2137-2158 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (24–25 lines × 6) · ×1
  • Duplicated block (24–25 lines × 6) pkg/front_end/lib/src/fragment/getter/encoding.dart:248 — pkg/front_end/lib/src/fragment/getter/encoding.dart:248-271 | pkg/front_end/lib/src/fragment/getter/encoding.dart:514-538 | pkg/front_end/lib/src/fragment/method/encoding.dart:186-209 | pkg/front_end/lib/src/fragment/method/encoding.dart:489-513 | pkg/front_end/lib/src/fragment/setter/encoding.dart:248-272 | pkg/front_end/lib/src/fragment/setter/encoding.dart:534-558 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:248` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25 lines × 6) · ×1
  • Duplicated block (25 lines × 6) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1596 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1596-1620 | sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1638-1662 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1614-1638 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1656-1680 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2198-2222 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:2240-2264 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–25 lines × 4) · ×1
  • Duplicated block (24–25 lines × 4) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:91 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:91-115 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:312-336 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1315-1339 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1590-1613 — 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 `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:91` 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 `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.
D4 · Code Duplication · Duplicated block (23–25 lines × 3) · ×1
  • Duplicated block (23–25 lines × 3) pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:62 — pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:62-86 | pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:196-218 | pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:539-563 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–25 lines × 3) · ×1
  • Duplicated block (21–25 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2785 — pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2785-2809 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2938-2958 | pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:3228-3252 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor_base.dart:2785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1268 — sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart:1268-1292 | sdk/lib/_internal/js_runtime/lib/bigint_patch.dart:1271-1295 | sdk/lib/_internal/vm_shared/lib/bigint_patch.dart:1731-1755 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/patch/bigint_patch.dart` and `sdk/lib/_internal/js_runtime/lib/bigint_patch.dart` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 542 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 · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:715 — pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:715-738 | pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:1019-1043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/resolver/element_binding_visitor.dart:715` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) pkg/dart2wasm/lib/list_factory_specializer.dart:166 — pkg/dart2wasm/lib/list_factory_specializer.dart:166-190 | pkg/vm/lib/modular/specializer/list_factory_specializer.dart:111-132 — before extracting anything, compare `pkg/dart2wasm/lib/list_factory_specializer.dart` and `pkg/vm/lib/modular/specializer/list_factory_specializer.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 151 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart:84 — pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart:84-106 | pkg/dds/lib/src/devtools/vs_code.dart:85-109 — before extracting anything, compare `pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart` and `pkg/dds/lib/src/devtools/vs_code.dart` as WHOLE FILES: 87% 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 `pkg/dart_runtime_service/lib/src/io/devtools/vs_code.dart:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 14) · ×1
  • Duplicated block (24 lines × 14) pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:157 — pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:157-180 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:261-284 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:590-613 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:647-670 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:716-739 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:803-826 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:846-869 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:887-910 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:968-991 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1017-1040 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1074-1097 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1214-1237 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1259-1282 | pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:1412-1435 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart:157` 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.
D4 · Code Duplication · Duplicated block (24 lines × 4) · ×1
  • Duplicated block (24 lines × 4) pkg/analyzer/lib/src/dart/ast/ast.dart:7945 — pkg/analyzer/lib/src/dart/ast/ast.dart:7945-7968 | pkg/analyzer/lib/src/dart/ast/ast.dart:8333-8356 | pkg/analyzer/lib/src/dart/ast/ast.dart:8781-8804 | pkg/analyzer/lib/src/dart/ast/ast.dart:9126-9149 — 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 `pkg/analyzer/lib/src/dart/ast/ast.dart:7945` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) pkg/front_end/lib/src/fragment/constructor/encoding.dart:359 — pkg/front_end/lib/src/fragment/constructor/encoding.dart:359-379 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:658-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/fragment/constructor/encoding.dart:359` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 9) · ×1
  • Duplicated block (23 lines × 9) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1389 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1389-1411 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1470-1492 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1734-1756 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1930-1952 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2020-2042 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2322-2344 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6598-6620 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6692-6714 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8909-8931 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1389` 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 `node` to `ExtensionTearOff` in one and `ExtensionGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (22–23 lines × 7) · ×1
  • Duplicated block (22–23 lines × 7) pkg/front_end/lib/src/dill/dill_class_builder.dart:116 — pkg/front_end/lib/src/dill/dill_class_builder.dart:116-137 | pkg/front_end/lib/src/dill/dill_class_builder.dart:199-220 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:89-111 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:122-144 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:99-121 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:204-226 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:238-260 — before extracting anything, compare `pkg/front_end/lib/src/dill/dill_class_builder.dart` and `pkg/front_end/lib/src/dill/dill_extension_builder.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/front_end/lib/src/dill/dill_class_builder.dart:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 4) · ×1
  • Duplicated block (22–23 lines × 4) pkg/front_end/lib/src/dill/dill_class_builder.dart:87 — pkg/front_end/lib/src/dill/dill_class_builder.dart:87-108 | pkg/front_end/lib/src/dill/dill_extension_builder.dart:155-176 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:68-90 | pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart:273-294 — before extracting anything, compare `pkg/front_end/lib/src/dill/dill_class_builder.dart` and `pkg/front_end/lib/src/dill/dill_extension_builder.dart` as WHOLE FILES: this scan already matched 4 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. 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 `pkg/front_end/lib/src/dill/dill_class_builder.dart:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:295 — sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:295-317 | sdk/lib/_internal/js_runtime/lib/regexp_helper.dart:311-333 | sdk/lib/_internal/wasm/js_common/regexp_helper.dart:281-303 | sdk/lib/_internal/wasm/standalone/regexp.dart:197-219 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart` and `sdk/lib/_internal/js_runtime/lib/regexp_helper.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart:295` 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.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) pkg/analyzer/tool/ast/generate.dart:196 — pkg/analyzer/tool/ast/generate.dart:196-218 | pkg/analyzer/tool/ast/generate.dart:1181-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/tool/ast/generate.dart: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.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:300 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:300-320 | sdk/lib/_internal/js_runtime/lib/js_array.dart:406-428 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 `sdk/lib/_internal/js_dev_runtime/private/js_array.dart:300` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 6) · ×1
  • Duplicated block (21–22 lines × 6) pkg/front_end/lib/src/fragment/getter/encoding.dart:370 — pkg/front_end/lib/src/fragment/getter/encoding.dart:370-390 | pkg/front_end/lib/src/fragment/getter/encoding.dart:670-691 | pkg/front_end/lib/src/fragment/method/encoding.dart:279-299 | pkg/front_end/lib/src/fragment/method/encoding.dart:633-654 | pkg/front_end/lib/src/fragment/setter/encoding.dart:375-395 | pkg/front_end/lib/src/fragment/setter/encoding.dart:702-723 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/lib/src/fragment/method/encoding.dart:274` calls `attachMember`, `callback` and `pkg/front_end/lib/src/fragment/method/encoding.dart:630` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (21–22 lines × 4) · ×1
  • Duplicated block (21–22 lines × 4) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:120 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:120-141 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:224-245 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:273-294 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:377-397 — 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 `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:120` 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.
D4 · Code Duplication · Duplicated block (16–22 lines × 2) · ×1
  • Duplicated block (16–22 lines × 2) pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:93 — pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:93-108 | pkg/analysis_server/lib/src/status/pages/plugins_page.dart:273-294 — 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 `pkg/analysis_server/lib/src/status/pages/legacy_plugins_page.dart:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:71 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:71-92 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart:64-81 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart:60` calls `delayed`, `Duration`, `send` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:71` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–22 lines × 2) · ×1
  • Duplicated block (15–22 lines × 2) pkg/front_end/testcases/general/constants/potentially_constant_type.dart:69 — pkg/front_end/testcases/general/constants/potentially_constant_type.dart:69-90 | pkg/front_end/testcases/general/constants/potentially_constant_type_lib1.dart:46-60 — before extracting anything, compare `pkg/front_end/testcases/general/constants/potentially_constant_type.dart` and `pkg/front_end/testcases/general/constants/potentially_constant_type_lib1.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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 · Duplicated block (13–22 lines × 2) · ×1
  • Duplicated block (13–22 lines × 2) pkg/wasm_builder/lib/src/builder/instructions.dart:2184 — pkg/wasm_builder/lib/src/builder/instructions.dart:2184-2196 | pkg/wasm_builder/lib/src/builder/instructions.dart:2222-2243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/wasm_builder/lib/src/builder/instructions.dart:2184` 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.
D4 · Code Duplication · Duplicated block (21 lines × 6) · ×1
  • Duplicated block (21 lines × 6) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1410 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1410-1430 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1491-1511 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1755-1775 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1951-1971 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2157-2177 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2343-2363 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1410` it does not close everything it opens, so those 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 `node` to `ExtensionTearOff` in one and `ExtensionGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18–21 lines × 4) · ×1
  • Duplicated block (18–21 lines × 4) pkg/observatory/lib/src/elements/heap_snapshot.dart:1069 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1069-1086 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1110-1127 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1150-1170 | pkg/observatory/lib/src/elements/process_snapshot.dart:474-491 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:1069` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–35 lines × 2) · ×1
  • Duplicated block (30–35 lines × 2) pkg/dart2wasm/lib/translator.dart:3785 — pkg/dart2wasm/lib/translator.dart:3785-3814 | pkg/dart2wasm/lib/translator.dart:3826-3860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/translator.dart:3785` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–21 lines × 2) · ×1
  • Duplicated block (15–21 lines × 2) pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:312 — pkg/dart_runtime_service/lib/src/io/devtools/machine_mode_command_handler.dart:312-326 | pkg/dds/lib/src/devtools/machine_mode_command_handler.dart:372-392 — 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.
D4 · Code Duplication · Duplicated block (13–21 lines × 3) · ×1
  • Duplicated block (13–21 lines × 3) pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1003 — pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1003-1023 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1027-1047 | pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1048-1060 — 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 `pkg/front_end/lib/src/kernel/hierarchy/members_node.dart:1003` 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.
D4 · Code Duplication · Duplicated block (14–21 lines × 2) · ×1
  • Duplicated block (14–21 lines × 2) pkg/front_end/lib/src/source/source_builder_mixins.dart:106 — pkg/front_end/lib/src/source/source_builder_mixins.dart:106-119 | pkg/front_end/lib/src/source/source_type_alias_builder.dart:360-380 — 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 `pkg/front_end/lib/src/source/source_builder_mixins.dart:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–21 lines × 2) · ×1
  • Duplicated block (13–21 lines × 2) pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:183 — pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:183-195 | pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:210-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/linter/lib/src/rules/collection_methods_unrelated_type.dart:183` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `IndexExpression` in one and `MethodInvocation` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (19–20 lines × 7) · ×1
  • Duplicated block (19–20 lines × 7) pkg/analyzer/lib/src/dart/ast/ast.dart:22467 — pkg/analyzer/lib/src/dart/ast/ast.dart:22467-22485 | pkg/analyzer/lib/src/dart/ast/ast.dart:22491-22509 | pkg/analyzer/lib/src/dart/ast/ast.dart:24408-24427 | pkg/analyzer/lib/src/dart/ast/ast.dart:52773-52791 | pkg/analyzer/lib/src/dart/ast/ast.dart:52797-52815 | pkg/analyzer/lib/src/dart/ast/ast.dart:56432-56450 | pkg/analyzer/lib/src/dart/ast/ast.dart:56456-56474 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/dart/ast/ast.dart:22467` 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.
D4 · Code Duplication · Duplicated block (20 lines × 6) · ×1
  • Duplicated block (20 lines × 6) pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:42 — pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:42-61 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:75-94 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart:108-127 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:42-61 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:75-94 | pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart:108-127 — before extracting anything, compare `pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart` and `pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart` as WHOLE FILES: 93% 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.
D4 · Code Duplication · Duplicated block (18–20 lines × 4) · ×1
  • Duplicated block (18–20 lines × 4) pkg/analyzer/tool/ast/generate.dart:636 — pkg/analyzer/tool/ast/generate.dart:636-655 | pkg/analyzer/tool/ast/generate.dart:682-701 | pkg/analyzer/tool/ast/generate.dart:896-913 | pkg/analyzer/tool/ast/generate.dart:988-1005 — 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 `pkg/analyzer/tool/ast/generate.dart:636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 4) · ×1
  • Duplicated block (19–20 lines × 4) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6284 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6284-6302 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6350-6368 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6843-6862 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8465-8484 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6843` 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 `node` to `IndexGet` in one and `IndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9–20 lines × 2) · ×1
  • Duplicated block (9–20 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5915 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5915-5923 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6570-6589 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5915` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7200 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7200-7219 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8827-8842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:7200` 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 `node` to `IfNullSuperIndexSet` in one and `CompoundSuperIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) sdk/lib/internal/internal.dart:498 — sdk/lib/internal/internal.dart:498-516 | sdk/lib/internal/internal.dart:538-556 | sdk/lib/internal/internal.dart:580-598 | sdk/lib/internal/internal.dart:624-642 | sdk/lib/internal/internal.dart:670-688 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/internal/internal.dart:498` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) pkg/analyzer/lib/src/fine/library_manifest.dart:328 — pkg/analyzer/lib/src/fine/library_manifest.dart:328-346 | pkg/analyzer/lib/src/fine/library_manifest.dart:430-448 | pkg/analyzer/lib/src/fine/library_manifest.dart:513-531 | pkg/analyzer/lib/src/fine/library_manifest.dart:711-729 — 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 `pkg/analyzer/lib/src/fine/library_manifest.dart:328` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 3) · ×1
  • Duplicated block (17–19 lines × 3) pkg/front_end/lib/src/kernel/constant_evaluator.dart:4183 — pkg/front_end/lib/src/kernel/constant_evaluator.dart:4183-4201 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:4522-4540 | pkg/front_end/lib/src/kernel/constant_evaluator.dart:5197-5213 — 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 `pkg/front_end/lib/src/kernel/constant_evaluator.dart:5197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7116 — pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7116-7134 | pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart:7357-7373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:45 — pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:45-60 | pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:148-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/error/element_usage_frontier_detector.dart:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–18 lines × 8) · ×1
  • Duplicated block (15–18 lines × 8) pkg/analyzer/tool/ast/generate.dart:400 — pkg/analyzer/tool/ast/generate.dart:400-417 | pkg/analyzer/tool/ast/generate.dart:443-460 | pkg/analyzer/tool/ast/generate.dart:477-491 | pkg/analyzer/tool/ast/generate.dart:513-527 | pkg/analyzer/tool/ast/generate.dart:554-568 | pkg/analyzer/tool/ast/generate.dart:599-613 | pkg/analyzer/tool/ast/generate.dart:729-743 | pkg/analyzer/tool/ast/generate.dart:775-789 — 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 `pkg/analyzer/tool/ast/generate.dart:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 7) · ×1
  • Duplicated block (18 lines × 7) sdk/lib/internal/internal.dart:426 — sdk/lib/internal/internal.dart:426-443 | sdk/lib/internal/internal.dart:462-479 | sdk/lib/internal/internal.dart:500-517 | sdk/lib/internal/internal.dart:540-557 | sdk/lib/internal/internal.dart:582-599 | sdk/lib/internal/internal.dart:626-643 | sdk/lib/internal/internal.dart:672-689 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/internal/internal.dart:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18 lines × 6) · ×1
  • Duplicated block (18 lines × 6) pkg/front_end/lib/src/kernel/expression_generator.dart:1760 — pkg/front_end/lib/src/kernel/expression_generator.dart:1760-1777 | pkg/front_end/lib/src/kernel/expression_generator.dart:1970-1987 | pkg/front_end/lib/src/kernel/expression_generator.dart:2173-2190 | pkg/front_end/lib/src/kernel/expression_generator.dart:3720-3737 | pkg/front_end/lib/src/kernel/expression_generator.dart:4177-4195 | pkg/front_end/lib/src/kernel/expression_generator.dart:5415-5432 — 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 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 · Duplicated block (18 lines × 5) · ×1
  • Duplicated block (18 lines × 5) pkg/observatory/lib/src/elements/icdata_view.dart:114 — pkg/observatory/lib/src/elements/icdata_view.dart:114-131 | pkg/observatory/lib/src/elements/library_view.dart:136-153 | pkg/observatory/lib/src/elements/singletargetcache_view.dart:122-139 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:119-136 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:118-135 — before extracting anything, compare `pkg/observatory/lib/src/elements/icdata_view.dart` and `pkg/observatory/lib/src/elements/singletargetcache_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `pkg/observatory/lib/src/elements/icdata_view.dart:114` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) pkg/kernel/lib/src/tool/check_equivalence.dart:344 — pkg/kernel/lib/src/tool/check_equivalence.dart:344-361 | pkg/kernel/lib/src/tool/check_equivalence.dart:436-453 | pkg/kernel/lib/src/tool/check_equivalence.dart:460-477 | pkg/kernel/lib/src/tool/check_equivalence.dart:484-501 — 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 `pkg/kernel/lib/src/tool/check_equivalence.dart:344` 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 `node` to `Library` in one and `Class` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) pkg/front_end/lib/src/kernel/resolver.dart:387 — pkg/front_end/lib/src/kernel/resolver.dart:387-404 | pkg/front_end/lib/src/kernel/resolver.dart:675-691 | pkg/front_end/lib/src/kernel/resolver.dart:831-847 — 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 after the matched lines, `pkg/front_end/lib/src/kernel/resolver.dart:406` calls `createInternalThisVariable` and `pkg/front_end/lib/src/kernel/resolver.dart:848` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) pkg/kernel/lib/src/bounds_checks.dart:714 — pkg/kernel/lib/src/bounds_checks.dart:714-731 | pkg/kernel/lib/src/replacement_visitor.dart:352-365 — 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 `pkg/kernel/lib/src/bounds_checks.dart:714` 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.
D4 · Code Duplication · Duplicated block (17 lines × 8) · ×1
  • Duplicated block (17 lines × 8) sdk/lib/internal/internal.dart:393 — sdk/lib/internal/internal.dart:393-409 | sdk/lib/internal/internal.dart:427-443 | sdk/lib/internal/internal.dart:463-479 | sdk/lib/internal/internal.dart:501-517 | sdk/lib/internal/internal.dart:541-557 | sdk/lib/internal/internal.dart:583-599 | sdk/lib/internal/internal.dart:627-643 | sdk/lib/internal/internal.dart:673-689 — 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 `sdk/lib/internal/internal.dart:393` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) pkg/analyzer/lib/src/summary2/bundle_reader.dart:503 — pkg/analyzer/lib/src/summary2/bundle_reader.dart:503-519 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:585-601 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:658-674 | pkg/analyzer/lib/src/summary2/bundle_reader.dart:1114-1130 — 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 `pkg/analyzer/lib/src/summary2/bundle_reader.dart:503` 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, `pkg/analyzer/lib/src/summary2/bundle_reader.dart:502` calls `_readConstructorFragments` and `pkg/analyzer/lib/src/summary2/bundle_reader.dart:584` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–17 lines × 3) · ×1
  • Duplicated block (14–17 lines × 3) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:126 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:126-139 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:81-97 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart:70-86 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart: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.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) pkg/analyzer/lib/src/dart/sdk/sdk.dart:90 — pkg/analyzer/lib/src/dart/sdk/sdk.dart:90-106 | pkg/analyzer/lib/src/dart/sdk/sdk.dart:248-262 | pkg/analyzer/lib/src/dart/sdk/sdk.dart:515-529 — 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 `pkg/analyzer/lib/src/dart/sdk/sdk.dart: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.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) pkg/front_end/lib/src/fragment/getter/encoding.dart:283 — pkg/front_end/lib/src/fragment/getter/encoding.dart:283-298 | pkg/front_end/lib/src/fragment/method/encoding.dart:221-237 | pkg/front_end/lib/src/fragment/setter/encoding.dart:285-300 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) pkg/front_end/lib/src/type_inference/inference_visitor.dart:7071 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:7071-7084 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8691-8707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:8691` 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 `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.
D4 · Code Duplication · Duplicated block (16 lines × 14) · ×1
  • Duplicated block (16 lines × 14) sdk/lib/internal/internal.dart:237 — sdk/lib/internal/internal.dart:237-252 | sdk/lib/internal/internal.dart:259-274 | sdk/lib/internal/internal.dart:283-298 | sdk/lib/internal/internal.dart:309-324 | sdk/lib/internal/internal.dart:337-352 | sdk/lib/internal/internal.dart:367-382 | sdk/lib/internal/internal.dart:399-414 | sdk/lib/internal/internal.dart:433-448 | sdk/lib/internal/internal.dart:469-484 | sdk/lib/internal/internal.dart:507-522 | sdk/lib/internal/internal.dart:547-562 | sdk/lib/internal/internal.dart:589-604 | sdk/lib/internal/internal.dart:633-648 | sdk/lib/internal/internal.dart:679-694 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/internal/internal.dart:237` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/lib/internal/internal.dart:276` calls `combine` and `sdk/lib/internal/internal.dart:254` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–16 lines × 5) · ×1
  • Duplicated block (15–16 lines × 5) pkg/observatory/lib/src/elements/nav/notify_event.dart:91 — pkg/observatory/lib/src/elements/nav/notify_event.dart:91-105 | pkg/observatory/lib/src/elements/nav/notify_event.dart:108-122 | pkg/observatory/lib/src/elements/nav/notify_event.dart:149-164 | pkg/observatory/lib/src/elements/nav/notify_event.dart:168-183 | pkg/observatory/lib/src/elements/nav/notify_event.dart:186-200 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/observatory/lib/src/elements/nav/notify_event.dart:149` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `event` to `M.PauseStartEvent` in one and `M.PauseExitEvent` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:172 — pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:172-186 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:194-208 | pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:314-329 — 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 `pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_type_in_big_file.dart:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 8) · ×1
  • Duplicated block (15 lines × 8) pkg/front_end/lib/src/kernel/internal_ast.dart:2670 — pkg/front_end/lib/src/kernel/internal_ast.dart:2670-2684 | pkg/front_end/lib/src/kernel/internal_ast.dart:2863-2877 | pkg/front_end/lib/src/kernel/internal_ast.dart:3193-3207 | pkg/front_end/lib/src/kernel/internal_ast.dart:4440-4454 | pkg/front_end/lib/src/kernel/internal_ast.dart:4596-4610 | pkg/front_end/lib/src/kernel/internal_ast.dart:4739-4753 | pkg/front_end/lib/src/kernel/internal_ast.dart:4883-4897 | pkg/front_end/lib/src/kernel/internal_ast.dart:5011-5025 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/lib/src/kernel/internal_ast.dart:3191` calls `write` and `pkg/front_end/lib/src/kernel/internal_ast.dart:2669` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) pkg/analyzer/lib/src/lint/pub.dart:331 — pkg/analyzer/lib/src/lint/pub.dart:331-345 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:246-260 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:950-964 | pkg/front_end/lib/src/fragment/constructor/encoding.dart:1048-1062 | pkg/front_end/lib/src/kernel/resolver.dart:1482-1496 | pkg/front_end/lib/src/source/source_compilation_unit.dart:215-229 — there are 6 copies across 4 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 `pkg/analyzer/lib/src/lint/pub.dart:331` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) pkg/dart2wasm/lib/dynamic_dispatchers.dart:103 — pkg/dart2wasm/lib/dynamic_dispatchers.dart:103-117 | pkg/dart2wasm/lib/dynamic_dispatchers.dart:140-154 | pkg/dart2wasm/lib/dynamic_dispatchers.dart:184-195 — 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 `pkg/dart2wasm/lib/dynamic_dispatchers.dart:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 6) · ×1
  • Duplicated block (13–14 lines × 6) pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:135 — pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_files_in_flutter_set_subscriptions.dart:135-147 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart:93-105 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart:82-94 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_typing_temporary_missing_end_brace.dart:114-127 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_completion_after_change.dart:118-130 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/lsp_typing_temporarily_missing_end_brace_in_string_interpolation.dart:89-101 — before extracting anything, compare `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_get_fixes_and_get_assists_requests.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/legacy_many_hover_requests.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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 · Duplicated block (14 lines × 6) · ×1
  • Duplicated block (14 lines × 6) pkg/front_end/lib/src/fragment/getter/encoding.dart:392 — pkg/front_end/lib/src/fragment/getter/encoding.dart:392-405 | pkg/front_end/lib/src/fragment/getter/encoding.dart:693-706 | pkg/front_end/lib/src/fragment/method/encoding.dart:301-314 | pkg/front_end/lib/src/fragment/method/encoding.dart:656-669 | pkg/front_end/lib/src/fragment/setter/encoding.dart:397-410 | pkg/front_end/lib/src/fragment/setter/encoding.dart:725-738 — `pkg/front_end/lib/src/fragment/getter/encoding.dart` and `pkg/front_end/lib/src/fragment/method/encoding.dart` 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 12 separate duplicated blocks between them, totalling at least 247 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 `pkg/front_end/lib/src/fragment/getter/encoding.dart:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 5) · ×1
  • Duplicated block (13–14 lines × 5) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:224 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:224-237 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/map.dart:69-82 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/record.dart:105-118 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart:96-108 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart:210-223 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shapes/list.dart:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–14 lines × 5) · ×1
  • Duplicated block (12–14 lines × 5) pkg/observatory/lib/src/elements/heap_snapshot.dart:1068 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1068-1081 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1109-1122 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1132-1143 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1149-1162 | pkg/observatory/lib/src/elements/process_snapshot.dart:473-486 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:1068` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13 lines × 7) · ×1
  • Duplicated block (13 lines × 7) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1414 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1414-1426 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1495-1507 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1759-1771 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1955-1967 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2161-2173 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2347-2359 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7302-7314 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1414` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionTearOff` in one and `ExtensionGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12–13 lines × 6) · ×1
  • Duplicated block (12–13 lines × 6) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6425 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6425-6437 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6541-6553 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6789-6800 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6982-6993 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7188-7199 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7451-7462 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6425` it does not close everything it opens, so those 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 `node` to `IndexSet` in one and `SuperIndexSet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) pkg/analyzer/lib/src/fine/library_manifest.dart:2061 — pkg/analyzer/lib/src/fine/library_manifest.dart:2061-2073 | pkg/analyzer/lib/src/fine/library_manifest.dart:2087-2099 | pkg/analyzer/lib/src/fine/library_manifest.dart:2113-2125 | pkg/analyzer/lib/src/fine/library_manifest.dart:2139-2151 | pkg/analyzer/lib/src/fine/library_manifest.dart:2165-2177 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/analyzer/lib/src/fine/library_manifest.dart:2061` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 5) · ×1
  • Duplicated block (12–13 lines × 5) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1707 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1707-1718 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2460-2471 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8679-8691 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8879-8891 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9149-9161 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:389 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:389-401 | sdk/lib/_internal/js_runtime/lib/js_array.dart:493-505 | sdk/lib/collection/list.dart:390-400 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 `sdk/lib/_internal/js_dev_runtime/private/js_array.dart:389` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–13 lines × 3) · ×1
  • Duplicated block (10–13 lines × 3) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1751 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1751-1760 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2663-2675 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2752-2764 — 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 `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1751` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420-1431 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1501-1512 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1765-1776 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:1961-1972 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2051-2062 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2167-2178 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:2353-2364 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/lib/src/type_inference/inference_visitor.dart:1420` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ExtensionTearOff` in one and `ExtensionGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–12 lines × 7) · ×1
  • Duplicated block (10–12 lines × 7) pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:161 — pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:161-172 | pkg/observatory/lib/src/elements/cpu_profile/virtual_tree.dart:182-193 | pkg/observatory/lib/src/elements/heap_snapshot.dart:972-981 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1053-1062 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1080-1089 | pkg/observatory/lib/src/elements/process_snapshot.dart:458-467 | pkg/observatory/lib/src/elements/process_snapshot.dart:485-494 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 before the matched lines, `pkg/observatory/lib/src/elements/heap_snapshot.dart:1077` calls `HTMLSpanElement` and `pkg/observatory/lib/src/elements/process_snapshot.dart:484` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) pkg/observatory/lib/src/elements/instance_view.dart:355 — pkg/observatory/lib/src/elements/instance_view.dart:355-365 | pkg/observatory/lib/src/elements/instance_view.dart:391-402 | pkg/observatory/lib/src/elements/instance_view.dart:430-441 | pkg/observatory/lib/src/elements/instance_view.dart:496-507 — 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 `pkg/observatory/lib/src/elements/instance_view.dart:355` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 10) · ×1
  • Duplicated block (11 lines × 10) pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:19 — pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/do_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/function_declaration.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/if_else_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/switch_expression.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/switch_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/try_catch_statement.dart:19-29 | pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart:19-29 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/analysis_server/lib/src/services/snippets/dart/try_catch_statement.dart:30` calls `writeIndentedln`, `writeln` and `pkg/analysis_server/lib/src/services/snippets/dart/do_statement.dart:30` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) pkg/dartdev/lib/src/commands/compile.dart:161 — pkg/dartdev/lib/src/commands/compile.dart:161-171 | pkg/dartdev/lib/src/commands/compile.dart:216-226 | pkg/dartdev/lib/src/commands/dart_mcp_server.dart:56-66 | pkg/dartdev/lib/src/commands/development_service.dart:49-59 | pkg/dartdev/lib/src/commands/tooling_daemon.dart:43-53 — before extracting anything, compare `pkg/dartdev/lib/src/commands/development_service.dart` and `pkg/dartdev/lib/src/commands/tooling_daemon.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 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 `pkg/dartdev/lib/src/commands/compile.dart:161` 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:266 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:266-274 | sdk/lib/_internal/js_runtime/lib/js_array.dart:366-376 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 · Duplicated block (2–11 lines × 4) · ×1
  • Duplicated block (2–11 lines × 4) sdk/lib/_internal/wasm/common/typed_data.dart:623 — sdk/lib/_internal/wasm/common/typed_data.dart:623-624 | sdk/lib/_internal/wasm/common/typed_data.dart:698-708 | sdk/lib/_internal/wasm/common/typed_data.dart:778-779 | sdk/lib/_internal/wasm/common/typed_data.dart:854-864 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 12) · ×1
  • Duplicated block (9–10 lines × 12) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6431 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6431-6439 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6547-6555 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6794-6802 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6916-6925 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:6987-6995 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7127-7136 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7193-7201 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7387-7396 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7456-7464 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8528-8537 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8737-8746 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:8995-9004 — all 12 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6913` calls `Function`, `whyNotPromoted`, `getExpressionInfo` and `pkg/front_end/lib/src/type_inference/inference_visitor.dart:7125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:29 — pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:29-38 | pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:29-38 | pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart:29-38 | pkg/analysis_server/lib/src/services/snippets/dart/test_definition.dart:33-42 | pkg/analysis_server/lib/src/services/snippets/dart/test_group_definition.dart:31-40 | pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart:29-38 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:29` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) pkg/front_end/lib/src/type_inference/inference_visitor.dart:6827 — pkg/front_end/lib/src/type_inference/inference_visitor.dart:6827-6835 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:7545-7551 | pkg/front_end/lib/src/type_inference/inference_visitor.dart:9161-9170 — 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 `pkg/front_end/lib/src/type_inference/inference_visitor.dart:6827` 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 `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.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) pkg/dart2wasm/lib/code_generator.dart:3317 — pkg/dart2wasm/lib/code_generator.dart:3317-3326 | pkg/dart2wasm/lib/code_generator.dart:3335-3341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dart2wasm/lib/code_generator.dart:3317` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `RecordIndexGet` in one and `RecordNameGet` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:278 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:278-285 | sdk/lib/_internal/js_runtime/lib/js_array.dart:380-389 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 · Duplicated block (9 lines × 9) · ×1
  • Duplicated block (9 lines × 9) sdk/lib/_internal/wasm/js_common/js_typed_array.dart:884 — sdk/lib/_internal/wasm/js_common/js_typed_array.dart:884-892 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1002-1010 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1119-1127 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1228-1236 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1349-1357 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1475-1483 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1599-1607 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1793-1801 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1897-1905 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/lib/_internal/wasm/js_common/js_typed_array.dart:884` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) pkg/analyzer/lib/src/fine/manifest_item.dart:83 — pkg/analyzer/lib/src/fine/manifest_item.dart:83-91 | pkg/analyzer/lib/src/fine/manifest_item.dart:273-281 | pkg/analyzer/lib/src/fine/manifest_item.dart:380-388 | pkg/analyzer/lib/src/fine/manifest_item.dart:464-472 | pkg/analyzer/lib/src/fine/manifest_item.dart:1323-1331 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) pkg/observatory/lib/src/elements/library_view.dart:215 — pkg/observatory/lib/src/elements/library_view.dart:215-223 | pkg/observatory/lib/src/elements/library_view.dart:249-256 | pkg/observatory/lib/src/elements/library_view.dart:274-281 | pkg/observatory/lib/src/elements/library_view.dart:342-349 — 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 `pkg/observatory/lib/src/elements/library_view.dart:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) pkg/observatory/lib/src/elements/class_tree.dart:144 — pkg/observatory/lib/src/elements/class_tree.dart:144-150 | pkg/observatory/lib/src/elements/heap_snapshot.dart:996-1004 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1023-1031 — 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 `pkg/observatory/lib/src/elements/class_tree.dart: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 15) · ×1
  • Duplicated block (8 lines × 15) sdk/lib/internal/internal.dart:227 — sdk/lib/internal/internal.dart:227-234 | sdk/lib/internal/internal.dart:248-255 | sdk/lib/internal/internal.dart:271-278 | sdk/lib/internal/internal.dart:296-303 | sdk/lib/internal/internal.dart:323-330 | sdk/lib/internal/internal.dart:352-359 | sdk/lib/internal/internal.dart:383-390 | sdk/lib/internal/internal.dart:416-423 | sdk/lib/internal/internal.dart:451-458 | sdk/lib/internal/internal.dart:488-495 | sdk/lib/internal/internal.dart:527-534 | sdk/lib/internal/internal.dart:568-575 | sdk/lib/internal/internal.dart:611-618 | sdk/lib/internal/internal.dart:656-663 | sdk/lib/internal/internal.dart:703-710 — all 15 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 `sdk/lib/internal/internal.dart:227` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sdk/lib/internal/internal.dart:269` calls `combine` and `sdk/lib/internal/internal.dart:246` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 15) · ×1
  • Duplicated block (7–8 lines × 15) sdk/lib/internal/internal.dart:226 — sdk/lib/internal/internal.dart:226-232 | sdk/lib/internal/internal.dart:245-252 | sdk/lib/internal/internal.dart:267-274 | sdk/lib/internal/internal.dart:291-298 | sdk/lib/internal/internal.dart:317-324 | sdk/lib/internal/internal.dart:345-352 | sdk/lib/internal/internal.dart:375-382 | sdk/lib/internal/internal.dart:407-414 | sdk/lib/internal/internal.dart:441-448 | sdk/lib/internal/internal.dart:477-484 | sdk/lib/internal/internal.dart:515-522 | sdk/lib/internal/internal.dart:555-562 | sdk/lib/internal/internal.dart:597-604 | sdk/lib/internal/internal.dart:641-648 | sdk/lib/internal/internal.dart:687-694 — all 15 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 `sdk/lib/internal/internal.dart:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/lib/internal/internal.dart:253` calls `combine` and `sdk/lib/internal/internal.dart:233` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) pkg/front_end/lib/src/source/outline_builder.dart:2083 — pkg/front_end/lib/src/source/outline_builder.dart:2083-2089 | pkg/front_end/lib/src/source/outline_builder.dart:2417-2423 | pkg/front_end/lib/src/source/outline_builder.dart:2634-2641 — 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, `pkg/front_end/lib/src/source/outline_builder.dart:2080` calls `pop` and `pkg/front_end/lib/src/source/outline_builder.dart:2414` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) pkg/dev_compiler/lib/src/kernel/compiler.dart:5851 — pkg/dev_compiler/lib/src/kernel/compiler.dart:5851-5857 | pkg/dev_compiler/lib/src/kernel/compiler_new.dart:6506-6511 — before extracting anything, compare `pkg/dev_compiler/lib/src/kernel/compiler.dart` and `pkg/dev_compiler/lib/src/kernel/compiler_new.dart` as WHOLE FILES: this scan already matched 154 separate duplicated blocks between them, totalling at least 3489 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 `pkg/dev_compiler/lib/src/kernel/compiler.dart:5851` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–6 lines × 14) · ×1
  • Duplicated block (5–6 lines × 14) pkg/observatory/lib/src/elements/allocation_profile.dart:106 — pkg/observatory/lib/src/elements/allocation_profile.dart:106-111 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:100-105 | pkg/observatory/lib/src/elements/heap_map.dart:100-105 | pkg/observatory/lib/src/elements/heap_snapshot.dart:513-517 | pkg/observatory/lib/src/elements/icdata_view.dart:92-96 | pkg/observatory/lib/src/elements/logging.dart:77-81 | pkg/observatory/lib/src/elements/megamorphiccache_view.dart:96-100 | pkg/observatory/lib/src/elements/metrics.dart:78-82 | pkg/observatory/lib/src/elements/object_view.dart:87-91 | pkg/observatory/lib/src/elements/objectpool_view.dart:94-98 | pkg/observatory/lib/src/elements/ports.dart:82-87 | pkg/observatory/lib/src/elements/singletargetcache_view.dart:97-101 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:94-98 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:93-97 — before extracting anything, compare `pkg/observatory/lib/src/elements/icdata_view.dart` and `pkg/observatory/lib/src/elements/singletargetcache_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `pkg/observatory/lib/src/elements/allocation_profile.dart:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) pkg/observatory/lib/src/elements/allocation_profile.dart:104 — pkg/observatory/lib/src/elements/allocation_profile.dart:104-109 | pkg/observatory/lib/src/elements/class_tree.dart:74-79 | pkg/observatory/lib/src/elements/megamorphiccache_view.dart:94-99 | pkg/observatory/lib/src/elements/metrics.dart:76-81 | pkg/observatory/lib/src/elements/object_view.dart:85-90 | pkg/observatory/lib/src/elements/objectpool_view.dart:92-97 | pkg/observatory/lib/src/elements/script_view.dart:96-101 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:92-97 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:91-96 — before extracting anything, compare `pkg/observatory/lib/src/elements/megamorphiccache_view.dart` and `pkg/observatory/lib/src/elements/objectpool_view.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 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 `pkg/observatory/lib/src/elements/allocation_profile.dart:104` it does not close everything it opens, so those 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, `pkg/observatory/lib/src/elements/allocation_profile.dart:101` calls `cancel` and `pkg/observatory/lib/src/elements/megamorphiccache_view.dart:91` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 8) · ×1
  • Duplicated block (6 lines × 8) sdk/lib/_internal/vm_shared/lib/compact_hash.dart:642 — sdk/lib/_internal/vm_shared/lib/compact_hash.dart:642-647 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:680-685 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1097-1102 | sdk/lib/_internal/vm_shared/lib/compact_hash.dart:1125-1130 | sdk/lib/_internal/wasm/common/compact_hash.dart:607-612 | sdk/lib/_internal/wasm/common/compact_hash.dart:637-642 | sdk/lib/_internal/wasm/common/compact_hash.dart:1017-1022 | sdk/lib/_internal/wasm/common/compact_hash.dart:1046-1051 — before extracting anything, compare `sdk/lib/_internal/vm_shared/lib/compact_hash.dart` and `sdk/lib/_internal/wasm/common/compact_hash.dart` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 194 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 `key` to `K` in one and `E` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:28 — pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:28-33 | pkg/analysis_server/lib/src/services/snippets/dart/for_statement.dart:28-33 | pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart:28-33 | pkg/analysis_server/lib/src/services/snippets/dart/switch_expression.dart:28-33 | pkg/analysis_server/lib/src/services/snippets/dart/test_definition.dart:32-37 | pkg/analysis_server/lib/src/services/snippets/dart/test_group_definition.dart:30-35 | pkg/analysis_server/lib/src/services/snippets/dart/while_statement.dart:28-33 — before extracting anything, compare `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart` and `pkg/analysis_server/lib/src/services/snippets/dart/if_statement.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `pkg/analysis_server/lib/src/services/snippets/dart/class_declaration.dart:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–6 lines × 7) · ×1
  • Duplicated block (5–6 lines × 7) pkg/observatory/lib/src/elements/heap_snapshot.dart:1245 — pkg/observatory/lib/src/elements/heap_snapshot.dart:1245-1249 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1272-1276 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1303-1307 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1341-1346 | pkg/observatory/lib/src/elements/heap_snapshot.dart:1373-1378 | pkg/observatory/lib/src/elements/process_snapshot.dart:509-513 | pkg/observatory/lib/src/elements/process_snapshot.dart:541-545 — before extracting anything, compare `pkg/observatory/lib/src/elements/heap_snapshot.dart` and `pkg/observatory/lib/src/elements/process_snapshot.dart` as WHOLE FILES: this scan already matched 13 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. 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 `pkg/observatory/lib/src/elements/heap_snapshot.dart:1245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–6 lines × 9) · ×1
  • Duplicated block (3–6 lines × 9) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:157 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:157-159 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:233-235 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:309-314 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:172-174 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:260-262 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:347-352 | sdk/lib/_internal/wasm/common/simd.dart:26-28 | sdk/lib/_internal/wasm/common/simd.dart:130-132 | sdk/lib/_internal/wasm/common/simd.dart:236-241 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 295 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 `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 11) · ×1
  • Duplicated block (5 lines × 11) pkg/observatory/lib/src/elements/allocation_profile.dart:106 — pkg/observatory/lib/src/elements/allocation_profile.dart:106-110 | pkg/observatory/lib/src/elements/class_tree.dart:76-80 | pkg/observatory/lib/src/elements/cpu_profile_table.dart:100-104 | pkg/observatory/lib/src/elements/heap_snapshot.dart:513-517 | pkg/observatory/lib/src/elements/logging.dart:77-81 | pkg/observatory/lib/src/elements/megamorphiccache_view.dart:96-100 | pkg/observatory/lib/src/elements/metrics.dart:78-82 | pkg/observatory/lib/src/elements/object_view.dart:87-91 | pkg/observatory/lib/src/elements/objectpool_view.dart:94-98 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:94-98 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:93-97 — before extracting anything, compare `pkg/observatory/lib/src/elements/megamorphiccache_view.dart` and `pkg/observatory/lib/src/elements/objectpool_view.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 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 `pkg/observatory/lib/src/elements/allocation_profile.dart:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/observatory/lib/src/elements/logging.dart:74` calls `LoggingListElement` and `pkg/observatory/lib/src/elements/class_tree.dart:74` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–5 lines × 14) · ×1
  • Duplicated block (4–5 lines × 14) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:160 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:160-164 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:201-204 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:236-240 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:277-280 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:175-179 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:216-219 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:263-267 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:304-307 | sdk/lib/_internal/wasm/common/simd.dart:29-33 | sdk/lib/_internal/wasm/common/simd.dart:66-69 | sdk/lib/_internal/wasm/common/simd.dart:133-137 | sdk/lib/_internal/wasm/common/simd.dart:170-173 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:1712-1715 | sdk/lib/_internal/wasm/js_common/js_typed_array.dart:2625-2628 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 295 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 `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (29 lines × 6) · ×1
  • Duplicated block (29 lines × 6) pkg/observatory/lib/src/elements/context_view.dart:48 — pkg/observatory/lib/src/elements/context_view.dart:48-76 | pkg/observatory/lib/src/elements/icdata_view.dart:45-73 | pkg/observatory/lib/src/elements/megamorphiccache_view.dart:48-76 | pkg/observatory/lib/src/elements/objectpool_view.dart:47-75 | pkg/observatory/lib/src/elements/subtypetestcache_view.dart:46-74 | pkg/observatory/lib/src/elements/unlinkedcall_view.dart:46-74 — before extracting anything, compare `pkg/observatory/lib/src/elements/icdata_view.dart` and `pkg/observatory/lib/src/elements/subtypetestcache_view.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 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.
D4 · Code Duplication · Duplicated block (2594 lines × 2) · ×1
  • Duplicated block (2594 lines × 2) pkg/_fe_analyzer_shared/lib/src/scanner/token.dart:46 — pkg/_fe_analyzer_shared/lib/src/scanner/token.dart:46-2651 | pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/token.dart:309-2902 — before extracting anything, compare `pkg/_fe_analyzer_shared/lib/src/scanner/token.dart` and `pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/token.dart` 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. 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 `pkg/_fe_analyzer_shared/lib/src/scanner/token.dart:46` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (344 lines × 2) · ×1
  • Duplicated block (344 lines × 2) pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart:3 — pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart:3-346 | pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods_2.dart:2-345 — before extracting anything, compare `pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart` and `pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods_2.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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. 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 · Duplicated block (60 lines × 4) · ×1
  • Duplicated block (60 lines × 4) pkg/front_end/testcases/augmentations/class_declarations.dart:7 — pkg/front_end/testcases/augmentations/class_declarations.dart:7-66 | pkg/front_end/testcases/augmentations/enum_declarations.dart:9-70 | pkg/front_end/testcases/augmentations/extension_type_declarations.dart:7-66 | pkg/front_end/testcases/augmentations/mixin_declarations.dart:7-66 — before extracting anything, compare `pkg/front_end/testcases/augmentations/class_declarations.dart` and `pkg/front_end/testcases/augmentations/enum_declarations.dart` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/front_end/testcases/augmentations/class_declarations.dart:7` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (19 lines × 6) · ×1
  • Duplicated block (19 lines × 6) pkg/front_end/testcases/dart2js/mixin_super/main.dart:16 — pkg/front_end/testcases/dart2js/mixin_super/main.dart:16-34 | pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart:6-44 | pkg/front_end/testcases/dartdevc/mixin_super/main.dart:16-34 | pkg/front_end/testcases/dartdevc/mixin_super/main_lib.dart:6-44 | pkg/front_end/testcases/general/mixin_super/main.dart:16-34 | pkg/front_end/testcases/general/mixin_super/main_lib.dart:6-44 — before extracting anything, compare `pkg/front_end/testcases/dart2js/mixin_super/main.dart` and `pkg/front_end/testcases/dartdevc/mixin_super/main.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (39 lines × 3) · ×1
  • Duplicated block (39 lines × 3) pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart:6 — pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart:6-44 | pkg/front_end/testcases/dartdevc/mixin_super/main_lib.dart:6-44 | pkg/front_end/testcases/general/mixin_super/main_lib.dart:6-44 — before extracting anything, compare `pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart` and `pkg/front_end/testcases/dartdevc/mixin_super/main_lib.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/front_end/testcases/dart2js/mixin_super/main_lib.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart:6 — pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart:6-64 | pkg/front_end/testcases/nnbd/null_shorting_extension.dart:6-64 — 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 `pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart:6` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (31 lines × 5) · ×1
  • Duplicated block (31 lines × 5) pkg/vm/testcases/transformations/dynamic_interface_annotator/lib1.dart:9 — pkg/vm/testcases/transformations/dynamic_interface_annotator/lib1.dart:9-101 | pkg/vm/testcases/transformations/dynamic_interface_annotator/lib2.dart:9-81 | pkg/vm/testcases/transformations/dynamic_interface_annotator/lib3.dart:9-62 | pkg/vm/testcases/transformations/dynamic_interface_annotator/prefix/lib1.dart:9-39 | pkg/vm/testcases/transformations/dynamic_interface_annotator/prefix/lib2.dart:9-39 — before extracting anything, compare `pkg/vm/testcases/transformations/dynamic_interface_annotator/lib1.dart` and `pkg/vm/testcases/transformations/dynamic_interface_annotator/prefix/lib1.dart` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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 `pkg/vm/testcases/transformations/dynamic_interface_annotator/lib1.dart:9` 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.
D4 · Code Duplication · Duplicated block (7 lines × 13) · ×1
  • Duplicated block (7 lines × 13) pkg/kernel/lib/src/ast/libraries.dart:484 — pkg/kernel/lib/src/ast/libraries.dart:484-490 | pkg/kernel/lib/src/ast/libraries.dart:569-575 | pkg/kernel/lib/src/ast/types.dart:533-539 | pkg/kernel/lib/src/ast/types.dart:2755-2761 | pkg/kernel/lib/src/ast/variables.dart:218-224 | pkg/kernel/lib/src/ast/variables.dart:478-484 | pkg/kernel/lib/src/ast/variables.dart:745-751 | pkg/kernel/lib/src/ast/variables.dart:1010-1016 | pkg/kernel/lib/src/ast/variables.dart:1277-1283 | pkg/kernel/lib/src/ast/variables.dart:1734-1740 | pkg/kernel/lib/src/ast/variables.dart:1844-1850 | pkg/kernel/lib/src/ast/variables.dart:1927-1933 | pkg/kernel/lib/src/ast/variables.dart:2155-2161 — there are 13 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 13 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:91 — sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart:91-95 | sdk/lib/_internal/js_runtime/lib/collection_patch.dart:119-123 | sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart:78-82 | sdk/lib/_internal/vm_shared/lib/collection_patch.dart:137-141 | sdk/lib/collection/maps.dart:39-43 | sdk/lib/collection/splay_tree.dart:612-616 — before extracting anything, compare `sdk/lib/_internal/js_runtime/lib/collection_patch.dart` and `sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart` as WHOLE FILES: this scan already matched 8 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. 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 · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) sdk/lib/_internal/js_dev_runtime/private/js_array.dart:358 — sdk/lib/_internal/js_dev_runtime/private/js_array.dart:358-362 | sdk/lib/_internal/js_runtime/lib/js_array.dart:467-471 | sdk/lib/_internal/vm/lib/array.dart:60-64 | sdk/lib/_internal/vm/lib/typed_data_patch.dart:479-483 | sdk/lib/_internal/wasm/common/typed_data.dart:2270-2274 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/js_array.dart` and `sdk/lib/_internal/js_runtime/lib/js_array.dart` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 180 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 · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) pkg/_fe_analyzer_shared/lib/src/exhaustiveness/key.dart:27 — pkg/_fe_analyzer_shared/lib/src/exhaustiveness/key.dart:27-31 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/key.dart:66-70 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/key.dart:99-103 | pkg/_fe_analyzer_shared/lib/src/exhaustiveness/key.dart:175-179 | pkg/front_end/lib/src/type_inference/matching_cache.dart:757-761 | pkg/front_end/lib/src/type_inference/matching_cache.dart:777-781 | pkg/front_end/lib/src/type_inference/matching_cache.dart:797-801 | pkg/front_end/lib/src/type_inference/matching_cache.dart:860-864 | pkg/front_end/lib/src/type_inference/matching_cache.dart:880-884 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart. 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 · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) pkg/kernel/lib/src/ast/constants.dart:39 — pkg/kernel/lib/src/ast/constants.dart:39-43 | pkg/kernel/lib/src/ast/constants.dart:124-129 | pkg/kernel/lib/src/ast/expressions.dart:61-65 | pkg/kernel/lib/src/ast/expressions.dart:219-224 | pkg/kernel/lib/src/ast/functions.dart:47-52 | pkg/kernel/lib/src/ast/functions.dart:239-244 | pkg/kernel/lib/src/ast/types.dart:53-57 | pkg/kernel/lib/src/ast/types.dart:143-147 — before extracting anything, compare `pkg/kernel/lib/src/ast/constants.dart` and `pkg/kernel/lib/src/ast/expressions.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `t1` to `DartType` in one and `NamedType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5 lines × 10) · ×1
  • Duplicated block (5 lines × 10) sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:887 — sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:887-891 | sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:927-931 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1066-1070 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1114-1118 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1167-1171 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1220-1224 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1273-1277 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1329-1333 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1382-1386 | sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1511-1515 — before extracting anything, compare `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart` and `sdk/lib/_internal/js_runtime/lib/native_typed_data.dart` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 295 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 `sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart:887` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (46 lines × 5) · ×1
  • Duplicated block (46 lines × 5) pkg/analysis_server/PRESUBMIT.py:35 — pkg/analysis_server/PRESUBMIT.py:35-80 | pkg/analyzer/PRESUBMIT.py:36-81 | pkg/analyzer_cli/PRESUBMIT.py:35-80 | pkg/analyzer_plugin/PRESUBMIT.py:35-80 | pkg/linter/PRESUBMIT.py:35-80 — `pkg/analysis_server/PRESUBMIT.py` and `pkg/analyzer/PRESUBMIT.py` 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 64 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. 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 · Duplicated block (4–32 lines × 6) · ×1
  • Duplicated block (4–32 lines × 6) PRESUBMIT.py:200 — PRESUBMIT.py:200-203 | pkg/_fe_analyzer_shared/PRESUBMIT.py:36-67 | pkg/front_end/PRESUBMIT.py:36-67 | pkg/frontend_server/PRESUBMIT.py:36-67 | pkg/kernel/PRESUBMIT.py:36-67 | sdk/lib/PRESUBMIT.py:48-77 — `pkg/_fe_analyzer_shared/PRESUBMIT.py` and `pkg/front_end/PRESUBMIT.py` 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 2 separate duplicated blocks between them, totalling at least 42 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) runtime/tools/dartfuzz/minimize.py:265 — runtime/tools/dartfuzz/minimize.py:265-285 | runtime/tools/dartfuzz/minimize.py:293-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6–8 lines × 6) · ×1
  • Duplicated block (6–8 lines × 6) PRESUBMIT.py:110 — PRESUBMIT.py:110-117 | pkg/analysis_server/PRESUBMIT.py:34-39 | pkg/analyzer/PRESUBMIT.py:35-40 | pkg/analyzer_cli/PRESUBMIT.py:34-39 | pkg/analyzer_plugin/PRESUBMIT.py:34-39 | pkg/linter/PRESUBMIT.py:34-39 — `pkg/analysis_server/PRESUBMIT.py` and `pkg/analyzer/PRESUBMIT.py` 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 64 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.
D4 · Code Duplication · Duplicated block (10 lines × 13) · ×1
  • Duplicated block (10 lines × 13) PRESUBMIT.py:97 — PRESUBMIT.py:97-106 | pkg/_fe_analyzer_shared/PRESUBMIT.py:20-29 | pkg/analysis_server/PRESUBMIT.py:21-30 | pkg/analyzer/PRESUBMIT.py:22-31 | pkg/analyzer_cli/PRESUBMIT.py:21-30 | pkg/analyzer_plugin/PRESUBMIT.py:21-30 | pkg/front_end/PRESUBMIT.py:20-29 | pkg/frontend_server/PRESUBMIT.py:20-29 | pkg/kernel/PRESUBMIT.py:20-29 | pkg/linter/PRESUBMIT.py:21-30 | sdk/lib/PRESUBMIT.py:20-29 | tools/bots/bot_utils.py:19-28 | tools/utils.py:118-127 — `pkg/_fe_analyzer_shared/PRESUBMIT.py` and `pkg/front_end/PRESUBMIT.py` 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 2 separate duplicated blocks between them, totalling at least 42 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. 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.
D4 · Code Duplication · Edited copies of one member (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) REDACTED:1679 — REDACTED:1679-1733 | REDACTED:1890-1936 | REDACTED:2028-2071 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) pkg/compiler/tool/modular_test_suite_helper.dart:377 — pkg/compiler/tool/modular_test_suite_helper.dart:377-391 | pkg/compiler/tool/modular_test_suite_helper.dart:443-456 | pkg/compiler/tool/modular_test_suite_helper.dart:506-519 | pkg/compiler/tool/modular_test_suite_helper.dart:571-584 — 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 `pkg/compiler/tool/modular_test_suite_helper.dart:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) pkg/test_runner/lib/src/browser_controller.dart:1205 — pkg/test_runner/lib/src/browser_controller.dart:1205-1215 | pkg/test_runner/lib/src/browser_controller.dart:1230-1243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/test_runner/lib/src/browser_controller.dart:1205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) pkg/test_runner/lib/src/command_output.dart:798 — pkg/test_runner/lib/src/command_output.dart:798-806 | pkg/test_runner/lib/src/command_output.dart:1135-1145 | pkg/test_runner/lib/src/command_output.dart:1498-1508 — 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 `pkg/test_runner/lib/src/command_output.dart:798` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) tools/dom/scripts/css_code_generator.py:83 — tools/dom/scripts/css_code_generator.py:83-93 | tools/dom/scripts/prototype_css_generator.py:81-88 — 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.
IC1 · Incompleteness & stubs · Skeleton type · ×1
  • Skeleton type — most members are unfinished pkg/front_end/testcases/general/erroneously_initialized_parameters.dart:36 — `EN` has 4 unfinished members out of 4 declared methods (whether or not each carries a body) — a scaffolded class that was never implemented.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `scorecards-analysis.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 22 plain JS — the untyped files are pkg/compiler/tool/used_names/used_names.js, pkg/dartpad/asset/sandbox_flutter_patch.js, pkg/dartpad/lib/src/asset/shared-worker.js, pkg/dartpad_worker/lib/src/asset/devtools.js, REDACTED, pkg/dartpad_worker/lib/src/asset/worker.js (+16 more).
R10 · Code Duplication · Wholesale file copy (189 identical lines × 3 files) · ×1
  • Wholesale file copy (189 identical lines × 3 files) sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js:10 — sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js:10 · sdk/lib/_internal/js_runtime/lib/preambles/d8.js:10 · sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js:7 — these 3 files are line-for-line copies of one another — 189 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 (36 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (36 matched lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:387 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:387 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:572 — the two spans are one implementation copied and then locally edited — 324 tokens are still identical, in the same order in both spans, 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.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:884 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:884 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:500 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:500 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (15 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (15 matched lines × 2 locations) REDACTED:635 — REDACTED:635 · REDACTED:677 — the two spans are one implementation copied and then locally edited — 57 tokens are still identical, in the same order in both spans, 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.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:1768 — runtime/tools/graphexplorer/graphexplorer.js:1768 · runtime/tools/graphexplorer/graphexplorer.js:1813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) REDACTED:879 — REDACTED:879 · REDACTED:1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:1446 — runtime/tools/graphexplorer/graphexplorer.js:1446 · runtime/tools/graphexplorer/graphexplorer.js:1943 — all 2 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:521 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:521 · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (10 lines × 3 locations) · ×1
  • Duplicated block (10 lines × 3 locations) runtime/tools/graphexplorer/graphexplorer.js:1682 — runtime/tools/graphexplorer/graphexplorer.js:1682 · runtime/tools/graphexplorer/graphexplorer.js:1695 · runtime/tools/graphexplorer/graphexplorer.js:1709 — all 3 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (9 lines × 6 locations) · ×1
  • Duplicated block (9 lines × 6 locations) runtime/tools/graphexplorer/graphexplorer.js:326 — runtime/tools/graphexplorer/graphexplorer.js:326 · runtime/tools/graphexplorer/graphexplorer.js:378 · runtime/tools/graphexplorer/graphexplorer.js:573 · runtime/tools/graphexplorer/graphexplorer.js:699 · +2 more site(s) not listed — all 6 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (8 lines × 3 locations) · ×1
  • Duplicated block (8 lines × 3 locations) REDACTED:405 — REDACTED:405 · REDACTED:879 · REDACTED:1246 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×1
  • Duplicated block (8 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:1212 — runtime/tools/graphexplorer/graphexplorer.js:1212 · runtime/tools/graphexplorer/graphexplorer.js: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.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) runtime/tools/graphexplorer/graphexplorer.js:1797 — runtime/tools/graphexplorer/graphexplorer.js:1797 · runtime/tools/graphexplorer/graphexplorer.js:1805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R2 · Cyclomatic Complexity · Complex function onRcpMessage (cyclomatic 22, cognitive 34) · ×1
  • Complex function onRcpMessage (cyclomatic 22, cognitive 34) REDACTED:76 — onRcpMessage has cyclomatic complexity 22 and cognitive complexity 34; 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 loadDartHeapSnapshot (cyclomatic 21, cognitive 23) · ×1
  • Complex function loadDartHeapSnapshot (cyclomatic 21, cognitive 23) runtime/tools/graphexplorer/graphexplorer.js:155 — loadDartHeapSnapshot has cyclomatic complexity 21 and cognitive complexity 23; 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 rewriteEdgesForOwners (cyclomatic 19, cognitive 29) · ×1
  • Complex function rewriteEdgesForOwners (cyclomatic 19, cognitive 29) runtime/tools/graphexplorer/graphexplorer.js:381 — rewriteEdgesForOwners has cyclomatic complexity 19 and cognitive complexity 29; 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 createTreemapTile (cyclomatic 17, cognitive 34) · ×1
  • Complex function createTreemapTile (cyclomatic 17, cognitive 34) runtime/tools/graphexplorer/graphexplorer.js:1279 — createTreemapTile has cyclomatic complexity 17 and cognitive complexity 34; 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 _clone (cyclomatic 17, cognitive 28) · ×1
  • Complex function _clone (cyclomatic 17, cognitive 28) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:286 — _clone has cyclomatic complexity 17 and cognitive complexity 28; 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 hotRestart (cyclomatic 17, cognitive 22) · ×1
  • Complex function hotRestart (cyclomatic 17, cognitive 22) REDACTED:481 — hotRestart has cyclomatic complexity 17 and cognitive complexity 22; 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 _showInfoBox (cyclomatic 16, cognitive 29) · ×1
  • Complex function _showInfoBox (cyclomatic 16, cognitive 29) pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:774 — _showInfoBox has cyclomatic complexity 16 and cognitive complexity 29; 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 start (cyclomatic 15, cognitive 26) · ×1
  • Complex function start (cyclomatic 15, cognitive 26) REDACTED:652 — start has cyclomatic complexity 15 and cognitive complexity 26; 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 safeSerialize (cyclomatic 14, cognitive 17) · ×1
  • Complex function safeSerialize (cyclomatic 14, cognitive 17) REDACTED:367 — safeSerialize has cyclomatic complexity 14 and cognitive complexity 17; 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 load (cyclomatic 12, cognitive 14) · ×1
  • Complex function load (cyclomatic 12, cognitive 14) REDACTED:214 — load has cyclomatic complexity 12 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 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 computeDominators (cyclomatic 11, cognitive 23) · ×1
  • Complex function computeDominators (cyclomatic 11, cognitive 23) runtime/tools/graphexplorer/graphexplorer.js:576 — computeDominators has cyclomatic complexity 11 and cognitive complexity 23; 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 computeOwnedSizes (cyclomatic 11, cognitive 20) · ×1
  • Complex function computeOwnedSizes (cyclomatic 11, cognitive 20) runtime/tools/graphexplorer/graphexplorer.js:702 — computeOwnedSizes has cyclomatic complexity 11 and cognitive complexity 20; 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.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2137 lines of code REDACTED:1 — REDACTED has 2137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/tools/graphexplorer/graphexplorer.js · ×1
  • runtime/tools/graphexplorer/graphexplorer.js: 1749 lines of code runtime/tools/graphexplorer/graphexplorer.js:1 — runtime/tools/graphexplorer/graphexplorer.js has 1749 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js · ×1
  • pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js: 887 lines of code pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js:1 — pkg/vm_snapshot_analysis/lib/src/assets/D3SymbolTreeMap.js has 887 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 783 lines of code REDACTED:1 — REDACTED has 783 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 666 lines of code REDACTED:1 — REDACTED has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~2336 LoC) · ×1
  • Dead file (~2336 LoC) REDACTED — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~739 LoC) · ×1
  • Dead file (~739 LoC) REDACTED — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~349 LoC) · ×1
  • Dead file (~349 LoC) sdk/lib/_internal/js_dev_runtime/private/preambles/d8.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~147 LoC) · ×1
  • Dead file (~147 LoC) pkg/dartpad/asset/sandbox_flutter_patch.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~108 LoC) · ×1
  • Dead file (~108 LoC) pkg/sourcemap_testing/lib/src/js/inspector.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~37 LoC) · ×1
  • Dead file (~37 LoC) pkg/dartpad_worker/lib/src/asset/worker.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~28 LoC) · ×1
  • Dead file (~28 LoC) pkg/dartpad/lib/src/asset/shared-worker.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~22 LoC) · ×1
  • Dead file (~22 LoC) pkg/dev_compiler/lib/js/common/run.js — no import path from any entry point (9 application, 0 tooling, 4 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 · Dead file (~19 LoC) · ×1
  • Dead file (~19 LoC) sdk/lib/_internal/js_dev_runtime/private/preambles/jsshell.js — no import path from any entry point (9 application, 0 tooling, 4 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
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity pkg/front_end/tool/benchmark_visualiser.html:4 — `https://www.gstatic.com/charts/loader.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 3 such include(s) across the repository's markup.
X1 · Async correctness · `async` callback passed to `forEach` · ×1
  • `async` callback passed to `forEach` pkg/dds/lib/src/client_manager.dart:153 — `forEach` takes a `void` callback and never awaits what it returns, so the Future each `async` call returns is dropped: nothing can await it, the code after this loop runs before any of the awaited work has finished (a function that `await`s around this loop still returns early, and a resource it closes next is closed under the work), and an error is never handled — it surfaces as an uncaught asynchronous error, which terminates a command-line program and reaches only the zone's error handler in Flutter. Iterate with `for (final item in items) { await … }` when the work must run in order, or `await Future.wait(items.map((item) async { … }))` when it may run concurrently, so the enclosing function finishes only when the work does and its failures reach the caller. Where firing and forgetting is genuinely intended, make the callback's whole body a `try { … } catch (e) { … }` that handles the failure, so it cannot escape.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×1
  • Redirected process stream is never drained (deadlock) pkg/observatory/bin/observatory.dart:83 — `Process.start` always pipes both `stdout` and `stderr`, and here `process.stdout` is read while the child's end is awaited — but nothing in this scope ever reads `process.stderr`. Dart reads a process stream only while something listens to it, and the API's own documentation says every byte of both must be read: once the child writes more than the pipe holds to stderr (measured with Dart 3.12 on Linux: 60 KB hangs every time, and less on a box short of pipe pages), it blocks on the write, never exits, and the `exitCode` or end of stream this code awaits never comes. Nothing fails loudly: the future never completes and the stuck child holds its resources until something kills it. Consume both streams (`process.stderr.drain<void>()` to discard it, or listen to it), use `Process.run`, which collects both, or start it with `mode: ProcessStartMode.inheritStdio` when the output is not wanted.
X2 · Cancellation propagation · Async function without AbortSignal · ×1
  • Async function without AbortSignal: create pkg/dartpad_worker/lib/src/asset/worker.js:12 — `create` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X27 · Collection changed while being enumerated · Collection is structurally changed while it is being enumerated · ×1
  • Collection is structurally changed while it is being enumerated pkg/dwds/lib/src/debugging/skip_list.dart:30 — `_urlToId.keys` is a live view over `_urlToId` and shares its modification count, and line 37 calls `_urlToId.remove(…)` inside the loop body — a structural change to a `Map`. Dart's collection iterators check that the collection has not changed since the loop began, so the next `moveNext()` throws `ConcurrentModificationError` (an unmodifiable or fixed-length one rejects the change itself with `UnsupportedError`): every pass that reaches this call ends the loop by exception instead of by running out of elements, and the remaining elements are never seen.
Minor — 244 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×137
  • Orphaned file pkg/vm_service/lib/src/snapshot_graph.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/sourcemap_testing/lib/src/stepping_helper.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/sourcemap_testing/lib/src/stacktrace_helper.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/dart2js_info/lib/binary_serialization.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/ir/runtime_type_analysis.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/_internal/vm/lib/timer_impl.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/js_backend/string_reference.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/js_backend/interceptor_data.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/async/broadcast_stream_controller.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/inferrer/type_graph_dump.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/js_backend/minify_namer.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/ir/closure.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/dds/lib/src/stream_manager.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/js_emitter/class_stub_generator.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/inferrer/trivial.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/vm_snapshot_analysis/lib/precompiler_trace.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/js_backend/backend_usage.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/compiler/lib/src/ssa/ssa.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/vm_snapshot_analysis/lib/program_info.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/core/weak.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/_internal/js_runtime/lib/convert_patch.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file sdk/lib/_internal/js_runtime/lib/constant_map.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/vm_snapshot_analysis/lib/src/commands/summary.dart:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 112 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate pkg/dev_compiler/lib/src/kernel/compiler.dart:8933 — `!_incrementalMode || _incrementalModules.containsKey(module)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:9009 — `!_incrementalMode || _symbolContainer.incrementalModuleItems.contains(id)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:7376 — `!_isNullable(left) || !_isNullable(right)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 sdk/lib/_internal/js_runtime/lib/collection_patch.dart:1466 — `!_validKey(element) || !this.contains(element)` appears character-identically in 2 files — sdk/lib/_internal/js_runtime/lib/collection_patch.dart, sdk/lib/_internal/vm_shared/lib/collection_patch.dart. 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 pkg/analyzer_plugin/lib/src/utilities/directive_sort.dart:15 — `!a.startsWith('/') && !b.startsWith('/')` appears character-identically in 2 files — pkg/analyzer_plugin/lib/src/utilities/directive_sort.dart, pkg/linter/lib/src/rules/directives_ordering.dart. 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 pkg/analyzer_plugin/lib/src/utilities/directive_sort.dart:14 — `!a.startsWith('package:') || !b.startsWith('package:')` appears character-identically in 2 files — pkg/analyzer_plugin/lib/src/utilities/directive_sort.dart, pkg/linter/lib/src/rules/directives_ordering.dart. 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 pkg/compiler/lib/src/js/size_estimator.dart:582 — `!assignment.isCompound && leftHandSide is VariableUse && rightHandSide is Binary` appears character-identically in 2 files — pkg/compiler/lib/src/js/size_estimator.dart, pkg/js_ast/lib/src/printer.dart. 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 pkg/dap_adapters/lib/src/adapters/dart_cli_adapter.dart:133 — `!containsVmFlag(toolArgs, 'timeline_streams') && !containsVmFlag(vmArgs, 'timeline_streams')` appears character-identically in 2 files — pkg/dap_adapters/lib/src/adapters/dart_cli_adapter.dart, pkg/dap_adapters/lib/src/adapters/dart_test_adapter.dart. 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 pkg/analysis_server/lib/src/services/correction/organize_imports.dart:408 — `!docImportByLine.containsKey(lines[i]) && !isBlankLineBetweenDocImports(i) && !(lines[i] == lines.last && rawContent(lines[i]).isEmpty)` appears character-identically in 2 files — pkg/analysis_server/lib/src/services/correction/organize_imports.dart, pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:2067 — `!f.positionalParameters.any(isCovariantParameter) && !f.namedParameters.any(isCovariantParameter)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/cfg/lib/front_end/computed_scopes.dart:153 — `!field.isStatic && field.initializer != null` appears character-identically in 2 files — pkg/cfg/lib/front_end/computed_scopes.dart, pkg/dart2bytecode/lib/local_vars.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:2951 — `!getters.containsKey(name) && _classProperties!.inheritedGetters.contains(name)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dartdev/lib/src/commands/analyze.dart:200 — `!globalArgs.flag('analytics') || globalArgs.flag('suppress-analytics')` appears character-identically in 3 files — pkg/dartdev/lib/src/commands/analyze.dart, pkg/dartdev/lib/src/commands/fix.dart, pkg/dartdev/lib/src/commands/migrate.dart. 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 pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart:881 — `!groupingStack.isEmpty && groupingStack.head.kind == LT_TOKEN` appears character-identically in 2 files — pkg/_fe_analyzer_shared/lib/src/scanner/abstract_scanner.dart, pkg/analysis_server/tool/benchmark_tools/big_chain_benchmark/files/copy_me/copy_me.dart. 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 pkg/analysis_server/lib/src/lsp/completion_utils.dart:426 — `!hasDefaultTextMode && supportsAsIsInsertMode && isMultilineCompletion` appears character-identically in 2 files — pkg/analysis_server/lib/src/lsp/completion_utils.dart, pkg/analysis_server/lib/src/lsp/mapping.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:2571 — `!hasJsPeer && m.isGetter && m.name.text == 'iterator'` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 sdk/lib/_internal/vm_shared/lib/compact_hash.dart:249 — `!identical(_data, oldData) || (_checkSum != oldCheckSum)` appears character-identically in 2 files — sdk/lib/_internal/vm_shared/lib/compact_hash.dart, sdk/lib/_internal/wasm/common/compact_hash.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:7444 — `!isJSInteropMember(ctor) && _requiresRtiForInstantiation(ctorClass)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart:321 — `!isNamed && codeStyleOptions.sortUnnamedConstructorsFirst` appears character-identically in 2 files — pkg/analysis_server/lib/src/services/correction/dart/convert_to_in_body_constructor.dart, pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:7785 — `!isTypeError && _mustBeNonNullable(toType) && DartTypeEquivalence( _coreTypes, ignoreTopLevelNullability: true, ).areEqual(fromStaticType, t…` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:7782 — `!isTypeError && _types.isSubtypeOf(fromStaticType, toType)` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:1784 — `!m.isAbstract && !m.isStatic && !m.name.isPrivate` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:2008 — `!member.isStatic && (extMethods.contains(name) || extAccessors.contains(name))` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/dev_compiler/lib/src/kernel/compiler.dart:1978 — `!member.isStatic && reifiedType.typeParameters.isNotEmpty` appears character-identically in 2 files — pkg/dev_compiler/lib/src/kernel/compiler.dart, pkg/dev_compiler/lib/src/kernel/compiler_new.dart. 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 pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart:43 — `!nameNode.inGetterContext() || nameNode.isInvocationName` appears character-identically in 2 files — pkg/analysis_server/lib/src/services/correction/dart/create_extension_member.dart, pkg/analysis_server/lib/src/services/correction/dart/create_getter.dart. 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.
  • + 15 more in this group — see findings.md.
D16 · Bus Factor · Off-boarding risk · ×23
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 48 significant file(s) lose their only recent owner: pkg/analyzer/lib/src/fine/requirements.dart, pkg/analyzer/lib/src/fine/manifest_item.dart, pkg/analyzer/lib/src/fine/library_manifest.dart, pkg/analyzer/lib/src/summary2/ast_binary_reader.dart, pkg/analyzer/tool/generators/ast_generator.dart, pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart, pkg/analyzer/lib/src/test_utilities/find_node.dart, pkg/analyzer/lib/src/wolf/ir/ast_to_ir.dart (+40 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 39 significant file(s) lose their only recent owner: pkg/native_compiler/lib/back_end/arm64/code_generator.dart, pkg/native_compiler/lib/snapshot/snapshot.dart, pkg/native_compiler/lib/back_end/arm64/assembler.dart, pkg/cfg/lib/ir/instructions.dart, pkg/native_compiler/lib/front_end/recognized_methods.dart, pkg/native_compiler/lib/back_end/register_allocator.dart, pkg/native_compiler/lib/back_end/arm64/stub_code_generator.dart, pkg/cfg/lib/ir/flow_graph_builder.dart (+31 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 28 significant file(s) lose their only recent owner: pkg/dart_runtime_service_dds/lib/devtools_server.dart, pkg/dart_runtime_service_dds/lib/src/dds_isolate_manager.dart, pkg/dart_runtime_service_vm/lib/dart_runtime_service_vm.dart, pkg/dart_runtime_service_dds/lib/src/dds_backend.dart, pkg/dart_runtime_service/lib/src/clients.dart, pkg/dart_runtime_service/lib/src/event_streams.dart, pkg/dart_runtime_service/lib/src/io/devtools/handler.dart, pkg/dart_runtime_service_dds/lib/src/dds_rpcs.dart (+20 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 25 significant file(s) lose their only recent owner: pkg/analysis_server/lib/src/lsp/handlers/handlers.dart, pkg/analysis_server/lib/src/lsp/client_capabilities.dart, pkg/analysis_server/lib/src/lsp/client_configuration.dart, pkg/analysis_server/lib/src/lsp/handlers/handler_call_hierarchy.dart, pkg/analysis_server/lib/src/lsp/snippets.dart, pkg/analysis_server/tool/code_completion/metrics_util.dart, pkg/analysis_server/tool/lsp_spec/custom/interactive_forms.dart, pkg/analysis_server/lib/src/lsp/semantic_tokens/mapping.dart (+17 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 22 significant file(s) lose their only recent owner: pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart, pkg/_fe_analyzer_shared/lib/src/parser/identifier_context_impl.dart, pkg/analyzer_utilities/lib/messages.dart, pkg/heap_snapshot/lib/analysis.dart, pkg/analyzer_utilities/lib/analyzer_messages.dart, pkg/analysis_server_client/lib/src/protocol/protocol_base.dart, pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis_log.dart, pkg/_fe_analyzer_shared/lib/src/parser/identifier_context.dart (+14 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 19 significant file(s) lose their only recent owner: pkg/front_end/lib/src/source/source_property_builder.dart, pkg/front_end/lib/src/source/fragment_factory.dart, pkg/front_end/lib/src/source/source_method_builder.dart, pkg/front_end/lib/src/kernel/body_builder_helpers.dart, pkg/front_end/lib/src/source/value_kinds.dart, pkg/front_end/lib/src/base/name_space.dart, pkg/front_end/lib/src/source/source_extension_builder.dart, pkg/kernel/lib/src/ast/initializers.dart (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 15 significant file(s) lose their only recent owner: pkg/analysis_server/lib/src/session_logger/log_sanitizer.dart, pkg/dds/lib/src/devtools/machine_mode_command_handler.dart, pkg/linter/lib/src/rules/no_dynamic_casts.dart, pkg/meta/lib/meta_meta.dart, pkg/analysis_server/lib/src/plugin/dsatur.dart, pkg/linter/tool/benchmark.dart, pkg/analysis_server/lib/src/services/correction/fix/pubspec/pubspec_fix_processor.dart, pkg/analysis_server/tool/generate_testing_package.dart (+7 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 15 significant file(s) lose their only recent owner: pkg/dart2wasm/lib/deferred_load/partition.dart, pkg/wasm_builder/lib/debug_info.dart, pkg/dart2wasm/lib/deferred_load/dominators.dart, pkg/dart2wasm/lib/deferred_load/import_set.dart, pkg/compiler/lib/src/deferred_load/program_split_constraints/nodes.dart, pkg/vm/lib/transformations/type_flow/calls.dart, pkg/vm/lib/transformations/no_dynamic_invocations_annotator.dart, pkg/vm/lib/metadata/procedure_attributes.dart (+7 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 14 significant file(s) lose their only recent owner: pkg/dartpad/lib/src/setup/flutter.dart, pkg/dartpad_worker/lib/src/resource_provider/resource_provider_file.dart, pkg/dartpad/lib/src/worker_client.dart, pkg/dartpad_worker/lib/src/worker.dart, pkg/dartpad_worker/lib/src/tools/frontend_server_compiler.dart, pkg/dartpad_worker/lib/src/tools/sandbox_client.dart, pkg/dartpad/lib/src/message_port/message_port_js.dart, pkg/dartpad/lib/src/message_port/message_port_channel.dart (+6 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #10 — If anonymized user #10 becomes unavailable, 9 significant file(s) lose their only recent owner: sdk/lib/mirrors/mirrors.dart, benchmarks/UiMatrix/dart/uimatrix.dart, sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart, sdk/lib/_internal/js_runtime/lib/math_patch.dart, pkg/dartdev/lib/src/telemetry/project_cache.dart, tools/build_test_fast.py, pkg/dartdev/lib/src/telemetry/pubspec_scanner.dart, pkg/modular_test/lib/src/memory_pipeline.dart (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #11 — If anonymized user #11 becomes unavailable, 6 significant file(s) lose their only recent owner: pkg/dwds/lib/src/services/chrome/chrome_proxy_service.dart, pkg/compiler/lib/src/constants/constant_system.dart, pkg/dwds/lib/src/services/expression_compiler_service.dart, pkg/dwds/lib/src/sockets.dart, pkg/compiler/lib/src/serialization/binary_sink.dart, pkg/dwds/lib/src/services/expression_compiler.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #12 — If anonymized user #12 becomes unavailable, 6 significant file(s) lose their only recent owner: sdk/lib/ffi/c_type.dart, pkg/test_runner/lib/src/utils.dart, tools/build.py, runtime/tools/bin_to_coff.py, tools/make_version.py, pkg/test_runner/lib/src/fuchsia.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #13 — If anonymized user #13 becomes unavailable, 6 significant file(s) lose their only recent owner: pkg/dwds_test_common/lib/integration/events.dart, pkg/dev_compiler/lib/src/compiler/js_names.dart, pkg/reload_test/lib/frontend_server_controller.dart, pkg/dev_compiler/lib/src/js_ast/source_map_printer.dart, pkg/reload_test/lib/src/_ddc_reload_utils.dart, pkg/dev_compiler/tool/hotreload/hot_reload_helper.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #14 — If anonymized user #14 becomes unavailable, 5 significant file(s) lose their only recent owner: pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_runner.dart, pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_summary_builder.dart, pkg/analysis_server/lib/src/lsp/handlers/custom/migration/migration_schedule.dart, pkg/analysis_server/lib/src/lsp/handlers/custom/handler_migrate.dart, pkg/analysis_server/lib/src/utilities/pubspec.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #15 — If anonymized user #15 becomes unavailable, 5 significant file(s) lose their only recent owner: pkg/status_file/lib/src/expression.dart, pkg/status_file/lib/canonical_status_file.dart, pkg/status_file/lib/status_file.dart, pkg/status_file/lib/status_file_linter.dart, pkg/expect/lib/legacy/minitest.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #16 — If anonymized user #16 becomes unavailable, 5 significant file(s) lose their only recent owner: benchmarks/TypeLiteral/dart/TypeLiteral.dart, benchmarks/SwitchFSM/dart/match_class.dart, benchmarks/SwitchFSM/dart/match_string.dart, benchmarks/SwitchFSM/dart/match_enum.dart, benchmarks/SwitchFSM/dart/match_int.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #17 — If anonymized user #17 becomes unavailable, 4 significant file(s) lose their only recent owner: benchmarks/BitArray/dart/BitArray.dart, sdk/lib/_internal/wasm/common/simd.dart, benchmarks/SimdInt32x4/dart/SimdInt32x4.dart, benchmarks/SimdSearch/dart/SimdSearch.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #18 — If anonymized user #18 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/compiler/lib/src/universe/recorded_use.dart, pkg/vm/lib/transformations/record_use/record_use.dart, pkg/compiler/lib/src/js_emitter/record_use_emitter.dart, pkg/vm/lib/transformations/record_use/constant_collector.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #19 — If anonymized user #19 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/shadow_sources/lib/src/exposed_libraries_collector.dart, pkg/shadow_sources/lib/src/shadow_options.dart, pkg/shadow_sources/lib/src/shadow_sources.dart, pkg/shadow_sources/lib/src/directive_extractor.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #20 — If anonymized user #20 becomes unavailable, 3 significant file(s) lose their only recent owner: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart, pkg/compiler/lib/src/inferrer/typemasks/record_type_mask.dart, pkg/compiler/lib/src/util/maplet.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #21 — If anonymized user #21 becomes unavailable, 3 significant file(s) lose their only recent owner: pkg/front_end/lib/src/base/incremental_serializer.dart, pkg/_fe_analyzer_shared/lib/src/util/stack_checker.dart, pkg/analyzer/lib/src/utilities/growable_type_data.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #22 — If anonymized user #22 becomes unavailable, 3 significant file(s) lose their only recent owner: pkg/perf_witness/lib/recorder.dart, pkg/perf_witness/lib/server.dart, pkg/perf_witness/lib/src/async_span.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #23 — If anonymized user #23 becomes unavailable, 3 significant file(s) lose their only recent owner: pkg/analysis_server/tool/performance/utilities/code_generator.dart, pkg/linter/lib/src/rules/unnecessary_this_alias.dart, pkg/analysis_server/lib/src/services/correction/dart/move_initialization_to_field_declaration.dart. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default in catch · ×10
  • Silent fallback default in catch tools/minidump.py:183 — `GetProcessIdFromDump` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch tools/utils.py:808 — `_find_unexpected_crashes` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch pkg/analysis_server/lib/src/lsp/handlers/code_actions/pubspec.dart:69 — `getFixActions` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analysis_server/lib/src/plugin/plugin_trust.dart:222 — `_readPlugins` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analyzer/lib/src/dart/analysis/context_locator.dart:624 — `_getEnabledLegacyPlugins` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analyzer/lib/src/dart/analysis/context_locator.dart:654 — `_getExcludedGlobs` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analyzer_cli/lib/src/options.dart:344 — `_getVersion` turns every thrown error into `'<unknown>'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analyzer_plugin/lib/src/utilities/navigation/document_links.dart:30 — `findLinks` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/analyzer_plugin/lib/src/utilities/navigation/document_links.dart:329 — `findLinks` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch pkg/observatory/lib/src/service/object.dart:4318 — `_getJumpAddress` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×5
  • Diagnostic log message is built whether or not it is wanted pkg/dwds/lib/src/services/expression_compiler_service.dart:114 — `finest` at line 114 is called with an argument built by `args.join('…')` (line 114), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because finest is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted pkg/dwds/lib/src/services/web_socket/web_socket_proxy_service.dart:304 — `fine` at line 304 is called with an argument built by `keys.toList()` (line 306), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because fine is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted pkg/dartdev/lib/src/core.dart:298 — `trace` at line 298 is called with an argument built by `command.join('…')` (line 298), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted pkg/dartdev/lib/src/lsp_analysis_server.dart:256 — `trace` at line 256 is called with an argument built by `arguments.join('…')` (line 256), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted REDACTED:468 — `trace` at line 468 is called with an argument built by `arguments.join('…')` (line 468), whose cost grows with the collection it walks. Dart evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLoggable` test, no `kDebugMode` or debug flag, no `assert`, no closure the logger calls only when the level is on.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
P10 · Library API & versioning · Implementation type on the public API · ×2
  • Implementation type on the public API pkg/_fe_analyzer_shared/lib/src/base/errors.dart:187 — 585 public types in `repository.src` are marked as implementation by their own namespace, folder or name: `DiagnosticCodeImpl` (pkg/_fe_analyzer_shared/lib/src/base/errors.dart:187, name ends in `Impl`), `StackImpl` (pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart:534, name ends in `Impl`), `TokenStreamRewriterImpl` (pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart:273, name ends in `Impl`), `StringTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:26, name ends in `Impl`), `CommentTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:127, name ends in `Impl`), `LanguageVersionTokenImpl` (pkg/_fe_analyzer_shared/lib/src/scanner/token_impl.dart:164, name ends in `Impl`), `SharedInferenceLogWriterImpl` (pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart:273, name ends in `Impl`), `PluginRegistryImpl` (pkg/analysis_server_plugin/lib/src/registry.dart:16, name ends in `Impl`), and 577 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API pkg/analyzer/tool/fine/ab_mutate/mutations/impl/insert_unit_header_comment.dart:11 — 5 public types in `repository` are marked as implementation by their own namespace, folder or name: `InsertUnitHeaderCommentMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/insert_unit_header_comment.dart:11, `impl`), `RemoveLastFormalParameterMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/remove_last_formal_parameter.dart:13, `impl`), `RenameLocalVariableMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/rename_local_variable.dart:16, `impl`), `SwapTopLevelFunctionsMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/swap_top_level_functions.dart:12, `impl`), `ToggleReturnTypeNullabilityMutation` (pkg/analyzer/tool/fine/ab_mutate/mutations/impl/toggle_return_type_nullability.dart:12, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 18 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (313 single-owned of 2907 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2907 of the 10144 production source files in this repository met that bar). They are anonymized user #24 (2 file(s)), anonymized user #25 (2 file(s)), anonymized user #26 (2 file(s)), anonymized user #27 (2 file(s)), anonymized user #28 (1 file(s)), anonymized user #29 (1 file(s)) (+12 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: benchmarks/SubtypeTestCache/dart/SubtypeTestCache.dart, benchmarks/SubtypeTestCache/generate.dart, pkg/dev_compiler/lib/src/kernel/property_model.dart, pkg/dwds/lib/src/debugging/webkit_debugger.dart, sdk/lib/_internal/js_runtime/lib/js_allow_interop_patch.dart, sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart, pkg/expect/lib/async_helper.dart, sdk/lib/async/zone_delegate.dart (+14 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found sdk/lib/_internal/vm/bin/builtin.dart:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `sdk/lib/_internal/vm/bin/builtin.dart` makes this repository a deployable product (line 1).
D24 · Comment Value · redundant comment · ×1
  • redundant comment REDACTED:701 — "fetchCPUProfile." repeats the code it sits on: 3 of its 3 words (fetch, cpu, profile) are already in `fetchCPUProfile(vmAddress, isolateIds, timeOrigin, timeExtent);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 21 of 90 project(s) overshoot their size bounds, lowering Project Cohesion to 5.3/10. The most over is `pkg/front_end/testcases` (93836 LoC, 6980 module-visible types across 186 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 137 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: pkg/vm_service/lib/src/snapshot_graph.dart, pkg/sourcemap_testing/lib/src/stepping_helper.dart, pkg/sourcemap_testing/lib/src/stacktrace_helper.dart, pkg/compiler/lib/src/inferrer/typemasks/union_type_mask.dart, pkg/dart2js_info/lib/binary_serialization.dart, pkg/compiler/lib/src/ir/runtime_type_analysis.dart, sdk/lib/_internal/vm/lib/timer_impl.dart, pkg/compiler/lib/src/js_backend/string_reference.dart (and 129 more) (160 orphaned of 2907 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2907 of the 10144 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`PRESUBMIT.py`).
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift runtime/docs/README.md:5 — runtime/docs/README.md links to `vegorov@google.com`, but `runtime/docs/vegorov@google.com` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 13/68 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `pkg/_fe_analyzer_shared`, `pkg/analysis_server_client`, `pkg/analysis_server_plugin` and 50 more.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete — Set: X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy, Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: sdk/lib/_http/http.dart:258 — `HttpServer.listenOn(`.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Sound null safety is not on in every Dart package · ×1
  • Sound null safety is not on in every Dart package — 83/84 of this repository's Dart packages (a `pubspec.yaml` with product Dart beneath it) declare a language version of 2.12 or above in `environment: sdk:`, which is what turns sound null safety on. A pubspec with no SDK constraint, or a lower bound below 2.12, runs its code unsound: every type admits null, and a null reaching a method call throws `NoSuchMethodError` with nothing in the analyzer having said so.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex pkg/dartpad/lib/src/setup/flutter.dart:971 — 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 Dart code already uses a real parser in the same package; use it here too.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand pkg/front_end/test/utils/kernel_chain.dart:311 — `message.startsWith("error in strong mode")` can never decide this `||` — every value satisfying `message.startsWith("error in strong mode")` also satisfies `message.startsWith("error in ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 2 finding(s)
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names benchmarks/Richards/javascript/Richards.js:252 — 1 of 56 documented parameters and 1 of 55 summaries in `.` only repeat the member or parameter name (e.g. "the task" for `task`). Delete the restating tags, or add what the name does not say.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: _fe_analyzer_shared — _fe_analyzer_shared: abstractness 0.21, instability 0.08, distance 0.71 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d8da9283ff1a4e55b0f86a1b0cbb4e11/history.json --exit-code 0 --source .260artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d8da9283ff1a4e55b0f86a1b0cbb4e11/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude pkg/analysis_server/tool/spec/generated --exclude pkg/compiler/test/tool/graph_isomorphizer/golden --exclude pkg/dart2js_info/lib/src/proto --exclude pkg/vm/testcases/transformations/type_flow/transformer/protobuf_handler/lib/generated --exclude pkg/vm_service_protos/lib/src --exclude runtime/tools/profiling/lib/src/pprof/generated --exclude sdk/lib/html/dart2js --exclude sdk/lib/indexed_db/dart2js --exclude sdk/lib/svg/dart2js --exclude sdk/lib/web_audio/dart2js --exclude sdk/lib/web_gl/dart2js --exclude sdk/lib/web_sql/dart2js .17artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Dart pubspec.yaml — not scanned yet).0—

Run 01a1d470-f786-7df8-a95d-07540237a1a5 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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