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

facebook/flow

Measured 14 November 2026, 06:52 UTC, at code version 53cf218

CAI score 45out of 100 At risk Down 1 since the last survey

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: 576,293 lines of product code in 22 projects, tests not counted · Estimated rebuild effort: about 3.9 person-years · Weakest lens: Code Health, 33

Findings by how serious they are

138 critical 4619 serious 219 minor

18 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
14 November 2026, 06:52 UTC

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

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

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

62of 62 dimensions measured by tools.
4957of 4976 findings point to an exact file and line, so you can open each one in the code. The other 19 concern the repository as a whole, such as missing documentation.
62dimensions across 6 lenses, read from 576,293 lines of product code in 22 projects.
Chapters

Executive summary

facebook/flow is rated At risk because critical security findings are open. It scores 45 out of 100, which the At risk rating leaves unchanged.

Code Health, at 33, is the weakest lens and counts most in the score. The best first step is adding type checking, worth about 6 points. Recording design decisions comes next, worth about 2 points. Raising Code Health to 70 would lift the score to about 55.

Sixty-five known security holes in the packages the code depends on can be used by attackers. Sixty-three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Updating the vulnerable packages and pinning each tool to an exact version would close both risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code, and the two places where the code runs text as code or as a command need a direct call instead. The two loops of files that import each other need breaking.

The product code is 576,293 lines, about €570,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 33 · counts for 46%Production Readiness 44 · counts for 25%Security and Compliance 58 · counts for 14%Maturity 62 · counts for 8%Architecture 85 · counts for 4%Performance 100 · counts for 2%

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

Code composition: what the lines of code are
Product code 89%Tests 11%
New since the last survey: 4213 findings

These 4213 critical or serious findings weren't in the previous survey, on 26 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · flow_typing_errors::intermediate_error::to_printable_error (cyclomatic 885) rust_port/crates/flow_typing_errors/src/intermediate_error.rs
  • Cyclomatic Complexity · flow_typing_flow_js::flow_js::dispatch::__flow_impl (cyclomatic 693) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs
  • Cyclomatic Complexity · flow_typing_debug::dump_error_message (cyclomatic 378) rust_port/crates/flow_typing_debug/src/lib.rs
  • Cyclomatic Complexity · ErrorMessage::friendly_message_of_msg (cyclomatic 334) rust_port/crates/flow_typing_errors/src/error_message.rs
  • Cyclomatic Complexity · ErrorMessage::map_loc_of_error_message (cyclomatic 325) rust_port/crates/flow_typing_errors/src/error_message.rs
  • Cyclomatic Complexity · flowDefToTSDef.getTransforms (cyclomatic 320) REDACTED
  • Cyclomatic Complexity · flow_typing_flow_js::subtyping_kit::rec_sub_t (cyclomatic 315) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs
  • Cyclomatic Complexity · ErrorMessage::error_code_of_message (cyclomatic 250) rust_port/crates/flow_typing_errors/src/error_message.rs
  • Cyclomatic Complexity · TSDefToFlowDef.getTransforms (cyclomatic 225) REDACTED
  • Cyclomatic Complexity · flow_parser::flow_lexer::token_base_inner (cyclomatic 217) rust_port/crates/flow_parser/src/flow_lexer.rs
  • Cyclomatic Complexity · flow_typing_statement::type_annotation::convert_inner (cyclomatic 199) rust_port/crates/flow_typing_statement/src/type_annotation.rs
  • Cyclomatic Complexity · flow_typing_utils::annotation_inference::elab_t_concrete (cyclomatic 196) rust_port/crates/flow_typing_utils/src/annotation_inference.rs
  • Cyclomatic Complexity · ParseError::fmt (cyclomatic 193) rust_port/crates/flow_parser/src/parse_error.rs
  • Cyclomatic Complexity · flow_typing_statement::statement::statement_ (cyclomatic 183) rust_port/crates/flow_typing_statement/src/statement.rs
  • Cyclomatic Complexity · TokenKind::to_value (cyclomatic 155) rust_port/crates/flow_parser/src/token.rs
  • Cyclomatic Complexity · flow_typing_statement::statement::mk_class_sig (cyclomatic 144) rust_port/crates/flow_typing_statement/src/statement.rs
  • Cyclomatic Complexity · flow_typing_statement::statement::expression_ (cyclomatic 136) rust_port/crates/flow_typing_statement/src/statement.rs
  • Cyclomatic Complexity · flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl (cyclomatic 130) rust_port/crates/flow_typing_errors/src/intermediate_error.rs
  • Cyclomatic Complexity · ErrorMessage::convert_type_to_type_desc (cyclomatic 118) rust_port/crates/flow_typing_errors/src/error_message.rs
  • Cyclomatic Complexity · Walker::walk_structural (cyclomatic 118) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_env_builder_resolver::name_def_ordering::depends (cyclomatic 116) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs
  • Cyclomatic Complexity · flow_typing_debug::dump_use_t_ (cyclomatic 112) rust_port/crates/flow_typing_debug/src/lib.rs
  • Cyclomatic Complexity · flow_typing_utils::type_sig_merge::merge_annot (cyclomatic 108) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs
  • Cyclomatic Complexity · flow_services_code_action::code_action_service::ast_transforms_of_error (cyclomatic 106) rust_port/crates/flow_services_code_action/src/code_action_service.rs
  • Cyclomatic Complexity · flow_typing_flow_js::implicit_instantiation::walk::solve_targs_in_snapshot (cyclomatic 106) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_lsp::lsp_mapper::default_mapper (cyclomatic 99) rust_port/crates/flow_lsp/src/lsp_mapper.rs
  • Cyclomatic Complexity · DefFinder::statement_list (cyclomatic 96) rust_port/crates/flow_env_builder/src/name_def.rs
  • Cyclomatic Complexity · flow_parser::estree_translator::statement (cyclomatic 95) rust_port/crates/flow_parser/src/estree_translator.rs
  • Cyclomatic Complexity · flow_typing_statement::type_annotation::add_interface_properties (cyclomatic 93) rust_port/crates/flow_typing_statement/src/type_annotation.rs
  • Cyclomatic Complexity · flow_typing_statement::statement::optional_chain (cyclomatic 89) rust_port/crates/flow_typing_statement/src/statement.rs
  • Cyclomatic Complexity · flow_common::reason::code_desc_of_expression (cyclomatic 88) rust_port/crates/flow_common/src/reason.rs
  • Cyclomatic Complexity · flow_typing_debug::dump_t_ (cyclomatic 87) rust_port/crates/flow_typing_debug/src/lib.rs
  • Cyclomatic Complexity · flow_typing_statement::module_info_analyzer::visit_toplevel_statement (cyclomatic 84) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs
  • Cyclomatic Complexity · getTransforms::GenericTypeAnnotation (cyclomatic 81) REDACTED
  • Cyclomatic Complexity · UseTInner::eq (cyclomatic 77) rust_port/crates/flow_typing_type/src/type_.rs
  • Cyclomatic Complexity · flow_typing_utils::members::merge_type (cyclomatic 74) rust_port/crates/flow_typing_utils/src/members.rs
  • Cyclomatic Complexity · ErrorMessage::loc_of_msg (cyclomatic 73) rust_port/crates/flow_typing_errors/src/error_message.rs
  • Cyclomatic Complexity · Annot::iter (cyclomatic 72) rust_port/crates/flow_type_sig/src/type_sig.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::expression (cyclomatic 71) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing_flow_js::default_resolve::default_resolve_touts (cyclomatic 70) rust_port/crates/flow_typing_flow_js/src/default_resolve.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::statement (cyclomatic 68) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing_utils::predicate_kit::intersect_type_guard (cyclomatic 68) rust_port/crates/flow_typing_utils/src/predicate_kit.rs
  • Cyclomatic Complexity · flow_typing_ty_normalizer::normalizer::type_converter::type_ctor (cyclomatic 67) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::maybe_special_unqualified_generic (cyclomatic 66) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::class_def (cyclomatic 66) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing_utils::check_polarity::check_polarity_impl (cyclomatic 66) rust_port/crates/flow_typing_utils/src/check_polarity.rs
  • Cyclomatic Complexity · Writer::expression (cyclomatic 65) rust_port/crates/flow_parser_utils_output/src/indented_printer/expressions.rs
  • Cyclomatic Complexity · flow_parser_utils_output::js_layout_generator::expression (cyclomatic 64) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs
  • Cyclomatic Complexity · flow_lsp_server::flow_lsp::main_handle_initialized_unsafe (cyclomatic 62) rust_port/crates/flow_lsp_server/src/flow_lsp.rs
  • Cyclomatic Complexity · flow_parser::estree_translator::expression (cyclomatic 61) rust_port/crates/flow_parser/src/estree_translator.rs
  • Cyclomatic Complexity · flow_parser::statement_parser::export_declaration::parse (cyclomatic 61) rust_port/crates/flow_parser/src/statement_parser.rs
  • Cyclomatic Complexity · flow_typing_flow_js::implicit_instantiation::t_of_use_t (cyclomatic 61) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs
  • Cyclomatic Complexity · flow_typing_flow_js::subtyping_kit::flow_obj_to_obj (cyclomatic 60) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs
  • Cyclomatic Complexity · flow_typing_flow_js::flow_js::eval_helpers::eval_destructor (cyclomatic 59) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs
  • Cyclomatic Complexity · flow_typing::env_resolution::resolve_binding (cyclomatic 58) rust_port/crates/flow_typing/src/env_resolution.rs
  • Cyclomatic Complexity · run_swebench.main (cyclomatic 58) evals/run_swebench.py
  • Cyclomatic Complexity · Walker::walk_def (cyclomatic 57) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_typing_errors::intermediate_error::make_intermediate_error (cyclomatic 56) rust_port/crates/flow_typing_errors/src/intermediate_error.rs
  • Cyclomatic Complexity · flow_typing_visitors::type_mapper::type_default (cyclomatic 56) rust_port/crates/flow_typing_visitors/src/type_mapper.rs
  • Cyclomatic Complexity · flow_parser_utils_output::js_layout_generator::statement (cyclomatic 55) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs
  • Cyclomatic Complexity · flow_typing_flow_js::flow_js::helpers::handle_generic (cyclomatic 54) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs
  • Cyclomatic Complexity · NameResolver::visit_match_pattern (cyclomatic 53) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs
  • Cyclomatic Complexity · flow_typing_utils::type_hint::type_of_hint_decomposition (cyclomatic 53) rust_port/crates/flow_typing_utils/src/type_hint.rs
  • Cyclomatic Complexity · flow_parser::statement_parser::import_declaration (cyclomatic 51) rust_port/crates/flow_parser/src/statement_parser.rs
  • Cyclomatic Complexity · flow_typing::merge::check_conditional (cyclomatic 51) rust_port/crates/flow_typing/src/merge.rs
  • Cyclomatic Complexity · Walker::walk_to_union (cyclomatic 51) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_typing_type::type_util::mod_loc_of_virtual_use_op::mod_loc_of_root_use_op (cyclomatic 51) rust_port/crates/flow_typing_type/src/type_util.rs
  • Cyclomatic Complexity · flow_typing_utils::predicate_kit::instanceof_test (cyclomatic 51) rust_port/crates/flow_typing_utils/src/predicate_kit.rs
  • Cyclomatic Complexity · flow_common_ty::ty_printer::type_impl (cyclomatic 50) rust_port/crates/flow_common_ty/src/ty_printer.rs
  • Cyclomatic Complexity · flow_parser::ast_utils::acceptable_statement_in_declaration_context (cyclomatic 50) rust_port/crates/flow_parser/src/ast_utils.rs
  • Cyclomatic Complexity · flow_typing_flow_js::flow_js::unification_helpers::__unify_inner (cyclomatic 50) rust_port/crates/flow_typing_flow_js/src/flow_js/unification_helpers.rs
  • Cyclomatic Complexity · flow_parser::object_parser::class_element (cyclomatic 49) rust_port/crates/flow_parser/src/object_parser.rs
  • Cyclomatic Complexity · StripFlowTypes.transformProgram (cyclomatic 49) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js
  • Cyclomatic Complexity · Walker::walk_to_eval (cyclomatic 48) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_typing_statement::statement::mk_func_sig (cyclomatic 48) rust_port/crates/flow_typing_statement/src/statement.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::declare_class_props (cyclomatic 47) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing_utils::members::extract_type (cyclomatic 47) rust_port/crates/flow_typing_utils/src/members.rs
  • Cyclomatic Complexity · transformProgram::transform (cyclomatic 47) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::annot_with_loc (cyclomatic 46) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing::merge::try_eval_concrete_type_truthyness (cyclomatic 46) rust_port/crates/flow_typing/src/merge.rs
  • Cyclomatic Complexity · Substituter::type_ (cyclomatic 46) rust_port/crates/flow_typing_flow_common/src/type_subst.rs
  • Cyclomatic Complexity · flow_typing_type::type_util::ground_subtype (cyclomatic 46) rust_port/crates/flow_typing_type/src/type_util.rs
  • Cyclomatic Complexity · RemoveNode.getRemovalParent (cyclomatic 46) packages/flow-transform/src/transform/mutations/RemoveNode.js
  • Cyclomatic Complexity · flow_common_ty::ty_debug::dump_t (cyclomatic 45) rust_port/crates/flow_common_ty/src/ty_debug.rs
  • Cyclomatic Complexity · flow_parser::object_parser::class_element::init (cyclomatic 45) rust_port/crates/flow_parser/src/object_parser.rs
  • Cyclomatic Complexity · Writer::statement (cyclomatic 45) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs
  • Cyclomatic Complexity · flow_typing_flow_js::object_kit::run_with_env (cyclomatic 44) rust_port/crates/flow_typing_flow_js/src/object_kit.rs
  • Cyclomatic Complexity · flow_typing_statement::type_annotation::convert_object (cyclomatic 44) rust_port/crates/flow_typing_statement/src/type_annotation.rs
  • Cyclomatic Complexity · flow_typing_visitors::type_mapper::destructor_default (cyclomatic 44) rust_port/crates/flow_typing_visitors/src/type_mapper.rs
  • Cyclomatic Complexity · flow_common_errors::error_utils::friendly::message_group_of_error::loop_ (cyclomatic 43) rust_port/crates/flow_common_errors/src/error_utils.rs
  • Cyclomatic Complexity · flow_parser::statement_parser::declare_export_declaration_body (cyclomatic 43) rust_port/crates/flow_parser/src/statement_parser.rs
  • Cyclomatic Complexity · flow_type_sig::type_sig_parse::object_type (cyclomatic 43) rust_port/crates/flow_type_sig/src/type_sig_parse.rs
  • Cyclomatic Complexity · flow_typing_utils::type_env::predicate_of_refinement::pred (cyclomatic 43) rust_port/crates/flow_typing_utils/src/type_env.rs
  • Cyclomatic Complexity · eliminateAbstractComponent.eliminateAbstractComponent (cyclomatic 43) packages/flow-upgrade/src/codemods/eliminateAbstractComponent.js
  • Cyclomatic Complexity · flow_common_errors::error_utils::compare_printable_error (cyclomatic 42) rust_port/crates/flow_common_errors/src/error_utils.rs
  • Cyclomatic Complexity · flow_server_command_handler::command_handler::get_persistent_handler (cyclomatic 42) rust_port/crates/flow_server_command_handler/src/command_handler.rs
  • Cyclomatic Complexity · flow_env_builder::name_def::expression_is_definitely_synthesizable::synthesizable (cyclomatic 41) rust_port/crates/flow_env_builder/src/name_def.rs
  • Cyclomatic Complexity · flow_parser::type_parser::object_type::property (cyclomatic 41) rust_port/crates/flow_parser/src/type_parser.rs
  • Cyclomatic Complexity · Walker::walk_from_eval (cyclomatic 41) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs
  • Cyclomatic Complexity · flow_typing_utils::exhaustive::filter_object_by_pattern (cyclomatic 41) rust_port/crates/flow_typing_utils/src/exhaustive.rs

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 1047 findings

These 1047 critical or serious findings were in the previous survey, on 26 October 2026, and are gone from this one. The first 100 are listed here.

  • Cohesion (LCOM4) · Low cohesion: Test (LCOM4 5) newtests/Tester.js
  • Secret Scanning · Leaked secret: hardcoded-credential evals/graders/file_contains.sh
  • Secret Scanning · Leaked secret: hardcoded-credential evals/graders/no_flowfixme.sh
  • Explicit Debt · TodoComment rust_port/crates/flow_typing_utils/src/annotation_inference.rs
  • Explicit Debt · TodoComment rust_port/crates/flow_typing_utils/src/annotation_inference.rs
  • Explicit Debt · TodoComment rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs
  • Explicit Debt · TodoComment rust_port/crates/flow_typing/src/ty_normalizer_imports.rs
  • Boundary Type-Coupling · Cross-context type T (newtests → flow-dev-tools) packages/flow-dev-tools/flow-typed/node.js
  • Boundary Type-Coupling · Cross-context type T (newtests → flow-dev-tools) packages/flow-dev-tools/flow-typed/node.js
  • Boundary Type-Coupling · Cross-context type T (newtests → flow-dev-tools) packages/flow-dev-tools/flow-typed/node.js
  • Boundary Type-Coupling · Cross-context type T (newtests → flow-dev-tools) packages/flow-dev-tools/flow-typed/node.js
  • Secrets (history) · High secret: WD-SECRET-0002 newtests/lsp/completion/component_syntax_auto_imports/__snapshots__/type.json
  • Secrets (history) · High secret: WD-SECRET-0002 newtests/lsp/completion/component_syntax_auto_imports/__snapshots__/value.json
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Static Analysis (SAST) · Medium: insecure-request tslib/lib.dom.d.ts
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium advisory (unsound): RUSTSEC-2026-0386 REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Change Coupling · Change-coupling hub: misc.js → flowlib_contents.rs, tslib_contents.rs, flow-loader.js lib/misc.js
  • Change Coupling · Change coupling: ty_printer.rs ↔ query_types.rs rust_port/crates/flow_common_ty/src/ty_printer.rs
  • Code Duplication · Duplicated block with local edits (90 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (30 lines × 2 locations) evals/evals/04_ts_to_flow/comprehensive_dom_attributes/ideal/main.js
  • Code Duplication · Duplicated block (29 lines × 9 locations) lib/lib.es5.js
  • Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) evals/evals/04_ts_to_flow/hook_utilities_complex/ideal/main.js
  • Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) newtests/lsp/queries/outline.js
  • Code Duplication · Duplicated block (25 lines × 2 locations) newtests/lsp/wait_for_recheck/test.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) evals/evals/01_error_fixing/error_005_array_variance/ideal/main.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) evals/evals/01_error_fixing/error_023_interface_property_variance/ideal/main.js
  • Code Duplication · Duplicated block (24 lines × 3 locations) newtests/lsp/signatureHelp/calls_monomorphic.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) packages/flow-api-translator/src/flowToFlowDef.js
  • Code Duplication · Duplicated block (23 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (23 lines × 2 locations) newtests/lsp/queries/test.js
  • Code Duplication · Duplicated block (23 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (23 lines × 2 locations) packages/flow-dev-tools/flow-typed/node.js
  • Code Duplication · Duplicated block (22 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (22 lines × 2 locations) packages/flow-eslint/src/scope-manager/referencer/Referencer.js
  • Code Duplication · Duplicated block (22 lines × 2 locations) packages/flow-eslint/src/scope-manager/scope/ComponentScope.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) evals/evals/04_ts_to_flow/mapped_generic_props_factories/ideal/main.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) evals/evals/04_ts_to_flow/utility_type_mappings_keys_values/ideal/main.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) newtests/lsp/wait_for_recheck/test.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (21 lines × 2 locations) packages/flow-parser/oxidized-src/estree/StripFlowTypesForBabel.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) packages/flow-transform/src/traverse/NodeEventGenerator.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) packages/flow-typed/jest.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) evals/evals/04_ts_to_flow/anonymous_interface_param/ideal/main.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) evals/evals/04_ts_to_flow/class_implements_utility_to_interface/ideal/main.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) evals/evals/04_ts_to_flow/variance_advanced/ideal/main.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) packages/flow-parser/oxidized-src/FlowParser.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) evals/evals/04_ts_to_flow/as_const_assertions/ideal/main.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) newtests/lsp/documentHighlight/test.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (19 lines × 2 locations) packages/flow-api-translator/src/flowToFlowDef.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) packages/flow-typed/jest.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) packages/flow-typed/jest.js
  • Code Duplication · Duplicated block (18 lines × 3 locations) newtests/lsp/documentHighlight/test.js
  • Code Duplication · Duplicated block (18 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (18 lines × 2 locations) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) evals/evals/01_error_fixing/error_004_exact_objects_extra_props/ideal/main.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) evals/evals/01_error_fixing/error_006_generic_bounds/ideal/main.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/flow-api-translator/src/flowToFlowDef.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/flow-api-translator/src/flowToFlowDef.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/flow-dev-tools/flow-typed/node.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/flow-typed/jest.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/scripts/transform/genTransformCloneTypes.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) evals/evals/01_error_fixing/error_009_react_props/ideal/main.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) evals/evals/01_error_fixing/error_026_asymmetric_subtyping/ideal/main.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) evals/evals/02_unique_features/match_021_instance_pattern_union/ideal/main.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) evals/evals/04_ts_to_flow/asymmetric_subtyping_kinds/ideal/main.js
  • Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) evals/evals/04_ts_to_flow/component_props_element_ref/ideal/main.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) newtests/lsp/connection/test.js
  • Code Duplication · Duplicated block (16 lines × 4 locations) newtests/lsp/documentHighlight/test.js
  • Code Duplication · Duplicated block (16 lines × 3 locations) newtests/lsp/queries/test.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (16 lines × 2 locations) packages/flow-api-translator/src/flowToFlowDef.js
  • Code Duplication · Duplicated block (16 lines × 4 locations) packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) evals/evals/01_error_fixing/error_027_interface_spread/ideal/main.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) evals/evals/01_error_fixing/error_030_this_type_variance/ideal/main.js
Rebuild cost: about €570,000 · Estimate
Cost to rebuild€190,000 to €960,000, for 3,177 to 10,078 hours of work, about 3.9 person-years for 2 to 8 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 45. 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: 576,293 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
Resolve the 1 finding(s) in Type Safety.
Raises the score by about 6 points · Medium effort · Type Safety
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with codegen.rs.
Raises the score by about 2 points · Low effort · ADR Quality
3
Interpolated log message defeats structured logging
Raises the score by about 4 points · Medium effort · Structured logging

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 €570,000 to build again, about 3.9 person-years of work. Its weakest lens is Code Health, at 33 (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
Resolve the 1 finding(s) in Type Safety. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort, because it clears the 1 Type Safety findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 15% on every change. The history of the code shows how much it changes: about 470,344 lines over the last 90 days, which is about 1,907,506 lines a year. At that pace, the extra work comes to an estimated 320.2 to 1920.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: 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.

1685 modules, with 5369 dependencies between them. 12 loops run through 132 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1645 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 flow_analysis.ssa_api2 flow_common.polarity3 flow_data_structure_wrapper.ord_set4 flow_lsp.lsp.ping5 flow_parser.file_key6 flow_parser.jsdoc.param7 newtests.lsp.queries.hover_refs8 flow_common.refinement_invalidation9 flow_parser.ast.statement.enum_declaration10 flow_parser.ast.types.function11 flow_parser.ast.types.type_template_literal12 flow_parser.loc13 lib.lib_es514 flow_parser.ast.types15 lib.misc16 packages.flow-api-translator.src.utils.ts-estree-ast-types17 flow_parser.ast.class18 flow_parser.ast.pattern19 packages.flow-eslint.src.scope-manager.ScopeManager20 flow_parser.ast.statement21 flow_parser.ast.types.object22 flow_parser.ast.expression23 flow_common.reason24 flow_data_structure_wrapper.smol_str25 flow_common.options26 flow_parser.ast27 flow_parser.ast_visitor28 flow_parser.polymorphic_ast_mapper29 flow_aloc30 flow_parser_utils.file_sig31 flow_analysis.scope_builder32 flow_env_builder.name_def_types33 flow_heap.transaction34 flow_type_sig.type_sig_parse35 flow_common_ty.ty36 flow_typing_type.type_37 flow_typing_context38 flow_typing_errors.error_message39 flow_env_builder_resolver.name_resolver40 flow_typing_flow_js_env
1 flow_analysis.ssa_api
2 flow_common.polarity
3 flow_data_structure_wrapper.ord_set
4 flow_lsp.lsp.ping
5 flow_parser.file_key
6 flow_parser.jsdoc.param
7 newtests.lsp.queries.hover_refs
8 flow_common.refinement_invalidation2
9 flow_parser.ast.statement.enum_declaration1
10 flow_parser.ast.types.function13
11 flow_parser.ast.types.type_template_literal1
12 flow_parser.loc1
13 lib.lib_es515
14 flow_parser.ast.types325
15 lib.misc23
16 packages.flow-api-translator.src.utils.ts-estree-ast-types48
17 flow_parser.ast.class126217
18 flow_parser.ast.pattern34
19 packages.flow-eslint.src.scope-manager.ScopeManager121
20 flow_parser.ast.statement2214255
21 flow_parser.ast.types.object5113
22 flow_parser.ast.expression13119129
23 flow_common.reason1111111433
24 flow_data_structure_wrapper.smol_str1
25 flow_common.options11
26 flow_parser.ast17
27 flow_parser.ast_visitor1010225818482185427
28 flow_parser.polymorphic_ast_mapper35129924192814
29 flow_aloc331111
30 flow_parser_utils.file_sig24184341
31 flow_analysis.scope_builder1241421314421
32 flow_env_builder.name_def_types111317112114
33 flow_heap.transaction51131
34 flow_type_sig.type_sig_parse16516317335611
35 flow_common_ty.ty11617
36 flow_typing_type.type_514612822171
37 flow_typing_context135211113789
38 flow_typing_errors.error_message3111142154
39 flow_env_builder_resolver.name_resolver452351332378181792101212
40 flow_typing_flow_js_env232
Uses a module listed above itPart of a loopThe module itself
1 flow_analysis.ssa_api2 flow_common.polarity3 flow_data_structure_wrapper.ord_set4 flow_lsp.lsp.ping5 flow_parser.file_key6 flow_parser.jsdoc.param7 newtests.lsp.queries.hover_refs8 flow_common.refinement_invalidation9 flow_parser.ast.statement.enum_declaration10 flow_parser.ast.types.function11 flow_parser.ast.types.type_template_literal12 flow_parser.loc13 lib.lib_es514 flow_parser.ast.types15 lib.misc16 packages.flow-api-translator.src.utils.ts-estree-ast-types17 flow_parser.ast.class18 flow_parser.ast.pattern19 packages.flow-eslint.src.scope-manager.ScopeManager20 flow_parser.ast.statement21 flow_parser.ast.types.object22 flow_parser.ast.expression23 flow_common.reason24 flow_data_structure_wrapper.smol_str25 flow_common.options26 flow_parser.ast27 flow_parser.ast_visitor28 flow_parser.polymorphic_ast_mapper29 flow_aloc30 flow_parser_utils.file_sig31 flow_analysis.scope_builder32 flow_env_builder.name_def_types33 flow_heap.transaction34 flow_type_sig.type_sig_parse35 flow_common_ty.ty36 flow_typing_type.type_37 flow_typing_context38 flow_typing_errors.error_message39 flow_env_builder_resolver.name_resolver40 flow_typing_flow_js_envflow_analysis.ssa_api1flow_common.polarity2flow_data_structure_wrapper.ord_set3flow_lsp.lsp.ping4flow_parser.file_key5flow_parser.jsdoc.param6newtests.lsp.queries.hover_refs7flow_common.refinement_invalidation8flow_parser.ast.statement.enum_declaration9flow_parser.ast.types.function10flow_parser.ast.types.type_template_literal11flow_parser.loc12lib.lib_es513flow_parser.ast.types14lib.misc15packages.flow-api-translator.src.utils.ts-estree-ast-types16flow_parser.ast.class17flow_parser.ast.pattern18packages.flow-eslint.src.scope-manager.ScopeManager19flow_parser.ast.statement20flow_parser.ast.types.object21flow_parser.ast.expression22flow_common.reason23flow_data_structure_wrapper.smol_str24flow_common.options25flow_parser.ast26flow_parser.ast_visitor27flow_parser.polymorphic_ast_mapper28flow_aloc29flow_parser_utils.file_sig30flow_analysis.scope_builder31flow_env_builder.name_def_types32flow_heap.transaction33flow_type_sig.type_sig_parse34flow_common_ty.ty35flow_typing_type.type_36flow_typing_context37flow_typing_errors.error_message38flow_env_builder_resolver.name_resolver39flow_typing_flow_js_env402113111532523481262173412122142555113131191291111111433111171010225818482185427351299241928143311112418434112414213144211113171121145113116516317335611116175146128221711352111137893111142154452351332378181792101212232+1645 more modules (most-connected shown)

At a glance — Code Health · 33% · Weak · gated by D1, D2, R1, R7, X4 ·

At a glance — Architecture · 85% · Strong ·

At a glance — Maturity · 62% · Adequate ·

At a glance — Readiness · 44% · Weak · gated by R4, P3 ·

At a glance — Security · 58% · Adequate · gated by D29, D36 ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures116High / Critical
A05:2025 — Injection94High / Critical

Roadmap

Top priorities: Resolve the 1 finding(s) in Type Safety; Interpolated log message defeats structured logging; Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.

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

Do thisHelpsEffortDimension
Resolve the 1 finding(s) in Type Safety.+5.5 ptsMediumType Safety
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with codegen.rs.+1.9 ptsLowADR Quality
Interpolated log message defeats structured logging+4.1 ptsMediumStructured logging
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.8 ptsMediumSecurity & performance tooling
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.+3.2 ptsMediumDead Code
Add tests that import the unreached modules (directly or through their public entry).+2.7 ptsMediumTest Coverage
Bring the 6 bodies over 240 down to 240 or less in Cognitive Complexity — start with flow_typing_flow_js::flow_js::dispatch::__flow_impl (cognitive 646), flow_typing_errors::intermediate_error::to_printable_error (cognitive 569), flow_typing_statement::statement::mk_class_sig (cognitive 353).+1.7 ptsHighCognitive Complexity
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.+1.7 ptsMediumCode Duplication

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.4SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): Medium: REDACTED
rust_port/crates/flow_env_builder/src/find_providers.rs4.8MixedCyclomatic Complexity: flow_env_builder::find_providers::join_envs (cyclomatic 16)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
rust_port/crates/flow_typing_flow_common/src/type_subst.rs5.5MixedCyclomatic Complexity: Substituter::type_ (cyclomatic 46)
rust_port/crates/flow_services_get_def/src/get_def_utils.rs5.5MixedCyclomatic Complexity: flow_services_get_def::get_def_utils::def_info_of_typecheck_results (cyclomatic 20)
rust_port/crates/flow_analysis/src/scope_builder.rs5.5MixedCognitive Complexity: flow_analysis::scope_builder::lambda (cognitive 24)
rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs5.5MixedCognitive Complexity: ProcessRequestSearcher::jsx_element (cognitive 19)
rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs5.5MixedCognitive Complexity: flow_services_code_action::refactor_extract_utils::variable_analysis::collect_relevant_defs_with_scope (cognitive 33)
rust_port/crates/flow_parser/src/comment_attachment.rs5.5MixedGod Classes: FunctionTooLong: flow_parser::comment_attachment::statement_add_comments
rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs5.6MixedGod Classes: ClassTooLong: StripFlow
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedDependency Vulnerabilities: Medium advisory (unmaintained): REDACTED

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

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

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

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

Could not be resolved — 18

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 62 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 62 dimensions across the health lenses
D1D2D3D4D6D10D12D13D14D15D16D17D19D20D21D24D26D28D29D30D34D35D36D43D44AX10AX3AX4AX8AX9M1M2M3M4P1P10P2P3P4P6PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X15X21X27X28X29X30X4X5

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, 4957 of 4976 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 01a1d8d4-1336-7157-a7dc-012c4e294bcb.

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.

  • D5 Coupling — 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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: this repository's production source spans .ts, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 84.8% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • D10 Test 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. The 1,318 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 58 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • 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 reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/ (6 tests); jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/babel-plugin-transform-flow-enums/ (8 tests); jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/eslint-plugin-fb-flow/ (64 tests); jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/flow-enums-runtime/ (29 tests); jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/flow-for-vscode/ (9 tests); jest via `yarn install --frozen-lockfile --ignore-scripts` in packages/flow-upgrade/ (0 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — 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 repository declares package.json, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — 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 repository declares a Cargo manifest, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • 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.
  • D21 Naming Consistency — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated 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. This says nothing about whether that surface is consistent.
  • 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.
  • 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.
  • D32 Data Compliance (PII/GDPR) — 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. `evals/evals/01_error_fixing/error_002_exact_object_types/input/main.js`, `evals/evals/01_error_fixing/error_004_exact_objects_extra_props/ideal/main.js`, `evals/evals/01_error_fixing/error_005_array_variance/ideal/main.js`, `evals/evals/01_error_fixing/error_007_property_variance/ideal/main.js`, `evals/evals/01_error_fixing/error_007_property_variance/input/main.js`, … (+250 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (start). the dev server (`npm run start`) exited before it served a page. Likely cause (the repository): package.json has no "start" script, so `npm run start` could not start the app. Last output: "npm error Missing script: "start" / npm error / npm error Did you mean one of these? / npm error npm star # Mark your favorite packages / npm error npm stars # View packages marked as favorites / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • ED5 Idempotency — 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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.
  • R10 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. 194 further occurrence(s) are not listed individually; the score already reflects all 234.
  • R2 Cyclomatic Complexity — 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. 76 further occurrence(s) are not listed individually; the score already reflects all 116.
  • R4 Test Coverage — 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. 750 further occurrence(s) are not listed individually; the score already reflects all 790.
  • R7 Dead Code — 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. 2367 further occurrence(s) are not listed individually; the score already reflects all 2407.
  • X12 Unreachable branch — 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.
  • X13 Undrained process stream — 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.
  • X16 Unfloored truncation loop — 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.
  • X18 Disposal-pattern correctness — 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.
  • X23 Unguarded diagnostic materialisation — 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.
  • 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.
  • X27 Collection changed while being enumerated — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — 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.

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.
  • 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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • 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").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • 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.
  • 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

447 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was flow_typing_errors::intermediate_error::to_printable_error at 885. A further 163 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 flow_parser::flow_lexer::decode_html_entity at 254 — they are counted neither in the figure above nor in this dimension's score. 34 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: rust_port/crates/flow_common_errors/src/error_codes.rs (ErrorCode::as_str at 193), rust_port/crates/flow_parser/src/parser_common.rs (flow_parser::parser_common::identifier_name_for_token at 75), REDACTED (getTransforms::TSTypeAnnotation at 46), rust_port/crates/flow_parser/src/ast.rs (StatementInner::loc at 46), rust_port/crates/flow_parser/src/ast_visitor.rs (flow_parser::ast_visitor::statement_default at 46), and 29 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.

flow_parser::flow_lexer::token_base_inner (cyclomatic 217) · ×43rust_port/crates/flow_parser/src/flow_lexer.rs:1028
flow_typing_utils::annotation_inference::elab_t_concrete (cyclomatic 196) · ×42rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127
flow_typing_flow_js::flow_js::dispatch::__flow_impl (cyclomatic 693) · ×39rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633
flow_typing_statement::type_annotation::convert_inner (cyclomatic 199) · ×34rust_port/crates/flow_typing_statement/src/type_annotation.rs:1143
flow_typing::env_resolution::resolve_binding (cyclomatic 58) · ×15rust_port/crates/flow_typing/src/env_resolution.rs:1306

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

What to do

  1. Bring the 8 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with flow_typing_errors::intermediate_error::to_printable_error (cyclomatic 885), flow_typing_flow_js::flow_js::dispatch::__flow_impl (cyclomatic 693), flow_typing_debug::dump_error_message (cyclomatic 378). — 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 8 together lifts Cyclomatic Complexity from 3.7 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 Complexity2.5 / 10Critical✓ Tool-verified

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

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

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

695 method(s) exceeded the cognitive complexity threshold of 15; the worst was flow_typing_flow_js::flow_js::dispatch::__flow_impl at 646.

flow_parser::flow_lexer::token_base_inner (cognitive 165) · ×68rust_port/crates/flow_parser/src/flow_lexer.rs:1028
flow_typing_utils::annotation_inference::elab_t_concrete (cognitive 140) · ×63rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127
flow_typing_flow_js::flow_js::dispatch::__flow_impl (cognitive 646) · ×47rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633
flow_typing_statement::statement::mk_class_sig (cognitive 353) · ×36rust_port/crates/flow_typing_statement/src/statement.rs:15438
flow_type_sig::type_sig_parse::class_def (cognitive 102) · ×27rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11788

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

What to do

  1. Bring the 6 bodies over 240 down to 240 or less in Cognitive Complexity — start with flow_typing_flow_js::flow_js::dispatch::__flow_impl (cognitive 646), flow_typing_errors::intermediate_error::to_printable_error (cognitive 569), flow_typing_statement::statement::mk_class_sig (cognitive 353). — 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 6 together lifts Cognitive Complexity from 2.5 to about 3.9/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.0 / 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.0 / 10 · rule-coverage 100% · ceiling Prevented

710 god class(es) detected.

FunctionTooLong: flow_typing_flow_js::flow_js::dispatch::__flow_impl · ×378rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633
FileTooLong: src/statement.rs · ×182rust_port/crates/flow_typing_statement/src/statement.rs
MethodTooLong: ErrorMessage.friendly_message_of_msg · ×73rust_port/crates/flow_typing_errors/src/error_message.rs:9925
ClassTooLong: NameResolver · ×39rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1734
TooManyMethods: Context · ×21rust_port/crates/flow_typing_context/src/lib.rs:878

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

What to do

  1. Resolve the 378 FunctionTooLong finding(s) in God Classes — start with statement.rs (29), type_sig_parse.rs (20), type_annotation.rs (13). — One of this dimension's main actionable groups (378 warning-level).
  2. Resolve the 182 FileTooLong finding(s) in God Classes — start with lib.rs (8), autofix_imports.rs (2), statement.rs. — One of this dimension's main actionable groups (182 warning-level).
  3. Resolve the 73 MethodTooLong finding(s) in God Classes — start with name_def.rs (9), name_resolver.rs (8), error_message.rs (5). — One of this dimension's main actionable groups (73 warning-level).

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

D4 · Code Duplication5.6 / 10Adequate✓ Tool-verified

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

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

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

1538 duplicated block group(s) detected. 11.0 % of the production lines (63,292 of 576,293) are in a reported copy. A further 666 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 2204 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.

Duplicated block (9 lines × 2) · ×92rust_port/crates/flow_analysis/src/property_assignment.rs:527
Duplicated block (11 lines × 2) · ×87rust_port/crates/flow_analysis/src/property_assignment.rs:104
Duplicated block (7 lines × 2) · ×87rust_port/crates/flow_analysis/src/scope_builder.rs:217
Duplicated block (10 lines × 2) · ×81rust_port/crates/flow_cli/src/glean_runner.rs:627
Duplicated block (8 lines × 2) · ×81rust_port/crates/flow_analysis/src/property_assignment.rs:537

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

What to do

  1. Resolve the 92 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with statement.rs (7), ast_visitor.rs (5), lib.rs (4). — One of this dimension's main actionable groups (92 warning-level).
  2. Resolve the 87 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with statement.rs (13), type_sig_parse.rs (5), dispatch.rs (3). — One of this dimension's main actionable groups (87 warning-level).
  3. Resolve the 87 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with name_def.rs (5), type_sig_parse.rs (5), scope_builder.rs (4). — One of this dimension's main actionable groups (87 warning-level).

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

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

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

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

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

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

16 of 350 classes have LCOM4 above 3.

Low cohesion: FindDeclarations (LCOM4 31) · ×16rust_port/crates/flow_env_builder/src/find_providers.rs:1066

What to do

  1. Resolve the 16 Low cohesion finding(s) in Cohesion (LCOM4) — start with find_providers.rs (2), name_resolver.rs (2), comment_attachment.rs. — One of this dimension's main actionable groups (16 warning-level).

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

D10 · Test Quality10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

89 skipped (89 with a documented reason), 3 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1318 tests. Measured on the JavaScript/TypeScript suite only — at least 58 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: (unnamed test) · ×3tests/closure/callback_writes.js:4
Test project verifies nothing: the repository roottests/closure/callback_writes.js:4
Skipped (documented): (unnamed test) · ×89tests/unreachable/jsx_unreachable.js:5

What to do

  1. Resolve the 3 No assertions finding(s) in Test Quality — start with callback_writes.js (3). — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 Test project verifies nothing finding(s) in Test Quality — start with callback_writes.js. — One of this dimension's main actionable groups (1 warning-level).

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

D12 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

0 outdated direct gem(s), 0 pinning defect(s). 1 declaration(s) graded against rubygems.org, 1 of them against a version resolved in a committed Gemfile.lock. Whether any of these gems is DEPRECATED or YANKED is not graded — rubygems.org publishes no deprecation marker, and a yank removes a version rather than flagging it. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Whether any is UNUSED is a source question, not a registry one. Known CVEs in this dependency graph are D30's question, read from the manifest there.

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md.

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 12 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 12 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 2 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares package.json and a Cargo manifest, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots5.9 / 10Adequate✓ 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 5.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: rust_port/crates/flow_typing_errors/src/intermediate_error.rs (172×885=152220); rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs (153×693=106029); rust_port/crates/flow_typing_debug/src/lib.rs (115×426=48990)

Hotspot: rust_port/crates/flow_typing_errors/src/intermediate_error.rs · ×94rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4398

What to do

  1. Resolve the 94 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (3), intermediate_error.rs, dispatch.rs. — One of this dimension's main actionable groups (94 warning-level).

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

D16 · Bus Factor7.4 / 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 7.4 / 10 · rule-coverage 100% · ceiling Documented

137 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is rust_port/crates/flow_typing_debug/src/lib.rs. Counted over 534 of the 783 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 · ×2
Further sole-owners (lower concentration)

What to do

  1. Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 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.9 / 10Stronggated by 216 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×216rust_port/crates/flow_typing_utils/src/annotation_inference.rs:142

What to do

  1. Resolve the 216 TodoComment finding(s) in Explicit Debt — start with statement.rs (15), subtyping_kit.rs (15), exports.rs (10). — One of this dimension's main actionable groups (216 warning-level).

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

D19 · Documentation Quality8.3 / 10Strong✓ Tool-verified

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 8.3 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 documentation facets pass in full; short on: F2 example. 117 document(s) read across 23 unit(s).

Documentation: no build, run or usage example · ×5packages/babel-plugin-transform-flow-enums/README.md:1

What to do

  1. Resolve the 5 Documentation finding(s) in Documentation Quality — start with README.md (5). — One of this dimension's main actionable groups (5 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.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 foundrust_port/crates/flow_parser_wasm/src/bin/codegen.rs:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with codegen.rs. — 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.

D21 · Naming Consistency7.2 / 10Strong✓ Tool-verified

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

5 naming inconsistencies among 178 declarations measured against a convention their peers follow.

`isBitwiseANDToken` spells `AND` where 160 names in the project spell it `And`packages/flow-estree/src/generated/predicates.js:1480
`isLogicalANDToken` spells `AND` where 160 names in the project spell it `And`packages/flow-estree/src/generated/predicates.js:1500
`isBitwiseANDEqualToken` spells `AND` where 160 names in the project spell it `And`packages/flow-estree/src/generated/predicates.js:1570
`isLogicalANDEqualToken` spells `AND` where 160 names in the project spell it `And`packages/flow-estree/src/generated/predicates.js:1580
`UseAT` spells `AT` where 13 names in the project spell it `At`tests/type_at_pos_imports/import-alias.js:37

What to do

  1. Resolve the 1 `isBitwiseANDToken` spells `AND` where 160 names in the project spell it… finding(s) in Naming Consistency — start with predicates.js. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `isLogicalANDToken` spells `AND` where 160 names in the project spell it… finding(s) in Naming Consistency — start with predicates.js. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `isBitwiseANDEqualToken` spells `AND` where 160 names in the project… finding(s) in Naming Consistency — start with predicates.js. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value9.5 9.3 / 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.3 / 10 · rule-coverage 97% · ceiling Documented

47 of 10155 judged comments only repeat the code they sit on (0.5 %). 464 comment(s) in another language or script were not judged.

redundant comment · ×33evals/evals/03_project_patterns/relay_core/context/RelayHooks.js:22
doc comments repeat the names · ×10lib/lib.es5.js:86

✓ On the Gold path — maintain.

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

D26 · Project Cohesion4.1 / 10Weak✓ Tool-verified

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

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

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

7 of 22 build units (Cargo, npm) flagged as possibly oversized/incoherent.

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)10.0 / 10Exemplary○ Nothing flagged

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

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

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.8 / 10Critical✓ 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 0.8 / 10 · rule-coverage 100% · ceiling Documented

94 finding(s): 0 critical, 70 high, 24 medium, 0 low. 63 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 420 file(s) — `evals/evals/01_error_fixing/error_002_exact_object_types/input/main.js` (line 30), `evals/evals/01_error_fixing/error_004_exact_objects_extra_props/ideal/main.js` (line 13), `evals/evals/01_error_fixing/error_005_array_variance/ideal/main.js` (line 13), `evals/evals/01_error_fixing/error_007_property_variance/ideal/main.js` (line 13), `evals/evals/01_error_fixing/error_007_property_variance/input/main.js` (line 13), … (+415 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

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

What to do

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

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

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

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

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

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

109 finding(s): 1 critical, 64 high, 27 medium, 17 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.9 / 10Stronggated by 9 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.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: lib.rs↔default_resolve.rs 78%; any_helpers.rs↔implicit_instantiation.rs 71%; lib.rs↔any_helpers.rs 71%

Change coupling: any_helpers.rs ↔ implicit_instantiation.rs · ×8rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:1
Change-coupling hub: default_resolve.rs → lib.rs, any_helpers.rs, type_util.rsrust_port/crates/flow_typing_flow_js/src/default_resolve.rs

What to do

  1. Resolve the 8 Change coupling finding(s) in Change Coupling — start with misc.js (2), any_helpers.rs, lib.rs. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with default_resolve.rs. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 1 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.

End-of-life runtime: Node.js 16packages/eslint-plugin-fb-flow/package.json:29

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with package.json. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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.

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.

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 structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy4.0 / 10Weak✓ 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.

  • README.md links to `src/parser/README.md`, but `src/parser/README.md` 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. — README.md:105
  • packages/flow-parser/README.md names React 19, but the manifest declares `react` ^18.3.1. 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. — packages/flow-parser/README.md:21
  • website/docs/react/refs.md names React 19, but the manifest declares `react` ^18.3.1. 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. — website/docs/react/refs.md:84

What to do

  • Reconcile the README with reality: README.md links to `src/parser/README.md`, but `src/parser/README.md` does not exist; packages/flow-parser/README.md names React 19, but the manifest declares `react` ^18.3.1; website/docs/react/refs.md names React 19, but the manifest declares `react` ^18.3.1.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P2 · Observability6.2 / 10Adequate✓ 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 24/32 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/flow-bin`, `packages/flow-dev-tools`, `packages/flow-remove-types`, `packages/flow-upgrade` and 3 more.
  • `packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageProvider.ts` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageProvider.ts:90

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

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

What to do

  • Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

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

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

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

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

R1 · Type Safety0.2 / 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.

  • 224 typed · 9208 plain JS — the untyped files are evals/evals/01_error_fixing/error_001_refinement_invalidation/ideal/main.js, evals/evals/01_error_fixing/error_001_refinement_invalidation/input/main.js, evals/evals/01_error_fixing/error_002_exact_object_types/ideal/main.js, evals/evals/01_error_fixing/error_002_exact_object_types/input/main.js, evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js, evals/evals/01_error_fixing/error_003_unknown_type_refinement/input/main.js (+9202 more). 0 production file(s) opt out entirely with @ts-nocheck · 11 @ts-ignore suppression(s).
R10 · Code Duplication4.7 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 19 duplicated blocks under packages/ have copies in at least two of the sibling directories flow-api-translator, flow-dev-tools, flow-estree, flow-transform, flow-typed, flow-upgrade — 12 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4
  • 16 duplicated blocks under newtests/lsp/ have copies in at least two of the sibling directories auto_close_jsx, completion, connection, documentHighlight, document_paste, edits (+8 more sibling(s) not listed) — 8 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — newtests/lsp/queries/outline.js:3
  • 5 duplicated blocks under evals/evals/02_unique_features/ have copies in at least two of the sibling directories component_006_rest_params, component_008_ref_param, component_025_migrate_forwardref, enum_001_string_enum_cast, enum_003_boolean_symbol, hook_003_hook_type_annotation (+1 more sibling(s) not listed) — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — evals/evals/02_unique_features/enum_001_string_enum_cast/ideal/main.js:32
  • REDACTED:32 · REDACTED:40 — the two spans are one implementation copied and then locally edited — 526 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:32
  • evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/ideal/main.js:18 · evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/input/source.ts:4 — the two spans are one implementation copied and then locally edited — 368 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/ideal/main.js:18
  • packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4 · packages/flow-typed/glob.js:13 — the two spans are one implementation copied and then locally edited — 420 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4
  • evals/evals/02_unique_features/hook_005_conditional_call/ideal/main.js:13 · evals/evals/02_unique_features/hook_005_conditional_call/input/main.js:13 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/02_unique_features/hook_005_conditional_call/ideal/main.js:13
  • newtests/lsp/signatureHelp/test.js:875 · newtests/lsp/signatureHelp/test.js:921 · newtests/lsp/signatureHelp/test.js:967 · newtests/lsp/signatureHelp/test.js:1013 · +12 more site(s) not listed — all 16 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:875
  • packages/flow-typed/jest.js:332 · packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:762 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/flow-typed/jest.js:332
  • evals/evals/01_error_fixing/error_022_implements_object_type/ideal/main.js:16 · evals/evals/01_error_fixing/error_022_implements_object_type/input/main.js:16 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/01_error_fixing/error_022_implements_object_type/ideal/main.js:16
  • evals/evals/04_ts_to_flow/unknown_top_type_narrowing/ideal/main.js:10 · evals/evals/04_ts_to_flow/unknown_top_type_narrowing/input/source.ts:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/04_ts_to_flow/unknown_top_type_narrowing/ideal/main.js:10
  • newtests/lsp/signatureHelp/test.js:1893 · newtests/lsp/signatureHelp/test.js:1962 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:1893
  • newtests/lsp/signatureHelp/test.js:1592 · newtests/lsp/signatureHelp/test.js:1631 · newtests/lsp/signatureHelp/test.js:1670 · newtests/lsp/signatureHelp/test.js:1709 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:1592
  • packages/flow-dev-tools/flow-typed/node.js:307 · packages/flow-dev-tools/flow-typed/node.js:364 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — packages/flow-dev-tools/flow-typed/node.js:307
  • newtests/lsp/signatureHelp/test.js:2034 · newtests/lsp/signatureHelp/test.js:2071 · newtests/lsp/signatureHelp/test.js:2109 · newtests/lsp/signatureHelp/test.js:2147 · +17 more site(s) not listed — all 21 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:2034
  • evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:14 · evals/evals/01_error_fixing/error_019_class_nominal_typing/input/main.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:14
  • packages/flow-typed/jest.js:669 · packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:1094 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/flow-typed/jest.js:669
  • packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:537 · packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:667 — the two spans are one implementation copied and then locally edited — 185 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. — packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:537
  • evals/evals/02_unique_features/hook_007_migrate_basic/ideal/main.js:12 · evals/evals/02_unique_features/hook_007_migrate_basic/input/main.js:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/02_unique_features/hook_007_migrate_basic/ideal/main.js:12
  • evals/evals/02_unique_features/match_017_unreachable_patterns/ideal/main.js:10 · evals/evals/02_unique_features/match_017_unreachable_patterns/input/main.js:10 — the two spans are one implementation copied and then locally edited — 163 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/02_unique_features/match_017_unreachable_patterns/ideal/main.js:10
  • evals/evals/04_ts_to_flow/class_private_members/ideal/main.js:20 · evals/evals/04_ts_to_flow/class_private_members/input/source.ts:6 — the two spans are one implementation copied and then locally edited — 269 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/04_ts_to_flow/class_private_members/ideal/main.js:20
  • newtests/lsp/signatureHelp/test.js:153 · newtests/lsp/signatureHelp/test.js:185 · newtests/lsp/signatureHelp/test.js:217 · newtests/lsp/signatureHelp/test.js:249 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:153
  • newtests/lsp/signatureHelp/test.js:587 · newtests/lsp/signatureHelp/test.js:618 · newtests/lsp/signatureHelp/test.js:649 · newtests/lsp/signatureHelp/test.js:680 · +3 more site(s) not listed — all 7 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:587
  • newtests/lsp/signatureHelp/test.js:2829 · newtests/lsp/signatureHelp/test.js:2860 · newtests/lsp/signatureHelp/test.js:2892 · newtests/lsp/signatureHelp/test.js:2924 · +6 more site(s) not listed — all 10 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:2829
  • packages/flow-dev-tools/flow-typed/node.js:2782 · packages/flow-dev-tools/flow-typed/node.js:2851 — 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. — packages/flow-dev-tools/flow-typed/node.js:2782
  • newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:472 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:502 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:532 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:562 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:472
  • newtests/lsp/signatureHelp/test.js:2848 · newtests/lsp/signatureHelp/test.js:2880 · newtests/lsp/signatureHelp/test.js:2912 · newtests/lsp/signatureHelp/test.js:2944 · +4 more site(s) not listed — all 8 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/signatureHelp/test.js:2848
  • packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:150 · packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:233 — 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. — packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:150
  • evals/evals/02_unique_features/hook_004_mutation_prevention/ideal/main.js:13 · evals/evals/02_unique_features/hook_004_mutation_prevention/input/main.js:13 — the two spans are one implementation copied and then locally edited — 176 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/02_unique_features/hook_004_mutation_prevention/ideal/main.js:13
  • REDACTED:2954 · REDACTED:3001 — 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:2954
  • evals/evals/02_unique_features/match_022_instance_superclass/ideal/main.js:10 · evals/evals/02_unique_features/match_022_instance_superclass/input/main.js:10 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — evals/evals/02_unique_features/match_022_instance_superclass/ideal/main.js:10
  • packages/flow-dev-tools/flow-typed/node.js:2656 · packages/flow-dev-tools/flow-typed/node.js:2693 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/flow-dev-tools/flow-typed/node.js:2656
  • evals/evals/01_error_fixing/error_020_ts_access_modifiers/ideal/main.js:12 · evals/evals/01_error_fixing/error_020_ts_access_modifiers/input/main.js:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/01_error_fixing/error_020_ts_access_modifiers/ideal/main.js:12
  • evals/evals/01_error_fixing/error_025_object_this_reference/ideal/main.js:13 · evals/evals/01_error_fixing/error_025_object_this_reference/input/main.js:13 — the two spans are one implementation copied and then locally edited — 190 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/01_error_fixing/error_025_object_this_reference/ideal/main.js:13
  • evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/ideal/main.js:13 · evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/input/source.ts:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/ideal/main.js:13
  • evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/ideal/main.js:22 · evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/input/source.ts:12 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/ideal/main.js:22
  • newtests/lsp/code-action/quickfix/match/test.js:21 · newtests/lsp/code-action/quickfix/match/test.js:48 · newtests/lsp/code-action/quickfix/match/test.js:75 · newtests/lsp/code-action/quickfix/match/test.js:102 · +17 more site(s) not listed — all 21 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/code-action/quickfix/match/test.js:21
  • lib/lib.es5.js:1993 · lib/lib.es5.js:2275 · lib/lib.es5.js:2557 · lib/lib.es5.js:2838 · +5 more site(s) not listed — all 9 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — lib/lib.es5.js:1993
  • newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:77 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:103 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:129 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:155 — all 4 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:77
  • evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js:10 · evals/evals/01_error_fixing/error_003_unknown_type_refinement/input/main.js:10 — the two spans are one implementation copied and then locally edited — 119 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js:10

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.
R11 · Import Boundaries9.9 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • packages/flow-dev-tools/src/command/allCommands.js:14 imports packages/flow-dev-tools/src/new-test/new-testCommand.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/command/allCommands.js:14
  • packages/flow-dev-tools/src/command/allCommands.js:17 imports packages/flow-dev-tools/src/test/testCommand.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/command/allCommands.js:17
  • packages/flow-dev-tools/src/record/recordRunner.js:16 imports packages/flow-dev-tools/src/test/builder.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/record/recordRunner.js:16
  • packages/flow-dev-tools/src/record/recordRunner.js:17 imports packages/flow-dev-tools/src/test/findTests.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/record/recordRunner.js:17
  • packages/flow-dev-tools/src/record/recordRunner.js:19 imports packages/flow-dev-tools/src/test/findTests.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/record/recordRunner.js:19
  • packages/flow-dev-tools/src/record/recordRunner.js:20 imports packages/flow-dev-tools/src/test/RunQueue.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/flow-dev-tools/src/record/recordRunner.js:20
  • packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts:26 imports vscode-languageclient/lib/common/utils/uuid, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts:26
  • packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageFeature.ts:11 imports vscode-languageclient/lib/common/utils/uuid, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageFeature.ts:11

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (6 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (2 rows).
R2 · Cyclomatic Complexity8.0 / 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.

  • (top-level) has cyclomatic complexity 1153 and cognitive complexity 1152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/type_printer/types.js:5
  • (anonymous) has cyclomatic complexity 259 and cognitive complexity 450; 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. — tests/refinements/invalidation.js:41
  • handleSpecialObjectCompare has cyclomatic complexity 107 and cognitive complexity 143; 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. — packages/flow-parser/test/esprima_test_runner.js:56
  • (top-level) has cyclomatic complexity 95 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/disjoint_union_perf/jsAst.js:4
  • GenericTypeAnnotation has cyclomatic complexity 81 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2491
  • (top-level) has cyclomatic complexity 77 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/enums/refinement.js:6
  • (anonymous) has cyclomatic complexity 71 and cognitive complexity 105; 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. — tests/refinements/invalidation.js:235
  • (anonymous) has cyclomatic complexity 66 and cognitive complexity 101; 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. — tests/refinements/invalidation.js:183
  • (top-level) has cyclomatic complexity 56 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/switch_case_typing/test.js:1
  • (top-level) has cyclomatic complexity 48 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/sketchy_null_default/test.js:7
  • transform has cyclomatic complexity 47 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:33
  • eliminateAbstractComponent has cyclomatic complexity 43 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-upgrade/src/codemods/eliminateAbstractComponent.js:19
  • runTest has cyclomatic complexity 35 and cognitive complexity 55; 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. — packages/flow-parser/test/esprima_test_runner.js:457
  • convertClassMember has cyclomatic complexity 32 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-api-translator/src/flowToFlowDef.js:1499
  • (top-level) has cyclomatic complexity 31 and cognitive complexity 38; 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. — tests/constant_condition/unary_not.js:1
  • (top-level) has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/parser/test/flow/expression/conditional/deeply_nested_parenthesized_consequents.js:1
  • attach has cyclomatic complexity 30 and cognitive complexity 53; 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. — packages/flow-transform/src/transform/comments/prettier/main/comments.js:161
  • compare has cyclomatic complexity 30 and cognitive complexity 50; 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. — packages/flow-parser/test/esprima_test_runner.js:376
  • DeclareExportDeclaration has cyclomatic complexity 30 and cognitive complexity 40; 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:1384
  • parse has cyclomatic complexity 30 and cognitive complexity 36; 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. — packages/flow-parser/oxidized-src/FlowParser.js:176
  • f has cyclomatic complexity 28 and cognitive complexity 31; 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. — tests/new_generics/maybe.js:3
  • runTestSuite has cyclomatic complexity 27 and cognitive complexity 62; 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. — packages/flow-dev-tools/src/test/runTestSuite.js:46
  • compare has cyclomatic complexity 26 and cognitive complexity 61; 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. — packages/flow-parser/__tests__/runWasmFixtures.js:243
  • ObjectTypeAnnotation has cyclomatic complexity 25 and cognitive complexity 47; 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:3802
  • runOnce has cyclomatic complexity 24 and cognitive complexity 69; 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. — packages/flow-dev-tools/src/test/testRunner.js:38
  • compare has cyclomatic complexity 24 and cognitive complexity 59; 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. — packages/flow-parser/test/hardcoded_test_runner.js:68
  • detectSourceType has cyclomatic complexity 24 and cognitive complexity 30; 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. — packages/flow-parser/oxidized-src/FlowParser.js:396
  • _async_scope has cyclomatic complexity 24 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/constant_condition/err1/promise.js:1
  • validateRendered has cyclomatic complexity 23 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts:63
  • getDiff has cyclomatic complexity 22 and cognitive complexity 56; 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. — packages/flow-dev-tools/src/test/assertions/simpleDiffAssertion.js:27
  • logical has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/unused_promise/test.js:37
  • main has cyclomatic complexity 22 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/__tests__/flow_dot_js_smoke_test.js:15
  • (top-level) has cyclomatic complexity 21 and cognitive complexity 31; 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. — tests/optional_chaining/refinements2.js:3
  • handleClassComments has cyclomatic complexity 21 and cognitive complexity 27; 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. — packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:381
  • (top-level) has cyclomatic complexity 21 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tests/constant_condition/string_literal.js:1
  • convertExport has cyclomatic complexity 21 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-api-translator/src/flowToFlowDef.js:501
  • DeclareClass has cyclomatic complexity 20 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:1150
  • convertExportDeclaration has cyclomatic complexity 20 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. — packages/flow-api-translator/src/flowToFlowDef.js:903
  • VariableDeclarator has cyclomatic complexity 20 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. — packages/flow-upgrade/src/codemods/collapseObjectInitialization.js:156
  • analyzePattern has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:287
R3 · Large Files8.6 / 10Strong✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • newtests/lsp/completion/test.js has 10576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/completion/test.js:1
  • packages/flow-dev-tools/flow-typed/node.js has 5655 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-dev-tools/flow-typed/node.js:1
  • REDACTED has 4645 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
  • lib/lib.es5.js has 4010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — lib/lib.es5.js:1
  • newtests/lsp/documentSymbol/test.js has 3629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/documentSymbol/test.js:1
  • newtests/lsp/signatureHelp/test.js has 3577 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/signatureHelp/test.js:1
  • packages/flow-estree/src/types.js has 2158 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-estree/src/types.js:1
  • packages/flow-api-translator/src/flowToFlowDef.js has 2063 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-api-translator/src/flowToFlowDef.js:1
  • REDACTED has 1995 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
  • newtests/lsp/selectionRange/test.js has 1957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/selectionRange/test.js:1
  • evals/flow-typed/environment/jsx.js has 1929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — evals/flow-typed/environment/jsx.js:1
  • packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js has 1196 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:1
  • packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:1
  • packages/flow-eslint/src/scope-manager/referencer/Referencer.js has 934 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-eslint/src/scope-manager/referencer/Referencer.js:1
  • packages/flow-transform/src/transform/comments/prettier/language-js/comments.js has 903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:1
  • packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js has 828 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:1
  • packages/flow-typed/prettier.js has 813 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-typed/prettier.js:1
  • packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js has 804 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:1
  • newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js has 797 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:1
  • packages/flow-remove-types/index.js has 782 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-remove-types/index.js:1
  • packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:1
  • packages/flow-typed/jest.js has 751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-typed/jest.js:1
  • newtests/lsp/code-action/quickfix/react/test.js has 685 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/code-action/quickfix/react/test.js:1
  • newtests/lsp/diagnostics/test.js has 617 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/diagnostics/test.js:1
  • newtests/lsp/code-action/quickfix/match/test.js has 601 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/code-action/quickfix/match/test.js:1
  • newtests/lsp/code-action/refactor/test.js has 587 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — newtests/lsp/code-action/refactor/test.js:1
  • src/flow_dot_js_wasm.js has 527 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/flow_dot_js_wasm.js:1
  • packages/flow-transform/src/transform/TransformContext.js has 521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-transform/src/transform/TransformContext.js:1
  • packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts:1
  • REDACTED has 451 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
  • packages/flow-eslint/src/scope-manager/scope/ScopeBase.js has 436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-eslint/src/scope-manager/scope/ScopeBase.js:1
  • packages/flow-parser/oxidized-src/FlowParser.js has 423 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-parser/oxidized-src/FlowParser.js:1
  • packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage2.0 / 10Critical✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11
  • packages/flow-remove-types/test/test-node-module.js:4 imports './missing-type-only-module', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/flow-remove-types/test/test-node-module.js:4
  • src/parser/test/flow/import_unsupported_phase/contextual_default_and_named.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/import_unsupported_phase/contextual_default_and_named.js:1
  • src/parser/test/flow/import_unsupported_phase/contextual_default_binding.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/import_unsupported_phase/contextual_default_binding.js:1
  • src/parser/test/flow/import_unsupported_phase/contextual_import_equals.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/import_unsupported_phase/contextual_import_equals.js:1
  • src/parser/test/flow/import_unsupported_phase/default_binding.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/import_unsupported_phase/default_binding.js:1
  • src/parser/test/flow/import_unsupported_phase/unknown_phase.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/import_unsupported_phase/unknown_phase.js:1
  • src/parser/test/flow/ts_syntax/export_type_specifier.js:2 imports './export.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/parser/test/flow/ts_syntax/export_type_specifier.js:2
  • tests/ambient_declarations/use_components.js:5 imports './components.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (2 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_components.js:5
  • tests/ambient_declarations/use_functions_no_semi.js:1 imports './functions_no_semi', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_functions_no_semi.js:1
  • tests/ambient_declarations/use_implicit_functions.js:17 imports './functions', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_implicit_functions.js:17
  • tests/ambient_declarations/use_optional_destructuring.js:1 imports './optional_destructuring', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_optional_destructuring.js:1
  • tests/ambient_declarations/use_optional_methods.js:1 imports './optional_methods', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_optional_methods.js:1
  • tests/ambient_declarations/use_variables.js:5 imports './variables.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/ambient_declarations/use_variables.js:5
  • tests/annotate_exports_import_paths/file.js:4 imports './lib-flow', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/annotate_exports_import_paths/file.js:4
  • tests/autocomplete_from_a_to_g/bar.js:3 imports './unknown', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/autocomplete_from_a_to_g/bar.js:3
  • tests/cancelable_rechecks/sleep_dependent.js:3 imports './sleep', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/cancelable_rechecks/sleep_dependent.js:3
  • tests/config_module_file_exts_precedence/test.js:2 imports './aaa_vs_zzz', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (4 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/config_module_file_exts_precedence/test.js:2
  • tests/config_module_name_rewrite_node/A.js:3 imports './1DoesntExist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/config_module_name_rewrite_node/A.js:3
  • tests/config_untyped/test.js:9 imports './untyped/bogus', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/config_untyped/test.js:9
  • tests/declaration_files_node/test_relative.js:19 imports './confusing_dir', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/declaration_files_node/test_relative.js:19
  • tests/declaration_files_parse_error/test.js:3 imports './no_pragma', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/declaration_files_parse_error/test.js:3
  • tests/dir_coverage/b.js:3 imports './folder/c', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/dir_coverage/b.js:3
  • tests/dir_coverage/other_folder/h.js:3 imports '../folder/c', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/dir_coverage/other_folder/h.js:3
  • tests/incremental_basic/tmp1/b.js:2 imports './a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_basic/tmp1/b.js:2
  • tests/incremental_basic/tmp3/b.js:2 imports './a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_basic/tmp3/b.js:2
  • tests/incremental_cycle/tmp1/B.js:2 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_cycle/tmp1/B.js:2
  • tests/incremental_cycle/tmp1/C.js:2 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_cycle/tmp1/C.js:2
  • tests/incremental_cycle/tmp2/B.js:2 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_cycle/tmp2/B.js:2
  • tests/incremental_cycle/tmp3/B.js:2 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/incremental_cycle/tmp3/B.js:2
  • tests/json/test.js:6 imports './b', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/json/test.js:6
  • tests/multiplatform/android_only_use.android.js:1 imports './android_only', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform/android_only_use.android.js:1
  • tests/multiplatform/test_interface_import.js:10 imports './allow_no_interface', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform/test_interface_import.js:10
  • tests/multiplatform_incremental/import_A.js:1 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_incremental/import_A.js:1
  • tests/multiplatform_incremental/import_B.js:1 imports './B', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_incremental/import_B.js:1
  • tests/multiplatform_subtyping/test_subtyping_outside_of_conformance_checks.js:5 imports './classes', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_subtyping/test_subtyping_outside_of_conformance_checks.js:5
  • tests/multiplatform_web_and_native/native/use_tests.android.js:1 imports '../xplat/all_platform_forked', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_web_and_native/native/use_tests.android.js:1
  • tests/multiplatform_web_and_native/native/use_tests.ios.js:1 imports '../xplat/all_platform_forked', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_web_and_native/native/use_tests.ios.js:1
  • tests/multiplatform_web_and_native/native/use_tests.js:1 imports '../xplat/all_platform_forked', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_web_and_native/native/use_tests.js:1
  • tests/multiplatform_web_and_native/native/use_tests.native.js:1 imports '../xplat/all_platform_forked', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/multiplatform_web_and_native/native/use_tests.native.js:1

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.9 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • This repository declares test tooling, and the ✓ above records that declaration — but packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js and 65 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11
R7 · Dead Code2.5 / 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.

  • 1 file(s) (~1 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — tests/declaration_files_haste/external/_d3
  • 1 file(s) (~17 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — tests/json
  • 1 file(s) (~0 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — tests/node_haste/external/_d3
  • Unreachable from the 1085 application, 212 tooling and 8951 test entry point(s) detected in this repo. Gate removals on `yarn run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (1085 application, 212 tooling, 8951 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 (×36) — newtests/lsp/completion/test.js, packages/flow-dev-tools/flow-typed/node.js, newtests/lsp/documentSymbol/test.js, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene4.5 / 10Weak✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. — REDACTED:16
  • Declared in packages/flow-dev-tools/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Declared in packages/flow-for-vscode/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
  • Declared in packages/scripts/bootstrap/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Only test files import it (first: packages/flow-eslint/__tests__/eslint-scope/get-declared-variables-test.js:39) — move it to devDependencies. — packages/flow-eslint/package.json:26

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports6.6 / 10Adequate✓ 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.

  • packages/flow-dev-tools/src/command/allCommands.js → packages/flow-dev-tools/src/help/helpCommand.js → packages/flow-dev-tools/src/command/allCommands.js — packages/flow-dev-tools/src/command/allCommands.js:13
  • packages/flow-remove-types/loader.mjs → REDACTED → packages/flow-remove-types/loader.mjs — packages/flow-remove-types/loader.mjs:6

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker.

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.

  • 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+ (`sha2::Sha256::digest(…)`) 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) — rust_port/crates/flow_common_socket/src/socket.rs:136, rust_port/crates/flow_common_socket/src/socket.rs:232, rust_port/crates/flow_server_files/src/server_files_js.rs:43, …

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (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: `rust_port/crates/flow_common_socket/src/socket.rs:136` (`Md5::digest`), `rust_port/crates/flow_common_socket/src/socket.rs:232` (`Md5::digest`), `rust_port/crates/flow_server_files/src/server_files_js.rs:43` (`Md5::digest`), `rust_port/crates/flow_server_files/src/server_files_js.rs:52` (`Md5::digest`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
X1 · Async correctness7.9 / 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` ignores what its callback returns, so the Promise 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 rejection is never handled — in Node.js an unhandled rejection terminates the process by default, and in a browser it is lost. Iterate with `for (const item of items) { await … }` when the work must run in order, or `await Promise.all(items.map(async (item) => { … }))` 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. — packages/flow-for-vscode/src/index.ts:106

What to do

  • `async` callback passed to `forEach`
X15 · Unvalidated length from an untrusted reader2.7 / 10Weak✓ 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.

  • `len` is read from the bytes being parsed at line 1723 (`u32::from_be_bytes`), then used to size a `vec![…; n]` at line 1724 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1724
  • `len` is read from the bytes being parsed at line 131 (`u32::from_be_bytes`), then used to size a `vec![…; n]` at line 132 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:132

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

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. 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.

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.

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.

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

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

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

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

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

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

  • `info!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:130
  • `debug!` at line 158 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:158
  • `warn!` at line 143 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_dfind/src/lib.rs:143
  • `warn!` at line 187 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_dfind/src/lib.rs:187
  • `warn!` at line 282 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:282
  • `debug!` at line 406 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:406
  • `warn!` at line 472 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:472
  • `warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:480
  • `debug!` at line 610 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:610
  • `debug!` at line 613 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_daemon/src/daemon.rs:613
  • `info!` at line 95 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:95

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.5 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

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

  • ~1.3 `!` null assertions per 1k TypeScript source lines — 7 assertion(s) across the 5468 source line(s) of the 86 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/flow-for-vscode/src/handlers.ts (7). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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 Health33%Weak — gated by D1, D2, R1, R7, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85%StrongSolid.
Maturity62%AdequateAcceptable, with room to improve.
Readiness44%Weak — gated by R4, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security58%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100%ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 18 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 63 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — AX6 reached only 16% of this repository's production lines — rust (570,123 lines), python (1,507 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
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run start`) exited before it served a page. Likely cause (the repository): package.json has no "start" script, so `npm run start` could not start the app. Last output: "npm error Missing script: "start" / npm error / npm error Did you mean one of these? / npm error npm star # Mark your favorite packages / npm error npm stars # View packages marked as favorites / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store 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, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source 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, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • 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.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript, Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 255 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — D5 reads a .NET project-reference graph only — this repository's production source is .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (186 value object(s))
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — Not assessed, and this one is on us: 2 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — 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
  • 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'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
  • 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 data present for 13 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X12 Unreachable branch — X12 reached only 16% of this repository's production lines — rust (570,123 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 16% of this repository's production lines — rust (570,123 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 16% of this repository's production lines — rust (570,123 lines), python (1,507 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — X18 reached only 16% of this repository's production lines — rust (570,123 lines), python (1,507 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — X23 reached only 16% of this repository's production lines — rust (570,123 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X24 Document value interpolated into markup unescaped — X24 reached only 16% of this repository's production lines — rust (570,123 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 16% of this repository's production lines — rust (570,123 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 138 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×64
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 39 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 38 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) packages/flow-dev-tools/src/command/allCommands.js:13 — packages/flow-dev-tools/src/command/allCommands.js → packages/flow-dev-tools/src/help/helpCommand.js → packages/flow-dev-tools/src/command/allCommands.js
  • Import cycle (2 files) packages/flow-remove-types/loader.mjs:6 — packages/flow-remove-types/loader.mjs → REDACTED → packages/flow-remove-types/loader.mjs
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'source-map' · ×1
  • Unlisted import 'source-map' REDACTED:16 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 4619 finding(s)
D3 · God Classes · FunctionTooLong · ×378
  • FunctionTooLong: flow_typing_flow_js::flow_js::dispatch::__flow_impl rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633 — FunctionTooLong — flow_typing_flow_js::flow_js::dispatch::__flow_impl runs 7899 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 7799 over it, 78.99× 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: flow_typing_errors::intermediate_error::to_printable_error rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4398 — FunctionTooLong — flow_typing_errors::intermediate_error::to_printable_error runs 5532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 5432 over it, 55.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_flow_js::subtyping_kit::rec_sub_t rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3054 — FunctionTooLong — flow_typing_flow_js::subtyping_kit::rec_sub_t runs 2739 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2639 over it, 27.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.
  • FunctionTooLong: flow_typing_statement::statement::mk_class_sig rust_port/crates/flow_typing_statement/src/statement.rs:15438 — FunctionTooLong — flow_typing_statement::statement::mk_class_sig runs 2687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2587 over it, 26.87× 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: flow_typing_errors::intermediate_error::make_intermediate_error rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1155 — FunctionTooLong — flow_typing_errors::intermediate_error::make_intermediate_error runs 2373 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2273 over it, 23.73× 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: flow_typing_debug::dump_error_message rust_port/crates/flow_typing_debug/src/lib.rs:1966 — FunctionTooLong — flow_typing_debug::dump_error_message runs 2163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2063 over it, 21.63× 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: flow_typing_statement::type_annotation::convert_inner rust_port/crates/flow_typing_statement/src/type_annotation.rs:1143 — FunctionTooLong — flow_typing_statement::type_annotation::convert_inner runs 2111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2011 over it, 21.11× 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: flow_typing_statement::statement::statement_ rust_port/crates/flow_typing_statement/src/statement.rs:2275 — FunctionTooLong — flow_typing_statement::statement::statement_ runs 1732 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1632 over it, 17.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_statement::statement::optional_chain rust_port/crates/flow_typing_statement/src/statement.rs:8699 — FunctionTooLong — flow_typing_statement::statement::optional_chain runs 1633 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1533 over it, 16.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_utils::annotation_inference::elab_t_concrete rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127 — FunctionTooLong — flow_typing_utils::annotation_inference::elab_t_concrete runs 1517 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1417 over it, 15.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_statement::statement::expression_ rust_port/crates/flow_typing_statement/src/statement.rs:6775 — FunctionTooLong — flow_typing_statement::statement::expression_ runs 1342 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1242 over it, 13.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.
  • FunctionTooLong: flow_parser::type_parser::object_type rust_port/crates/flow_parser/src/type_parser.rs:2474 — FunctionTooLong — flow_parser::type_parser::object_type runs 1189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1089 over it, 11.89× 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: flow_services_code_action::code_action_service::ast_transforms_of_error rust_port/crates/flow_services_code_action/src/code_action_service.rs:1106 — FunctionTooLong — flow_services_code_action::code_action_service::ast_transforms_of_error runs 987 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 887 over it, 9.87× 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: flow_typing_statement::type_annotation::add_interface_properties rust_port/crates/flow_typing_statement/src/type_annotation.rs:7266 — FunctionTooLong — flow_typing_statement::type_annotation::add_interface_properties runs 968 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 868 over it, 9.68× 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: flow_typing_utils::type_sig_merge::merge_annot rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2034 — FunctionTooLong — flow_typing_utils::type_sig_merge::merge_annot runs 956 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 856 over it, 9.56× 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: flow_typing_statement::type_annotation::convert_object rust_port/crates/flow_typing_statement/src/type_annotation.rs:4401 — FunctionTooLong — flow_typing_statement::type_annotation::convert_object runs 818 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 718 over it, 8.18× 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: flow_lsp::lsp_mapper::default_mapper rust_port/crates/flow_lsp/src/lsp_mapper.rs:156 — FunctionTooLong — flow_lsp::lsp_mapper::default_mapper runs 794 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 694 over it, 7.94× 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: flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:526 — FunctionTooLong — flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list runs 770 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 670 over it, 7.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_flow_js::subtyping_kit::flow_obj_to_obj rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1804 — FunctionTooLong — flow_typing_flow_js::subtyping_kit::flow_obj_to_obj runs 760 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 660 over it, 7.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.
  • FunctionTooLong: flow_typing_flow_js::flow_js::eval_helpers::eval_destructor rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:445 — FunctionTooLong — flow_typing_flow_js::flow_js::eval_helpers::eval_destructor runs 759 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 659 over it, 7.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.
  • FunctionTooLong: flow_typing_flow_js::object_kit::run_with_env rust_port/crates/flow_typing_flow_js/src/object_kit.rs:563 — FunctionTooLong — flow_typing_flow_js::object_kit::run_with_env runs 733 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 633 over it, 7.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing_utils::type_hint::type_of_hint_decomposition rust_port/crates/flow_typing_utils/src/type_hint.rs:827 — FunctionTooLong — flow_typing_utils::type_hint::type_of_hint_decomposition runs 704 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 604 over it, 7.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flow_typing::env_resolution::resolve_binding rust_port/crates/flow_typing/src/env_resolution.rs:1306 — FunctionTooLong — flow_typing::env_resolution::resolve_binding runs 691 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 591 over it, 6.91× 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: flow_typing_statement::statement::mk_record_sig rust_port/crates/flow_typing_statement/src/statement.rs:18949 — FunctionTooLong — flow_typing_statement::statement::mk_record_sig runs 685 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 585 over it, 6.85× 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: flow_parser::estree_translator::statement rust_port/crates/flow_parser/src/estree_translator.rs:287 — FunctionTooLong — flow_parser::estree_translator::statement runs 682 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 582 over it, 6.82× 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.
  • + 353 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×216
  • TodoComment rust_port/crates/flow_typing_utils/src/annotation_inference.rs:142 — // TODO: enumerate all use types — 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 rust_port/crates/flow_typing_type/src/type_.rs:12161 — // TODO: enumerate all use types — 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 rust_port/crates/flow_typing_utils/src/check_polarity.rs:88 — // TODO: flesh this out — 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 rust_port/crates/flow_typing_utils/src/check_polarity.rs:385 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust_port/crates/flow_typing_statement/src/statement.rs:15165 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:640 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust_port/crates/flow_imports_exports/src/exports.rs:393 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4001 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment rust_port/crates/flow_typing_utils/src/convert_types.rs:1337 — // TODO: prop_map needs more investigation — 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 rust_port/crates/flow_typing_utils/src/exhaustive.rs:1293 — // TODO: Update existing machinery to return the info we want and use that 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 rust_port/crates/flow_typing_utils/src/members.rs:109 — // TODO: How to merge param names? — 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 rust_port/crates/flow_typing_utils/src/members.rs:139 — // TODO: How to merge rest names and locs? — 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 rust_port/crates/flow_typing_utils/src/members.rs:149 — // TODO merging type guards would require aligning param names as well — 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 rust_port/crates/flow_typing_utils/src/members.rs:535 — // TODO: do we need to do anything special for merging Null with Void, — 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 rust_port/crates/flow_typing_utils/src/members.rs:608 — // TODO: do we need to do anything special for merging Null with Void, — 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 rust_port/crates/flow_typing_utils/src/members.rs:960 — // TODO: replace type parameters with stable/proper names? — 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 rust_port/crates/flow_typing_utils/src/members.rs:1078 — // TODO: It isn't currently possible to return two types for a given — 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 rust_port/crates/flow_typing_utils/src/members.rs:1088 — // TODO: own props should take precedence — 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 rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6350 — // TODO: own props should take precedence — 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 rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1122 — // TODO: for the moment we only support simple keys (empty projection) — 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 rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2496 — // TODO: possibly unsound to filter out orig_obj here, but if we don't, — 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 rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3297 — // TODO: possibly unsound to filter out orig_obj here, but if we — 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 rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:488 — // TODO: use_op — 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 rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:494 — // TODO: use_op — 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 rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:943 — // TODO: use_op — 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.
  • + 191 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×182
  • FileTooLong: src/statement.rs rust_port/crates/flow_typing_statement/src/statement.rs — FileTooLong — 16982 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 146 free functions. The bar is 500 significant lines; this is 16482 over it, 33.96× 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: src/ast_visitor.rs rust_port/crates/flow_parser/src/ast_visitor.rs — FileTooLong — 14275 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 661 free functions. The bar is 500 significant lines; this is 13775 over it, 28.55× 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: src/type_sig_parse.rs rust_port/crates/flow_type_sig/src/type_sig_parse.rs — FileTooLong — 11539 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 11039 over it, 23.08× 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: src/error_message.rs rust_port/crates/flow_typing_errors/src/error_message.rs — FileTooLong — 10543 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: ErrorMessage (5 blocks, 3526-13680). The bar is 500 significant lines; this is 10043 over it, 21.09× 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/name_resolver.rs rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs — FileTooLong — 9132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: NameResolver (4 blocks, 1734-12028). The bar is 500 significant lines; this is 8632 over it, 18.26× 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/type_.rs rust_port/crates/flow_typing_type/src/type_.rs — FileTooLong — 8877 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 55 free functions. The bar is 500 significant lines; this is 8377 over it, 17.75× 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: src/intermediate_error.rs rust_port/crates/flow_typing_errors/src/intermediate_error.rs — FileTooLong — 8825 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 8325 over it, 17.65× 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_js/dispatch.rs rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs — FileTooLong — 8354 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 7854 over it, 16.71× 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: src/flow_js_utils.rs rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs — FileTooLong — 7557 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 152 free functions. The bar is 500 significant lines; this is 7057 over it, 15.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/type_annotation.rs rust_port/crates/flow_typing_statement/src/type_annotation.rs — FileTooLong — 7276 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 99 free functions. The bar is 500 significant lines; this is 6776 over it, 14.55× 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: src/command_handler.rs rust_port/crates/flow_server_command_handler/src/command_handler.rs — FileTooLong — 6476 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 185 free functions. The bar is 500 significant lines; this is 5976 over it, 12.95× 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: src/polymorphic_ast_mapper.rs rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs — FileTooLong — 5735 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 328 free functions. The bar is 500 significant lines; this is 5235 over it, 11.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/js_layout_generator.rs rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs — FileTooLong — 5726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 218 free functions. The bar is 500 significant lines; this is 5226 over it, 11.45× 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: src/ast.rs rust_port/crates/flow_parser/src/ast.rs — FileTooLong — 5514 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 5014 over it, 11.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/type_sig_merge.rs rust_port/crates/flow_typing_utils/src/type_sig_merge.rs — FileTooLong — 5411 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 83 free functions. The bar is 500 significant lines; this is 4911 over it, 10.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/name_def.rs rust_port/crates/flow_env_builder/src/name_def.rs — FileTooLong — 5329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: DefFinder (3 blocks, 1724-7304). The bar is 500 significant lines; this is 4829 over it, 10.66× 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/flow_ast_differ.rs rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs — FileTooLong — 5267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 220 free functions. The bar is 500 significant lines; this is 4767 over it, 10.53× 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: src/subtyping_kit.rs rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs — FileTooLong — 5111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 4611 over it, 10.22× 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: implicit_instantiation/walk.rs rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs — FileTooLong — 4962 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: Walker (2 blocks, 552-5932), declaring 48 free functions. The bar is 500 significant lines; this is 4462 over it, 9.92× 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/estree_translator.rs rust_port/crates/flow_parser/src/estree_translator.rs — FileTooLong — 4902 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 164 free functions. The bar is 500 significant lines; this is 4402 over it, 9.80× 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: src/normalizer.rs rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs — FileTooLong — 4721 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 4221 over it, 9.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/statement_parser.rs rust_port/crates/flow_parser/src/statement_parser.rs — FileTooLong — 3898 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 75 free functions. The bar is 500 significant lines; this is 3398 over it, 7.80× 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: src/ty.rs rust_port/crates/flow_common_ty/src/ty.rs — FileTooLong — 3865 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 3365 over it, 7.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: src/lib.rs rust_port/crates/flow_typing_debug/src/lib.rs — FileTooLong — 3758 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 3258 over it, 7.52× 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: src/type_parser.rs rust_port/crates/flow_parser/src/type_parser.rs — FileTooLong — 3737 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 96 free functions. The bar is 500 significant lines; this is 3237 over it, 7.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 157 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×94
  • Hotspot: rust_port/crates/flow_typing_errors/src/intermediate_error.rs rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4398 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs changed 172 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 885 in flow_typing_errors::intermediate_error::to_printable_error at line 4398. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_errors/src/intermediate_error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs changed 153 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 693 in flow_typing_flow_js::flow_js::dispatch::__flow_impl at line 633. 3 of those changes were fix/bug commits, and the other 150 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_debug/src/lib.rs rust_port/crates/flow_typing_debug/src/lib.rs:1966 — rust_port/crates/flow_typing_debug/src/lib.rs changed 115 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 426 in flow_typing_debug::dump_error_message at line 1966. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_debug/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_errors/src/error_message.rs rust_port/crates/flow_typing_errors/src/error_message.rs:9925 — rust_port/crates/flow_typing_errors/src/error_message.rs changed 140 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 334 in ErrorMessage::friendly_message_of_msg at line 9925. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_errors/src/error_message.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3054 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs changed 112 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 315 in flow_typing_flow_js::subtyping_kit::rec_sub_t at line 3054. 3 of those changes were fix/bug commits, and the other 109 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_statement/src/statement.rs rust_port/crates/flow_typing_statement/src/statement.rs:2275 — rust_port/crates/flow_typing_statement/src/statement.rs changed 178 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 183 in flow_typing_statement::statement::statement_ at line 2275. 3 of those changes were fix/bug commits, and the other 175 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_statement/src/statement.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_statement/src/type_annotation.rs rust_port/crates/flow_typing_statement/src/type_annotation.rs:1143 — rust_port/crates/flow_typing_statement/src/type_annotation.rs changed 87 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 199 in flow_typing_statement::type_annotation::convert_inner at line 1143. 4 of those changes were fix/bug commits, and the other 83 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_statement/src/type_annotation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_type/src/type_.rs rust_port/crates/flow_typing_type/src/type_.rs:3388 — rust_port/crates/flow_typing_type/src/type_.rs changed 140 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in UseTInner::eq at line 3388. 2 of those changes were fix/bug commits, and the other 138 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_type/src/type_.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_utils/src/annotation_inference.rs rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 196 in flow_typing_utils::annotation_inference::elab_t_concrete at line 1127. 3 of those changes were fix/bug commits, and the other 51 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_utils/src/annotation_inference.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_utils/src/type_sig_merge.rs rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2034 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in flow_typing_utils::type_sig_merge::merge_annot at line 2034. 3 of those changes were fix/bug commits, and the other 76 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_utils/src/type_sig_merge.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_type/src/type_util.rs rust_port/crates/flow_typing_type/src/type_util.rs:1079 — rust_port/crates/flow_typing_type/src/type_util.rs changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in flow_typing_type::type_util::mod_loc_of_virtual_use_op at line 1079. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_type/src/type_util.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1761 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs changed 130 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in flow_typing_flow_common::flow_js_utils::primary_reason_of_use_op at line 1761. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:222 — REDACTED changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 320 in flowDefToTSDef.getTransforms at line 222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1146 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in Walker::walk_structural at line 1146. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:384 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in flow_typing_flow_js::implicit_instantiation::t_of_use_t at line 384. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_type_sig/src/type_sig_parse.rs rust_port/crates/flow_type_sig/src/type_sig_parse.rs:10357 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in flow_type_sig::type_sig_parse::expression at line 10357. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_type_sig/src/type_sig_parse.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_services_code_action/src/code_action_service.rs rust_port/crates/flow_services_code_action/src/code_action_service.rs:1106 — rust_port/crates/flow_services_code_action/src/code_action_service.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in flow_services_code_action::code_action_service::ast_transforms_of_error at line 1106. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_services_code_action/src/code_action_service.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:481 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in flow_typing_flow_js::flow_js::helpers::handle_generic at line 481. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing/src/env_resolution.rs rust_port/crates/flow_typing/src/env_resolution.rs:1306 — rust_port/crates/flow_typing/src/env_resolution.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in flow_typing::env_resolution::resolve_binding at line 1306. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing/src/env_resolution.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_env_builder/src/name_def.rs rust_port/crates/flow_env_builder/src/name_def.rs:4827 — rust_port/crates/flow_env_builder/src/name_def.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in DefFinder::statement_list at line 4827. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_env_builder/src/name_def.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1416 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in flow_typing_ty_normalizer::normalizer::type_converter::type_ctor at line 1416. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4416 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in NameResolver::visit_match_pattern at line 4416. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing_utils/src/predicate_kit.rs rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1587 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in flow_typing_utils::predicate_kit::intersect_type_guard at line 1587. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing_utils/src/predicate_kit.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_command_utils/src/lib.rs rust_port/crates/flow_command_utils/src/lib.rs:2918 — rust_port/crates/flow_command_utils/src/lib.rs changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in flow_command_utils::connect_and_make_request_inner at line 2918. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_command_utils/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: rust_port/crates/flow_typing/src/merge.rs rust_port/crates/flow_typing/src/merge.rs:139 — rust_port/crates/flow_typing/src/merge.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in flow_typing::merge::detect_sketchy_null_checks at line 139. 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 17:21:27 -08:00' --until='2026-11-13 17:21:27 -08:00' --full-history --no-merges -- rust_port/crates/flow_typing/src/merge.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 69 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×92
  • Duplicated block (9 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:527 — rust_port/crates/flow_analysis/src/property_assignment.rs:527-535 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1661-1669 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:527` it does not close everything it opens, so those 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 `stmt` to `&'ast ast::statement::While<ALoc, ALoc>` in one and `&ast::statement::While<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:599 — rust_port/crates/flow_cli/src/glean_runner.rs:599-607 | rust_port/crates/flow_cli/src/glean_runner.rs:876-884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:599` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:1023 — rust_port/crates/flow_cli/src/glean_runner.rs:1023-1031 | rust_port/crates/flow_cli/src/glean_runner.rs:1364-1372 — both copies are in the same file, so extract the 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) rust_port/crates/flow_cli/src/glean_runner.rs:1061 — rust_port/crates/flow_cli/src/glean_runner.rs:1061-1069 | rust_port/crates/flow_cli/src/glean_runner.rs:1126-1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:1061` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_cli/src/inlay_hint_command.rs:27 — rust_port/crates/flow_cli/src/inlay_hint_command.rs:27-35 | rust_port/crates/flow_cli/src/type_of_name_command.rs:22-30 — before extracting anything, compare `rust_port/crates/flow_cli/src/inlay_hint_command.rs` and `rust_port/crates/flow_cli/src/type_of_name_command.rs` as WHOLE FILES: this scan already matched 5 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 `rust_port/crates/flow_cli/src/inlay_hint_command.rs:27` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_cli/src/inlay_hint_command.rs:117 — rust_port/crates/flow_cli/src/inlay_hint_command.rs:117-125 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:280-288 — before extracting anything, compare `rust_port/crates/flow_cli/src/inlay_hint_command.rs` and `rust_port/crates/flow_cli/src/type_at_pos_command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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) rust_port/crates/flow_cli/src/ls_command.rs:357 — rust_port/crates/flow_cli/src/ls_command.rs:357-365 | rust_port/crates/flow_command_utils/src/lib.rs:1635-1643 — 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 (9 lines × 2) rust_port/crates/flow_command_utils/src/lib.rs:828 — rust_port/crates/flow_command_utils/src/lib.rs:828-836 | rust_port/crates/flow_command_utils/src/lib.rs:856-864 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_command_utils/src/lib.rs:828` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_errors/src/error_utils.rs:3162 — rust_port/crates/flow_common_errors/src/error_utils.rs:3162-3170 | rust_port/crates/flow_common_errors/src/error_utils.rs:3174-3182 — both copies are in the same file, so extract the 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:839 — rust_port/crates/flow_common_ty/src/ty_printer.rs:839-847 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1095-1103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_printer.rs:839` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_common_ty/src/ty_printer.rs:836` calls `is_symbol`, `atom`, `to_string` and `rust_port/crates/flow_common_ty/src/ty_printer.rs:1094` 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:1642 — rust_port/crates/flow_common_ty/src/ty_printer.rs:1642-1650 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1674-1682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_printer.rs:1642` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:2277 — rust_port/crates/flow_env_builder/src/name_def.rs:2277-2285 | rust_port/crates/flow_env_builder/src/name_def.rs:2398-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 `rust_port/crates/flow_env_builder/src/name_def.rs:2277` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:3920 — rust_port/crates/flow_env_builder/src/name_def.rs:3920-3928 | rust_port/crates/flow_env_builder/src/name_def.rs:3946-3954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:3920` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:6065 — rust_port/crates/flow_env_builder/src/name_def.rs:6065-6073 | rust_port/crates/flow_env_builder/src/name_def.rs:6094-6102 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2991 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2991-2999 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3153-3161 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1698 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1698-1706 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8886-8894 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7716 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7716-7724 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7824-7832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10101 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10101-10109 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10148-10156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2514 — rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2514-2522 | rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2527-2535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2514` it begins part-way through the construct above it, so those exact 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 × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:7819 — rust_port/crates/flow_parser/src/ast_visitor.rs:7819-7827 | rust_port/crates/flow_parser/src/ast_visitor.rs:7918-7926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:7819` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:8556 — rust_port/crates/flow_parser/src/ast_visitor.rs:8556-8564 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:772-780 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_typing/src/typed_ast_finder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `rust_port/crates/flow_parser/src/ast_visitor.rs:8556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:12439 — rust_port/crates/flow_parser/src/ast_visitor.rs:12439-12447 | rust_port/crates/flow_parser/src/ast_visitor.rs:12473-12481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:12439` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:16334 — rust_port/crates/flow_parser/src/ast_visitor.rs:16334-16342 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2530-2538 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `rust_port/crates/flow_parser/src/ast_visitor.rs:16334` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/ast_visitor.rs:17592 — rust_port/crates/flow_parser/src/ast_visitor.rs:17592-17600 | rust_port/crates/flow_parser/src/ast_visitor.rs:17635-17643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:17592` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/estree_translator.rs:2917 — rust_port/crates/flow_parser/src/estree_translator.rs:2917-2925 | rust_port/crates/flow_parser/src/estree_translator.rs:3998-4006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:2917` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 67 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×87
  • Duplicated block (11 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:104 — rust_port/crates/flow_analysis/src/property_assignment.rs:104-114 | rust_port/crates/flow_analysis/src/ssa_builder.rs:751-761 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:651 — rust_port/crates/flow_analysis/src/property_assignment.rs:651-661 | rust_port/crates/flow_analysis/src/ssa_builder.rs:864-874 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:651` it does not close everything it opens, so those 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 `stmt` to `&'ast ast::statement::ForIn<ALoc, ALoc>` in one and `&ast::statement::ForIn<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_cli/src/apply_code_action_command.rs:161 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:161-171 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:262-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/apply_code_action_command.rs:161` 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) rust_port/crates/flow_cli/src/ast_command.rs:136 — rust_port/crates/flow_cli/src/ast_command.rs:136-146 | rust_port/crates/flow_cli/src/env_builder_debug_command.rs:52-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_cli/src/ast_command.rs:283 — rust_port/crates/flow_cli/src/ast_command.rs:283-293 | rust_port/crates/flow_cli/src/env_builder_debug_command.rs:133-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 both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_cli/src/autofix_command.rs:275 — rust_port/crates/flow_cli/src/autofix_command.rs:275-285 | rust_port/crates/flow_cli/src/autofix_command.rs:419-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_cli/src/codemod_command.rs:821 — rust_port/crates/flow_cli/src/codemod_command.rs:821-831 | rust_port/crates/flow_cli/src/codemod_command.rs:940-950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/codemod_command.rs:821` 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) rust_port/crates/flow_cli/src/glean_runner.rs:1318 — rust_port/crates/flow_cli/src/glean_runner.rs:1318-1328 | rust_port/crates/flow_cli/src/glean_runner.rs:1367-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:1318` 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, `rust_port/crates/flow_cli/src/glean_runner.rs:1365` calls `get`, `name` and `rust_port/crates/flow_cli/src/glean_runner.rs:1317` 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) rust_port/crates/flow_codemods/src/annotate_exports.rs:513 — rust_port/crates/flow_codemods/src/annotate_exports.rs:513-523 | rust_port/crates/flow_codemods/src/annotate_exports.rs: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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_codemods/src/annotate_exports.rs:513` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common/src/files.rs:1409 — rust_port/crates/flow_common/src/files.rs:1409-1419 | rust_port/crates/flow_parser/src/file_key.rs:139-149 — before extracting anything, compare `rust_port/crates/flow_common/src/files.rs` and `rust_port/crates/flow_parser/src/file_key.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `rust_port/crates/flow_common/src/files.rs:1409` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_dot_js_wasm/src/lib.rs:270 — rust_port/crates/flow_dot_js_wasm/src/lib.rs:270-280 | rust_port/crates/flow_services_references/src/rename_module.rs:136-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:4614 — rust_port/crates/flow_env_builder/src/name_def.rs:4614-4624 | rust_port/crates/flow_env_builder/src/name_def.rs:7261-7271 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4652 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4652-4662 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4682-4692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4652` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_heap/src/transaction.rs:1030 — rust_port/crates/flow_heap/src/transaction.rs:1030-1040 | rust_port/crates/flow_heap/src/transaction.rs:1138-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_heap/src/transaction.rs:1030` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_heap/src/transaction.rs:1109 — rust_port/crates/flow_heap/src/transaction.rs:1109-1119 | rust_port/crates/flow_heap/src/transaction.rs:1144-1154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_heap/src/transaction.rs:1109` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_imports_exports/src/exports.rs:526 — rust_port/crates/flow_imports_exports/src/exports.rs:526-536 | rust_port/crates/flow_imports_exports/src/exports.rs:667-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_imports_exports/src/exports.rs: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.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:11462 — rust_port/crates/flow_parser/src/ast_visitor.rs:11462-11472 | rust_port/crates/flow_parser/src/ast_visitor.rs:12278-12288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:11462` 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) rust_port/crates/flow_parser/src/expression_parser.rs:2646 — rust_port/crates/flow_parser/src/expression_parser.rs:2646-2656 | rust_port/crates/flow_parser/src/type_parser.rs:1016-1026 — before extracting anything, compare `rust_port/crates/flow_parser/src/expression_parser.rs` and `rust_port/crates/flow_parser/src/type_parser.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 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 `rust_port/crates/flow_parser/src/expression_parser.rs:2646` it does not close everything it opens, so those 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 `part` to `TemplatePart` in one and `token::TemplatePart` 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1858 — rust_port/crates/flow_parser/src/flow_lexer.rs:1858-1868 | rust_port/crates/flow_parser/src/flow_lexer.rs:1898-1908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:1858` it begins part-way through the construct above it, so those exact 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, `rust_port/crates/flow_parser/src/flow_lexer.rs:1857` calls `source` and `rust_port/crates/flow_parser/src/flow_lexer.rs:1897` 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) rust_port/crates/flow_parser/src/jsx_parser.rs:209 — rust_port/crates/flow_parser/src/jsx_parser.rs:209-219 | rust_port/crates/flow_parser/src/jsx_parser.rs:286-296 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/statement_parser.rs:2315 — rust_port/crates/flow_parser/src/statement_parser.rs:2315-2325 | rust_port/crates/flow_parser/src/statement_parser.rs:2354-2364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:2315` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/type_parser.rs:2319 — rust_port/crates/flow_parser/src/type_parser.rs:2319-2329 | rust_port/crates/flow_parser/src/type_parser.rs:2364-2374 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser_utils/src/package_exports.rs:143 — rust_port/crates/flow_parser_utils/src/package_exports.rs:143-153 | rust_port/crates/flow_parser_utils/src/package_json.rs:132-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5356 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5356-5366 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6985-6995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5356` it does not close everything it opens, so those 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, `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5355` calls `type_args` and `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6984` 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:577 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:577-587 | rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:293-303 — 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 `rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 62 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×87
  • Duplicated block (7 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:217 — rust_port/crates/flow_analysis/src/scope_builder.rs:217-223 | rust_port/crates/flow_parser/src/ast_visitor.rs:17602-17608 — 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 `rust_port/crates/flow_analysis/src/scope_builder.rs:217` 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 (7 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:992 — rust_port/crates/flow_analysis/src/scope_builder.rs:992-998 | rust_port/crates/flow_analysis/src/scope_builder.rs:1077-1083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_analysis/src/scope_builder.rs:992` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:1991 — rust_port/crates/flow_analysis/src/scope_builder.rs:1991-1997 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1903-1910 — 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 `rust_port/crates/flow_analysis/src/scope_builder.rs:1991` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_common_errors/src/error_utils.rs:4752 — rust_port/crates/flow_common_errors/src/error_utils.rs:4752-4758 | rust_port/crates/flow_common_errors/src/error_utils.rs:4772-4778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_errors/src/error_utils.rs:4752` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_ty/src/ty.rs:4979 — rust_port/crates/flow_common_ty/src/ty.rs:4979-4985 | rust_port/crates/flow_common_ty/src/ty.rs:5037-5043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty.rs:4979` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_common_ty/src/ty_utils.rs:676 — rust_port/crates/flow_common_ty/src/ty_utils.rs:676-682 | rust_port/crates/flow_common_ty/src/ty_utils.rs:790-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_utils.rs:676` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_utils/src/list_utils.rs:50 — rust_port/crates/flow_common_utils/src/list_utils.rs:50-56 | rust_port/crates/flow_common_utils/src/list_utils.rs:102-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 `rust_port/crates/flow_common_utils/src/list_utils.rs:50` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:124 — rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:124-130 | rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:158-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:3397 — rust_port/crates/flow_env_builder/src/name_def.rs:3397-3403 | rust_port/crates/flow_env_builder/src/name_def.rs:3422-3428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:3397` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:4365 — rust_port/crates/flow_env_builder/src/name_def.rs:4365-4371 | rust_port/crates/flow_env_builder/src/name_def.rs:4375-4381 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder/src/name_def.rs:5456 — rust_port/crates/flow_env_builder/src/name_def.rs:5456-5462 | rust_port/crates/flow_env_builder/src/name_def.rs:5538-5544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5456` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:390 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:390-396 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:401-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 `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:911 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:911-917 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:929-935 — both copies are in the same file, so extract the 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 `prop` to `&ast::class::Property<ALoc, ALoc>` in one and `&ast::class::PrivateField<ALoc, ALoc>` 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3114 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3114-3120 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3271-3277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:376 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:376-382 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:386-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:376` 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 (7 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4697 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4697-4703 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4726-4732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4697` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11922 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11922-11928 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11974-11980 — both copies are in the same file, so extract the 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 `m` to `&flow_parser::ast::statement::DeclareModule<ALoc, ALoc>` in one and `&flow_parser::ast::statement::DeclareNamespace<ALoc, ALoc>` 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) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:227 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:227-233 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:467-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs: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 (7 lines × 2) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:308 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:308-314 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:316-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) rust_port/crates/flow_parser/src/ast_visitor.rs:7198 — rust_port/crates/flow_parser/src/ast_visitor.rs:7198-7204 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2500-2506 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `rust_port/crates/flow_parser/src/ast_visitor.rs:7198` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7849 — rust_port/crates/flow_parser/src/ast_visitor.rs:7849-7855 | rust_port/crates/flow_parser/src/ast_visitor.rs:7948-7954 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/declaration_parser.rs:715 — rust_port/crates/flow_parser/src/declaration_parser.rs:715-721 | rust_port/crates/flow_parser/src/declaration_parser.rs:723-729 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/declaration_parser.rs:919 — rust_port/crates/flow_parser/src/declaration_parser.rs:919-925 | rust_port/crates/flow_parser/src/object_parser.rs:1859-1865 — 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 `rust_port/crates/flow_parser/src/declaration_parser.rs:919` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:523 — rust_port/crates/flow_parser/src/flow_lexer.rs:523-529 | rust_port/crates/flow_parser/src/flow_lexer.rs:534-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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, `rust_port/crates/flow_parser/src/flow_lexer.rs:532` calls `Some`, `strip_prefix` and `rust_port/crates/flow_parser/src/flow_lexer.rs:522` 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) rust_port/crates/flow_parser/src/flow_lexer.rs:803 — rust_port/crates/flow_parser/src/flow_lexer.rs:803-809 | rust_port/crates/flow_parser/src/flow_lexer.rs:2444-2450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:803` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 62 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×81
  • Duplicated block (10 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:627 — rust_port/crates/flow_cli/src/glean_runner.rs:627-636 | rust_port/crates/flow_cli/src/glean_runner.rs:642-651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:627` 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) rust_port/crates/flow_cli/src/server_command.rs:172 — rust_port/crates/flow_cli/src/server_command.rs:172-181 | rust_port/crates/flow_cli/src/start_command.rs:239-248 — 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 `rust_port/crates/flow_cli/src/server_command.rs:172` 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) rust_port/crates/flow_common_vcs/src/git.rs:19 — rust_port/crates/flow_common_vcs/src/git.rs:19-28 | rust_port/crates/flow_common_vcs/src/hg.rs: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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_vcs/src/git.rs:19` 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) rust_port/crates/flow_config/src/flowconfig.rs:1510 — rust_port/crates/flow_config/src/flowconfig.rs:1510-1519 | rust_port/crates/flow_config/src/flowconfig.rs:1538-1547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:2919 — rust_port/crates/flow_env_builder/src/name_def.rs:2919-2928 | rust_port/crates/flow_parser/src/ast_visitor.rs:7416-7425 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:601 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:601-610 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:614-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:601` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/ast_visitor.rs:16708 — rust_port/crates/flow_parser/src/ast_visitor.rs:16708-16717 | rust_port/crates/flow_parser/src/ast_visitor.rs:16726-16735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:16708` 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) rust_port/crates/flow_parser/src/ast_visitor.rs:17952 — rust_port/crates/flow_parser/src/ast_visitor.rs:17952-17961 | rust_port/crates/flow_parser/src/ast_visitor.rs:18267-18276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:17952` 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, `rust_port/crates/flow_parser/src/ast_visitor.rs:18278` calls `clone` and `rust_port/crates/flow_parser/src/ast_visitor.rs:17963` 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 × 2) rust_port/crates/flow_parser/src/comment_attachment.rs:401 — rust_port/crates/flow_parser/src/comment_attachment.rs:401-410 | rust_port/crates/flow_parser/src/comment_attachment.rs:617-626 — both copies are in the same file, so extract the 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 `t` to `&'ast ast::types::Intersection<Loc, Loc>` in one and `&'ast ast::types::Union<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2994 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2994-3003 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3036-3045 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3004` calls `try_map_vec`, `class_decorator` and `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3046` 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3553 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3553-3562 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4042-4051 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/statement_parser.rs:1258 — rust_port/crates/flow_parser/src/statement_parser.rs:1258-1267 | rust_port/crates/flow_parser/src/statement_parser.rs:1293-1302 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/type_parser.rs:810 — rust_port/crates/flow_parser/src/type_parser.rs:810-819 | rust_port/crates/flow_parser/src/type_parser.rs:823-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:810` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_parser/src/type_parser.rs:2108 — rust_port/crates/flow_parser/src/type_parser.rs:2108-2117 | rust_port/crates/flow_parser/src/type_parser.rs:2137-2146 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/type_parser.rs:4351 — rust_port/crates/flow_parser/src/type_parser.rs:4351-4360 | rust_port/crates/flow_parser/src/type_parser.rs:4445-4454 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser_utils/src/enum_validate.rs:533 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:533-542 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:605-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.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6051 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6051-6061 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6123-6132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6051` 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 `m2` to `&expression::MatchExpression<Loc, Loc>` in one and `&ast::statement::MatchStatement<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5379 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5379-5388 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7007-7016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5379` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5806 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5806-5815 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7244-7253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5806` 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:78 — rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:78-87 | rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:108-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs: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) rust_port/crates/flow_parser_wasm/src/serializer.rs:813 — rust_port/crates/flow_parser_wasm/src/serializer.rs:813-822 | rust_port/crates/flow_parser_wasm/src/serializer.rs:831-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:813` 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:2152 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2152-2161 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2204-2213 — both copies are in the same file, so extract the 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) rust_port/crates/flow_profiling/src/profiling_js.rs:1060 — rust_port/crates/flow_profiling/src/profiling_js.rs:1060-1069 | rust_port/crates/flow_profiling/src/profiling_js.rs:1155-1164 — both copies are in the same file, so extract the 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:5125 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:5125-5134 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:5144-5153 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_server_command_handler/src/command_handler.rs:5135` calls `extend` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs:5154` 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 × 2) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:424 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:424-433 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:437-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:424` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 56 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×81
  • Duplicated block (8 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:537 — rust_port/crates/flow_analysis/src/property_assignment.rs:537-544 | rust_port/crates/flow_analysis/src/property_assignment.rs:617-624 — both copies are in the same file, so extract the 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) rust_port/crates/flow_analysis/src/scope_builder.rs:1122 — rust_port/crates/flow_analysis/src/scope_builder.rs:1122-1129 | rust_port/crates/flow_analysis/src/scope_builder.rs:1255-1262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust_port/crates/flow_cli/src/coverage_command.rs:28 — rust_port/crates/flow_cli/src/coverage_command.rs:28-35 | rust_port/crates/flow_cli/src/find_module_command.rs: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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/coverage_command.rs:28` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_cli/src/find_module_command.rs:22` calls `exe_name` and `rust_port/crates/flow_cli/src/coverage_command.rs:26` 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) rust_port/crates/flow_common/src/files.rs:919 — rust_port/crates/flow_common/src/files.rs:919-926 | rust_port/crates/flow_common/src/files.rs:953-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common/src/files.rs:919` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_common_errors/src/error_utils.rs:924 — rust_port/crates/flow_common_errors/src/error_utils.rs:924-931 | rust_port/crates/flow_common_errors/src/error_utils.rs:1113-1120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_errors/src/error_utils.rs:924` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:992 — rust_port/crates/flow_common_ty/src/ty_printer.rs:992-1000 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1233-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_printer.rs:992` 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, `rust_port/crates/flow_common_ty/src/ty_printer.rs:1001` calls `property_variance` and `rust_port/crates/flow_common_ty/src/ty_printer.rs:1241` 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) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:132 — rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:132-139 | rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:183-190 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder/src/name_def.rs:2030 — rust_port/crates/flow_env_builder/src/name_def.rs:2030-2037 | rust_port/crates/flow_env_builder/src/name_def.rs:2290-2297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:2030` 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) rust_port/crates/flow_env_builder/src/name_def.rs:3762 — rust_port/crates/flow_env_builder/src/name_def.rs:3762-3769 | rust_port/crates/flow_env_builder/src/name_def.rs:3790-3797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:3762` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:3893 — rust_port/crates/flow_env_builder/src/name_def.rs:3893-3900 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:1162-1169 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:3893` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1261 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1261-1268 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12775-12782 — 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 `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1261` 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4251 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4251-4258 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4360-4367 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2817 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2817-2824 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2838-2845 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2824 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2824-2831 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2869-2876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2824` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2909 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2909-2916 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2931-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2909` 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) rust_port/crates/flow_heap/src/parsing_heaps.rs:730 — rust_port/crates/flow_heap/src/parsing_heaps.rs:730-737 | rust_port/crates/flow_heap/src/parsing_heaps.rs:776-783 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/ast.rs:5426 — rust_port/crates/flow_parser/src/ast.rs:5426-5433 | rust_port/crates/flow_parser/src/ast.rs:5436-5443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:4099 — rust_port/crates/flow_parser/src/estree_translator.rs:4099-4106 | rust_port/crates/flow_parser/src/estree_translator.rs:4123-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:4099` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/estree_translator.rs:6641 — rust_port/crates/flow_parser/src/estree_translator.rs:6641-6648 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2872-2879 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) rust_port/crates/flow_parser/src/match_pattern_parser.rs:665 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:665-672 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:723-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs:665` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/match_pattern_parser.rs:756 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:756-763 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:813-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs:756` 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) rust_port/crates/flow_parser/src/statement_parser.rs:1152 — rust_port/crates/flow_parser/src/statement_parser.rs:1152-1159 | rust_port/crates/flow_parser/src/statement_parser.rs:1183-1190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust_port/crates/flow_parser_utils/src/file_sig.rs:515 — rust_port/crates/flow_parser_utils/src/file_sig.rs:515-522 | rust_port/crates/flow_parser_utils/src/file_sig.rs:640-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1484 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1484-1491 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4323-4330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1484` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:2510 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2510-2517 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2527-2534 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_parser_wasm/src/serializer.rs:2535` calls `write_bool` and `rust_port/crates/flow_parser_wasm/src/serializer.rs:2518` 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.
  • + 56 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×79
  • Duplicated block (6 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:423 — rust_port/crates/flow_cli/src/glean_runner.rs:423-428 | rust_port/crates/flow_cli/src/glean_runner.rs:1034-1039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:423` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_cli/src/lib.rs:163 — rust_port/crates/flow_cli/src/lib.rs:163-168 | rust_port/crates/flow_server_monitor/src/flow_server_monitor_daemon.rs:303-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_server_monitor/src/flow_server_monitor_daemon.rs:302` calls `Some` and `rust_port/crates/flow_cli/src/lib.rs: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 (6 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11108 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11108-11113 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11335-11340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11108` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/enum_parser.rs:195 — rust_port/crates/flow_parser/src/enum_parser.rs:195-200 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:326-332 — 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 `rust_port/crates/flow_parser/src/enum_parser.rs:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) rust_port/crates/flow_parser/src/estree_translator.rs:4911 — rust_port/crates/flow_parser/src/estree_translator.rs:4911-4916 | rust_port/crates/flow_parser/src/estree_translator.rs:4927-4932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:4911` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:2482 — rust_port/crates/flow_parser/src/flow_lexer.rs:2482-2487 | rust_port/crates/flow_parser/src/flow_lexer.rs:2674-2679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:2482` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/jsx_parser.rs:188 — rust_port/crates/flow_parser/src/jsx_parser.rs:188-193 | rust_port/crates/flow_parser/src/jsx_parser.rs:223-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/jsx_parser.rs:188` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/parser_env.rs:1413 — rust_port/crates/flow_parser/src/parser_env.rs:1413-1419 | rust_port/crates/flow_parser/src/parser_env.rs:1424-1429 — both copies are in the same file, so extract the 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 (6 lines × 2) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6473 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6473-6478 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6752-6757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_parser_utils/src/enum_validate.rs:126 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:126-131 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:182-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 `rust_port/crates/flow_parser_utils/src/enum_validate.rs:126` 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2765 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2765-2770 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3862-3867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2765` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6894 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6894-6899 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6985-6990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:548 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:548-553 | rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:367-372 — 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 `rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:548` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:4733 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4733-4738 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4739-4744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:4733` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:751 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:751-756 | rust_port/crates/flow_services_type_of_name/src/type_of_name.rs:633-638 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:4640 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:4640-4645 | rust_port/crates/flow_server_utils/src/file_content.rs:150-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4640` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:227 — rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:227-232 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:254-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 `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs: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 (6 lines × 2) rust_port/crates/flow_services_export_index/src/export_index.rs:189 — rust_port/crates/flow_services_export_index/src/export_index.rs:189-194 | rust_port/crates/flow_services_export_index/src/export_index.rs:261-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_export_index/src/export_index.rs:189` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_inference/src/type_contents.rs:371 — rust_port/crates/flow_services_inference/src/type_contents.rs:371-376 | rust_port/crates/flow_services_inference/src/type_service.rs:1625-1631 — 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 `rust_port/crates/flow_services_inference/src/type_contents.rs:371` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig.rs:1654 — rust_port/crates/flow_type_sig/src/type_sig.rs:1654-1659 | rust_port/crates/flow_type_sig/src/type_sig.rs:1698-1703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig.rs:1654` 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) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:661 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:661-666 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:727-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:661` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8591 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8591-8596 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8938-8943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8591` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13607 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13607-13612 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15604-15609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15381 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15381-15386 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15404-15409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15381` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing/src/env_resolution.rs:2571 — rust_port/crates/flow_typing/src/env_resolution.rs:2571-2576 | rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:121-126 — 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.
  • + 54 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×73
  • MethodTooLong: ErrorMessage.friendly_message_of_msg rust_port/crates/flow_typing_errors/src/error_message.rs:9925 — MethodTooLong — friendly_message_of_msg runs 2154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2054 over it, 21.54× 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: ErrorMessage.map_loc_of_error_message rust_port/crates/flow_typing_errors/src/error_message.rs:4658 — MethodTooLong — map_loc_of_error_message runs 1830 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1730 over it, 18.30× 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: ErrorMessage.convert_type_to_type_desc rust_port/crates/flow_typing_errors/src/error_message.rs:7021 — MethodTooLong — convert_type_to_type_desc runs 1423 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1323 over it, 14.23× 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: DefFinder.statement_list rust_port/crates/flow_env_builder/src/name_def.rs:4827 — MethodTooLong — statement_list runs 619 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 519 over it, 6.19× 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: ParseError.fmt rust_port/crates/flow_parser/src/parse_error.rs:305 — MethodTooLong — fmt runs 611 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 511 over it, 6.11× 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: ErrorMessage.error_code_of_message rust_port/crates/flow_typing_errors/src/error_message.rs:13031 — MethodTooLong — error_code_of_message runs 553 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 453 over it, 5.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NameResolver.visit_match_pattern rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4416 — MethodTooLong — visit_match_pattern runs 478 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 378 over it, 4.78× 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: Walker.walk_structural rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1146 — MethodTooLong — walk_structural runs 439 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 339 over it, 4.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: ErrorMessage.loc_of_msg rust_port/crates/flow_typing_errors/src/error_message.rs:8938 — MethodTooLong — loc_of_msg runs 418 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 318 over it, 4.18× 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: Substituter.type_ rust_port/crates/flow_typing_flow_common/src/type_subst.rs:640 — MethodTooLong — type_ runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× 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: Annot.iter rust_port/crates/flow_type_sig/src/type_sig.rs:2536 — MethodTooLong — iter runs 251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× 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: Writer.expression rust_port/crates/flow_parser_utils_output/src/indented_printer/expressions.rs:15 — MethodTooLong — expression runs 246 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 146 over it, 2.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: GleanRunnerConfig.visit rust_port/crates/flow_cli/src/glean_runner.rs:1882 — MethodTooLong — visit runs 242 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 142 over it, 2.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: Walker.walk_def rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1826 — MethodTooLong — walk_def runs 232 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NameResolver.mk_env rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2731 — MethodTooLong — mk_env runs 216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 116 over it, 2.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: Mapper.statement_fork_point rust_port/crates/flow_services_code_action/src/autofix_type_to_value_import.rs:122 — MethodTooLong — statement_fork_point runs 210 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 110 over it, 2.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: DefFinder.visit_assignment_expression rust_port/crates/flow_env_builder/src/name_def.rs:3166 — MethodTooLong — visit_assignment_expression runs 201 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× 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: Writer.statement rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:28 — MethodTooLong — statement runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: Annot.map rust_port/crates/flow_type_sig/src/type_sig.rs:2863 — MethodTooLong — map runs 195 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UseTInner.cmp rust_port/crates/flow_typing_type/src/type_.rs:3706 — MethodTooLong — cmp runs 195 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Serializer.type_ rust_port/crates/flow_common_ty/src/ty_serializer.rs:167 — MethodTooLong — type_ runs 188 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× 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: Serializer.serialize_class_body_element rust_port/crates/flow_parser_wasm/src/serializer.rs:2398 — MethodTooLong — serialize_class_body_element runs 182 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: TypeNormalizationHardcodedFixesMapper.on_union rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1418 — MethodTooLong — on_union runs 176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 76 over it, 1.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: TokenKind.to_value rust_port/crates/flow_parser/src/token.rs:457 — MethodTooLong — to_value runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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: DefFinder.visit_expression rust_port/crates/flow_env_builder/src/name_def.rs:3910 — MethodTooLong — visit_expression runs 165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 48 more in this group — see findings.md.
D2 · Cognitive Complexity · flow_parser · ×68
  • flow_parser::flow_lexer::token_base_inner (cognitive 165) rust_port/crates/flow_parser/src/flow_lexer.rs:1028 — flow_parser::flow_lexer::token_base_inner has cognitive complexity 165 (threshold 15). Drivers by points: if/else 65 (130 pts), boolean chains 16, match/switch 5 (10 pts), loops 3 (9 pts) (nesting depth added 76). 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.
  • flow_parser::statement_parser::export_declaration::parse (cognitive 99) rust_port/crates/flow_parser/src/statement_parser.rs:2848 — flow_parser::statement_parser::export_declaration::parse has cognitive complexity 99 (threshold 15). Drivers by points: if/else 26 (47 pts), match/switch 17 (42 pts), boolean chains 10 (nesting depth added 46). 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.
  • flow_parser::object_parser::class_element (cognitive 80) rust_port/crates/flow_parser/src/object_parser.rs:1036 — flow_parser::object_parser::class_element has cognitive complexity 80 (threshold 15). Drivers by points: if/else 91 (138 pts), match/switch 31 (53 pts), boolean chains 32 (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. This shape REPEATS in the file: 3 other methods here (flow_parser::object_parser::class_element::accessor, flow_parser::object_parser::class_element::property_end_and_semicolon, flow_parser::object_parser::class_element::init) 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.
  • flow_parser::estree_translator::statement (cognitive 67) rust_port/crates/flow_parser/src/estree_translator.rs:287 — flow_parser::estree_translator::statement has cognitive complexity 67 (threshold 15). Drivers by points: match/switch 24 (49 pts), if/else 8 (18 pts) (nesting depth added 35). Of this number, 59 points are the body's own statements and 8 belong to 4 function items inside it that branch. 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.
  • flow_parser::main_parser::check_for_duplicate_exports (cognitive 65) rust_port/crates/flow_parser/src/main_parser.rs:280 — flow_parser::main_parser::check_for_duplicate_exports has cognitive complexity 65 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 6 (21 pts), match/switch 7 (15 pts), boolean chains 1 (nesting depth added 42). Of this number, 49 points are the body's own statements and 16 belong to 2 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.
  • flow_parser::parser_env::peek::offset_after_current_trivia (cognitive 63) rust_port/crates/flow_parser/src/parser_env.rs:1455 — flow_parser::parser_env::peek::offset_after_current_trivia has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (44 pts), loops 4 (10 pts), match/switch 2 (6 pts), boolean chains 3 (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.
  • flow_parser::type_parser::object_type::property (cognitive 63) rust_port/crates/flow_parser/src/type_parser.rs:3587 — flow_parser::type_parser::object_type::property has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 7 (20 pts), boolean chains 8, loops 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. This shape REPEATS in the file: one other method here (flow_parser::type_parser::object_type::properties) 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.
  • flow_parser::statement_parser::import_declaration (cognitive 61) rust_port/crates/flow_parser/src/statement_parser.rs:4394 — flow_parser::statement_parser::import_declaration has cognitive complexity 61 (threshold 15). Drivers by points: match/switch 20 (33 pts), if/else 15 (25 pts), boolean chains 2, loops 1 (nesting depth added 23). Of this number, 16 points are the body's own statements and 45 belong to 10 function items inside it that branch. 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.
  • flow_parser::object_parser::class_element::init (cognitive 60) rust_port/crates/flow_parser/src/object_parser.rs:1631 — flow_parser::object_parser::class_element::init has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 14, match/switch 9 (14 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. This shape REPEATS in the file: 3 other methods here (flow_parser::object_parser::class_element, flow_parser::object_parser::class_element::accessor, flow_parser::object_parser::class_element::property_end_and_semicolon) 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.
  • flow_parser::parser_env::peek::comma_trailing_comments_after_current_if_line_terminator (cognitive 54) rust_port/crates/flow_parser/src/parser_env.rs:1909 — flow_parser::parser_env::peek::comma_trailing_comments_after_current_if_line_terminator has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (41 pts), loops 3 (7 pts), boolean chains 6 (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.
  • flow_parser::expression_parser::binary_cover (cognitive 52) rust_port/crates/flow_parser/src/expression_parser.rs:676 — flow_parser::expression_parser::binary_cover has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 4 (9 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 25). Of this number, 42 points are the body's own statements and 10 belong to 3 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.
  • flow_parser::object_parser::class_body::class_elements (cognitive 48) rust_port/crates/flow_parser/src/object_parser.rs:2471 — flow_parser::object_parser::class_body::class_elements has cognitive complexity 48 (threshold 15). Drivers by points: if/else 7 (34 pts), match/switch 4 (13 pts), loops 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_parser::flow_lexer::string_quote (cognitive 42) rust_port/crates/flow_parser/src/flow_lexer.rs:664 — flow_parser::flow_lexer::string_quote has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 8 (16 pts), loops 3 (7 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.
  • flow_parser::statement_parser::declare_export_declaration_body (cognitive 42) rust_port/crates/flow_parser/src/statement_parser.rs:3631 — flow_parser::statement_parser::declare_export_declaration_body has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 7 (14 pts), boolean chains 7 (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.
  • flow_parser::type_parser::param_list_or_type (cognitive 41) rust_port/crates/flow_parser/src/type_parser.rs:2064 — flow_parser::type_parser::param_list_or_type has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 7 (15 pts), boolean chains 3 (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.
  • flow_parser::type_parser::tuple::element (cognitive 39) rust_port/crates/flow_parser/src/type_parser.rs:1310 — flow_parser::type_parser::tuple::element has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 5 (10 pts), boolean chains 6 (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.
  • flow_parser::declaration_parser::parse_function_params (cognitive 38) rust_port/crates/flow_parser/src/declaration_parser.rs:331 — flow_parser::declaration_parser::parse_function_params has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 11). None of this is in the body itself: all 38 points belong to 4 function items inside it that branch (param, this_param_annotation, param_list, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_parser::statement_parser::for_loop (cognitive 36) rust_port/crates/flow_parser/src/statement_parser.rs:407 — flow_parser::statement_parser::for_loop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 8 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 16). Of this number, 33 points are the body's own statements and 3 belong to 2 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.
  • flow_parser::flow_lexer::consume_jsx_entity (cognitive 35) rust_port/crates/flow_parser/src/flow_lexer.rs:2282 — flow_parser::flow_lexer::consume_jsx_entity has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 2, loops 1 (2 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.
  • flow_parser::match_pattern_parser::subpattern (cognitive 35) rust_port/crates/flow_parser/src/match_pattern_parser.rs:114 — flow_parser::match_pattern_parser::subpattern has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 5 (14 pts), loops 1 (3 pts) (nesting depth added 23). Of this number, 17 points are the body's own statements and 18 belong to one function item inside it that branches. 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.
  • flow_parser::object_parser::record_body::elements (cognitive 35) rust_port/crates/flow_parser/src/object_parser.rs:2724 — flow_parser::object_parser::record_body::elements has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 3 (8 pts), boolean chains 5, 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.
  • flow_parser::statement_parser::opaque_type_helper (cognitive 35) rust_port/crates/flow_parser/src/statement_parser.rs:1418 — flow_parser::statement_parser::opaque_type_helper has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (28 pts), match/switch 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.
  • flow_parser::flow_lexer::string_escape (cognitive 33) rust_port/crates/flow_parser/src/flow_lexer.rs:503 — flow_parser::flow_lexer::string_escape has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3, loops 2 (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.
  • flow_parser::bin::parse_test262::main_impl (cognitive 32) rust_port/crates/flow_parser/src/bin/parse_test262.rs:609 — flow_parser::bin::parse_test262::main_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (13 pts), match/switch 2 (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.
  • flow_parser::object_parser::initializer (cognitive 32) rust_port/crates/flow_parser/src/object_parser.rs:361 — flow_parser::object_parser::initializer has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 10 (16 pts), if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 10). None of this is in the body itself: all 32 points belong to 6 function items inside it that branch (properties, property, parse_shorthand, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • + 43 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×64
  • Duplicated block (12 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:688 — rust_port/crates/flow_analysis/src/property_assignment.rs:688-699 | rust_port/crates/flow_analysis/src/ssa_builder.rs:908-919 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:688` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `stmt` to `&'ast ast::statement::ForOf<ALoc, ALoc>` in one and `&ast::statement::ForOf<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) rust_port/crates/flow_codemods/src/annotate_exports.rs:308 — rust_port/crates/flow_codemods/src/annotate_exports.rs:308-319 | rust_port/crates/flow_codemods/src/annotate_exports.rs:502-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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:308` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:259 — rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:259-270 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:294-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 `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rust_port/crates/flow_common/src/reason.rs:1735 — rust_port/crates/flow_common/src/reason.rs:1735-1746 | rust_port/crates/flow_common/src/reason.rs:1823-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 `rust_port/crates/flow_common/src/reason.rs:1735` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_errors/src/error_utils.rs:4636 — rust_port/crates/flow_common_errors/src/error_utils.rs:4636-4647 | rust_port/crates/flow_hh_json/src/lib.rs:21-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_errors/src/error_utils.rs:4636` it begins part-way through the construct above it, so those 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 `value` to `&Value` in one and `&serde_json::Value` 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) rust_port/crates/flow_env_builder/src/name_def.rs:2048 — rust_port/crates/flow_env_builder/src/name_def.rs:2048-2059 | rust_port/crates/flow_env_builder/src/name_def.rs:2304-2315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:2048` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:5822 — rust_port/crates/flow_env_builder/src/name_def.rs:5822-5833 | rust_port/crates/flow_env_builder/src/name_def.rs:5838-5849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5822` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2316 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2316-2327 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2342-2353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2316` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2038 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2038-2049 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2064-2075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs: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.
  • Duplicated block (12 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4669 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4669-4680 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4813-4824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4669` 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 `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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7790 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7790-7801 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7867-7878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7790` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12831 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12831-12842 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12847-12858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12831` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_event_logger/src/lib.rs:899 — rust_port/crates/flow_event_logger/src/lib.rs:899-910 | rust_port/crates/flow_event_logger/src/lib.rs:927-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 `rust_port/crates/flow_event_logger/src/lib.rs:899` 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 `ctx` to `LoggingContext` in one and `fb::LoggingContext` 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8902 — rust_port/crates/flow_parser/src/ast_visitor.rs:8902-8913 | rust_port/crates/flow_parser/src/ast_visitor.rs:9847-9858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:8902` 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) rust_port/crates/flow_parser/src/ast_visitor.rs:17602 — rust_port/crates/flow_parser/src/ast_visitor.rs:17602-17613 | rust_port/crates/flow_parser/src/ast_visitor.rs:17645-17656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:17602` 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) rust_port/crates/flow_parser/src/declaration_parser.rs:543 — rust_port/crates/flow_parser/src/declaration_parser.rs:543-554 | rust_port/crates/flow_parser/src/declaration_parser.rs:1436-1447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/declaration_parser.rs:543` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/declaration_parser.rs:1277 — rust_port/crates/flow_parser/src/declaration_parser.rs:1277-1288 | rust_port/crates/flow_parser/src/declaration_parser.rs:1299-1310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/declaration_parser.rs:1277` it does not close everything it opens, so those 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, `rust_port/crates/flow_parser/src/declaration_parser.rs:1275` calls `token` and `rust_port/crates/flow_parser/src/declaration_parser.rs:1298` 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) rust_port/crates/flow_parser/src/object_parser.rs:718 — rust_port/crates/flow_parser/src/object_parser.rs:718-729 | rust_port/crates/flow_parser/src/object_parser.rs:735-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 `rust_port/crates/flow_parser/src/object_parser.rs:718` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/object_parser.rs:1456 — rust_port/crates/flow_parser/src/object_parser.rs:1456-1467 | rust_port/crates/flow_parser/src/statement_parser.rs:138-149 — 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 `rust_port/crates/flow_parser/src/object_parser.rs:1456` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/object_parser.rs:2147 — rust_port/crates/flow_parser/src/object_parser.rs:2147-2158 | rust_port/crates/flow_parser/src/object_parser.rs:2163-2174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/object_parser.rs:2147` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:2618 — rust_port/crates/flow_parser/src/statement_parser.rs:2618-2629 | rust_port/crates/flow_parser/src/statement_parser.rs:2637-2648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:2618` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5847 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5847-5858 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5877-5888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5847` 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5383 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5383-5394 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5743-5754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5383` 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:172 — rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:172-183 | rust_port/crates/flow_parser_wasm/src/strip_flow.rs:129-140 — before extracting anything, compare `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs` and `rust_port/crates/flow_parser_wasm/src/strip_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:2361 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2361-2372 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4252-4263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 39 more in this group — see findings.md.
D2 · Cognitive Complexity · flow_typing_utils · ×63
  • flow_typing_utils::annotation_inference::elab_t_concrete (cognitive 140) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127 — flow_typing_utils::annotation_inference::elab_t_concrete has cognitive complexity 140 (threshold 15). Drivers by points: match/switch 26 (68 pts), if/else 21 (45 pts), boolean chains 24, loops 1 (3 pts) (nesting depth added 68). 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.
  • flow_typing_utils::members::merge_type (cognitive 128) rust_port/crates/flow_typing_utils/src/members.rs:80 — flow_typing_utils::members::merge_type has cognitive complexity 128 (threshold 15). Drivers by points: if/else 23 (58 pts), match/switch 13 (45 pts), loops 4 (13 pts), boolean chains 12 (nesting depth added 76). 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.
  • flow_typing_utils::type_sig_merge::merge_annot (cognitive 105) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2034 — flow_typing_utils::type_sig_merge::merge_annot has cognitive complexity 105 (threshold 15). Drivers by points: match/switch 28 (73 pts), if/else 10 (20 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 60). 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.
  • flow_typing_utils::exhaustive::value_union_builder::of_type_inner (cognitive 97) rust_port/crates/flow_typing_utils/src/exhaustive.rs:994 — flow_typing_utils::exhaustive::value_union_builder::of_type_inner has cognitive complexity 97 (threshold 15). Drivers by points: if/else 12 (43 pts), match/switch 8 (30 pts), loops 6 (23 pts), boolean chains 1 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_typing_utils::check_polarity::check_polarity_impl (cognitive 84) rust_port/crates/flow_typing_utils/src/check_polarity.rs:90 — flow_typing_utils::check_polarity::check_polarity_impl has cognitive complexity 84 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 9 (25 pts), match/switch 6 (13 pts), boolean chains 4 (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.
  • flow_typing_utils::exhaustive::filter_object_by_pattern (cognitive 77) rust_port/crates/flow_typing_utils/src/exhaustive.rs:1859 — flow_typing_utils::exhaustive::filter_object_by_pattern has cognitive complexity 77 (threshold 15). Drivers by points: if/else 26 (48 pts), match/switch 7 (15 pts), boolean chains 8, loops 4 (6 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.
  • flow_typing_utils::predicate_kit::instanceof_test (cognitive 73) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2739 — flow_typing_utils::predicate_kit::instanceof_test has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 4 (13 pts), boolean chains 12, match/switch 3 (6 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.
  • flow_typing_utils::type_operation_utils::perform_type_cast_with_env (cognitive 65) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2089 — flow_typing_utils::type_operation_utils::perform_type_cast_with_env has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (33 pts), match/switch 10 (18 pts), loops 3 (9 pts), boolean chains 5 (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.
  • flow_typing_utils::predicate_kit::prop_exists_test_generic (cognitive 64) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2432 — flow_typing_utils::predicate_kit::prop_exists_test_generic has cognitive complexity 64 (threshold 15). Drivers by points: if/else 15 (41 pts), match/switch 6 (16 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 39). 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.
  • flow_typing_utils::members::extract_members (cognitive 62) rust_port/crates/flow_typing_utils/src/members.rs:1040 — flow_typing_utils::members::extract_members has cognitive complexity 62 (threshold 15). Drivers by points: if/else 10 (31 pts), match/switch 7 (19 pts), loops 4 (12 pts) (nesting depth added 41). 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.
  • flow_typing_utils::type_hint::type_of_hint_decomposition (cognitive 56) rust_port/crates/flow_typing_utils/src/type_hint.rs:827 — flow_typing_utils::type_hint::type_of_hint_decomposition has cognitive complexity 56 (threshold 15). Drivers by points: match/switch 15 (33 pts), if/else 11 (16 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 26). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_utils::predicate_kit::call_latent_pred (cognitive 53) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1014 — flow_typing_utils::predicate_kit::call_latent_pred has cognitive complexity 53 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 4 (19 pts), boolean chains 5, 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.
  • flow_typing_utils::exhaustive::value_union_builder::lookup_prop (cognitive 41) rust_port/crates/flow_typing_utils/src/exhaustive.rs:1316 — flow_typing_utils::exhaustive::value_union_builder::lookup_prop has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 6 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). Of this number, 23 points are the body's own statements and 18 belong to 2 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.
  • flow_typing_utils::strict_es6_import_export::gather_declarations (cognitive 41) rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:100 — flow_typing_utils::strict_es6_import_export::gather_declarations has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 3 (11 pts), loops 2 (4 pts) (nesting depth added 28). Of this number, 39 points are the body's own statements and 2 belong to 2 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.
  • flow_typing_utils::predicate_kit::concretize_and_run_sentinel_prop_test (cognitive 34) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3497 — flow_typing_utils::predicate_kit::concretize_and_run_sentinel_prop_test has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 5 (17 pts), loops 3 (13 pts), if/else 2 (4 pts) (nesting depth added 24). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_utils::annotation_inference::elab_t (cognitive 33) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:816 — flow_typing_utils::annotation_inference::elab_t has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 7 (19 pts), if/else 4 (14 pts) (nesting depth added 22). 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.
  • flow_typing_utils::exhaustive::check_for_unused_patterns (cognitive 33) rust_port/crates/flow_typing_utils/src/exhaustive.rs:2365 — flow_typing_utils::exhaustive::check_for_unused_patterns has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (6 pts), match/switch 1 (6 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.
  • flow_typing_utils::members::extract_type (cognitive 33) rust_port/crates/flow_typing_utils/src/members.rs:856 — flow_typing_utils::members::extract_type has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 15 (30 pts), if/else 2 (3 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_utils::type_filter::array_length (cognitive 33) rust_port/crates/flow_typing_utils/src/type_filter.rs:1681 — flow_typing_utils::type_filter::array_length has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (8 pts), boolean chains 7 (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.
  • flow_typing_utils::type_hint::instantiate_callee::handle_poly (cognitive 33) rust_port/crates/flow_typing_utils/src/type_hint.rs:439 — flow_typing_utils::type_hint::instantiate_callee::handle_poly has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 5 (18 pts), if/else 6 (14 pts), boolean chains 1 (nesting depth added 21). 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.
  • flow_typing_utils::type_operation_utils::special_cased_functions::object_assign_with_env::assign_from_after_concretization (cognitive 32) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1629 — flow_typing_utils::type_operation_utils::special_cased_functions::object_assign_with_env::assign_from_after_concretization has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 7 (13 pts), loops 4 (10 pts), if/else 3 (9 pts) (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.
  • flow_typing_utils::members::instantiate_poly_t (cognitive 31) rust_port/crates/flow_typing_utils/src/members.rs:620 — flow_typing_utils::members::instantiate_poly_t has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 4 (9 pts), loops 1 (4 pts) (nesting depth added 20). 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.
  • flow_typing_utils::predicate_kit::eq_test (cognitive 31) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3643 — flow_typing_utils::predicate_kit::eq_test has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 2 (3 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_utils::type_env::recorded_declare_namespace_member_opt (cognitive 31) rust_port/crates/flow_typing_utils/src/type_env.rs:127 — flow_typing_utils::type_env::recorded_declare_namespace_member_opt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 5 (6 pts), loops 3 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (namespace_types_at_path_prefix::namespace_types_for_root_path_element, namespace_types_at_path_prefix::namespace_types_for_child_path_element, namespace_value_member_opt::object_value_member_opt, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_utils::type_sig_merge::merge_value (cognitive 31) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3266 — flow_typing_utils::type_sig_merge::merge_value has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 5, 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.
  • + 38 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×55
  • Duplicated block (14 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:600 — rust_port/crates/flow_analysis/src/property_assignment.rs:600-613 | rust_port/crates/flow_analysis/src/ssa_builder.rs:809-822 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:600` it does not close everything it opens, so those 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 `stmt` to `&'ast ast::statement::For<ALoc, ALoc>` in one and `&ast::statement::For<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_analysis/src/ssa_builder.rs:823` calls `fresh_ssa_env`, `merge_self_ssa_env` and `rust_port/crates/flow_analysis/src/property_assignment.rs:614` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) rust_port/crates/flow_cli/src/server_command.rs:54 — rust_port/crates/flow_cli/src/server_command.rs:54-67 | rust_port/crates/flow_cli/src/start_command.rs:68-81 — 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) rust_port/crates/flow_common/src/files.rs:489 — rust_port/crates/flow_common/src/files.rs:489-502 | rust_port/crates/flow_common/src/files.rs:518-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.
  • Duplicated block (14 lines × 2) rust_port/crates/flow_config/src/flowconfig.rs:1562 — rust_port/crates/flow_config/src/flowconfig.rs:1562-1575 | rust_port/crates/flow_config/src/flowconfig.rs:1581-1594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_config/src/flowconfig.rs:1562` 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, `rust_port/crates/flow_config/src/flowconfig.rs:1580` calls `escape` and `rust_port/crates/flow_config/src/flowconfig.rs:1561` 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) rust_port/crates/flow_env_builder/src/find_providers.rs:1241 — rust_port/crates/flow_env_builder/src/find_providers.rs:1241-1254 | rust_port/crates/flow_env_builder/src/find_providers.rs:1276-1289 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_env_builder/src/find_providers.rs:1290` calls `is_some`, `enter_possibly_polymorphic_scope` and `rust_port/crates/flow_env_builder/src/find_providers.rs:1255` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:4651 — rust_port/crates/flow_env_builder/src/name_def.rs:4651-4664 | rust_port/crates/flow_env_builder/src/name_def.rs:7282-7295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:4651` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:6075 — rust_port/crates/flow_env_builder/src/name_def.rs:6075-6088 | rust_port/crates/flow_env_builder/src/name_def.rs:6104-6117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:6075` 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) rust_port/crates/flow_env_builder/src/name_def.rs:6283 — rust_port/crates/flow_env_builder/src/name_def.rs:6283-6296 | rust_port/crates/flow_env_builder/src/name_def.rs:6333-6346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:6283` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7464 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7464-7477 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7534-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7464` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7858 — rust_port/crates/flow_parser/src/ast_visitor.rs:7858-7871 | rust_port/crates/flow_parser/src/ast_visitor.rs:7957-7970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:7858` 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1763 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1763-1776 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5422-5435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1763` 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3174 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3174-3187 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3235-3248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3174` 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6096 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6096-6109 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6167-6180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6096` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:556 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:556-569 | rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:375-388 — 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 `rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:556` 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:194 — rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:194-207 | rust_port/crates/flow_parser_wasm/src/strip_flow.rs:161-174 — before extracting anything, compare `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs` and `rust_port/crates/flow_parser_wasm/src/strip_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:194` 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) rust_port/crates/flow_server_env/src/server_env.rs:507 — rust_port/crates/flow_server_env/src/server_env.rs:507-520 | rust_port/crates/flow_server_env/src/server_env.rs:569-582 — both copies are in the same file, so extract the 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) rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:332 — rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:332-345 | rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:349-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:332` 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:524 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:524-537 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:605-618 — before extracting anything, compare `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs` and `rust_port/crates/flow_services_code_action/src/autofix_imports.rs` 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 `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:524` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig.rs:955 — rust_port/crates/flow_type_sig/src/type_sig.rs:955-968 | rust_port/crates/flow_type_sig/src/type_sig.rs:1067-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig.rs:955` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig.rs:1689 — rust_port/crates/flow_type_sig/src/type_sig.rs:1689-1702 | rust_port/crates/flow_type_sig/src/type_sig.rs:1707-1720 — both copies are in the same file, so extract the 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2336 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2336-2349 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2394-2407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2336` 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4246 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4246-4259 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4275-4288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4246` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing/src/env_resolution.rs:1505 — rust_port/crates/flow_typing/src/env_resolution.rs:1505-1518 | rust_port/crates/flow_typing/src/env_resolution.rs:1521-1534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing/src/env_resolution.rs:1505` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9575 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9575-9588 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9593-9606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9575` 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890-9903 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10117-10130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890` 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.
  • + 30 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×54
  • Duplicated block (5 lines × 2) rust_port/crates/flow_common_ty/src/ty.rs:5018 — rust_port/crates/flow_common_ty/src/ty.rs:5018-5022 | rust_port/crates/flow_common_ty/src/ty.rs:5026-5030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty.rs:5018` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_common_ty/src/ty_debug.rs:843 — rust_port/crates/flow_common_ty/src/ty_debug.rs:843-847 | rust_port/crates/flow_common_ty/src/ty_debug.rs:855-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:334 — rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:334-338 | rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:355-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:334` 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 `stmt` to `&ast::statement::ForIn<Loc, Loc>` in one and `&ast::statement::ForOf<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_parser/src/declaration_parser.rs:1474 — rust_port/crates/flow_parser/src/declaration_parser.rs:1474-1478 | rust_port/crates/flow_parser/src/statement_parser.rs:1820-1824 — 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 (5 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:934 — rust_port/crates/flow_parser/src/expression_parser.rs:934-938 | rust_port/crates/flow_parser/src/expression_parser.rs:1011-1015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/expression_parser.rs:934` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1634 — rust_port/crates/flow_parser/src/flow_lexer.rs:1634-1638 | rust_port/crates/flow_parser/src/flow_lexer.rs:1645-1649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:1634` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1707 — rust_port/crates/flow_parser/src/flow_lexer.rs:1707-1711 | rust_port/crates/flow_parser/src/flow_lexer.rs:1829-1833 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_parser/src/flow_lexer.rs:1826` calls `is_valid_js_identifier_start`, `slice`, `chars` and `rust_port/crates/flow_parser/src/flow_lexer.rs:1706` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_parser/src/flow_lexer.rs:2287 — rust_port/crates/flow_parser/src/flow_lexer.rs:2287-2291 | rust_port/crates/flow_parser/src/flow_lexer.rs:2303-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:2287` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/match_pattern_parser.rs:194 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:194-198 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:588-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs: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 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) rust_port/crates/flow_parser/src/match_pattern_parser.rs:968 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:968-972 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:976-980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:981 — rust_port/crates/flow_parser/src/statement_parser.rs:981-985 | rust_port/crates/flow_parser/src/statement_parser.rs:1365-1369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:981` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:3358 — rust_port/crates/flow_parser/src/statement_parser.rs:3358-3362 | rust_port/crates/flow_parser/src/statement_parser.rs:4046-4050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3358` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_server_env/src/error_collator.rs:73 — rust_port/crates/flow_server_env/src/error_collator.rs:73-77 | rust_port/crates/flow_server_env/src/error_collator.rs:118-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_env/src/error_collator.rs:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:358 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:358-362 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:373-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:358` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1618 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1618-1622 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1662-1666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1618` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1617 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1617-1621 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1797-1801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1617` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8250 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8250-8254 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9649-9653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13078 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13078-13082 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13929-13933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13078` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13217 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13217-13221 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14075-14079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13217` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1629 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1629-1633 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1661-1666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1629` 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 (5 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2946 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2946-2950 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3073-3077 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3124 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3124-3128 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3884-3888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3124` 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 (5 lines × 2) rust_port/crates/flow_typing_statement/src/destructuring.rs:116 — rust_port/crates/flow_typing_statement/src/destructuring.rs:116-120 | rust_port/crates/flow_typing_statement/src/match_pattern.rs:81-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 `rust_port/crates/flow_typing_statement/src/destructuring.rs:116` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:16205 — rust_port/crates/flow_typing_statement/src/statement.rs:16205-16209 | rust_port/crates/flow_typing_statement/src/statement.rs:19124-19128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:16205` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:19939 — rust_port/crates/flow_typing_statement/src/statement.rs:19939-19943 | rust_port/crates/flow_typing_statement/src/statement.rs:20418-20423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:19939` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 29 more in this group — see findings.md.
D2 · Cognitive Complexity · flow_typing_flow_js · ×47
  • flow_typing_flow_js::flow_js::dispatch::__flow_impl (cognitive 646) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633 — flow_typing_flow_js::flow_js::dispatch::__flow_impl has cognitive complexity 646 (threshold 15). Drivers by points: if/else 141 (282 pts), match/switch 109 (254 pts), loops 31 (65 pts), boolean chains 45 (nesting depth added 320). Of this number, 644 points are the body's own statements and 2 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.
  • flow_typing_flow_js::subtyping_kit::rec_sub_t (cognitive 295) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3054 — flow_typing_flow_js::subtyping_kit::rec_sub_t has cognitive complexity 295 (threshold 15). Drivers by points: if/else 75 (157 pts), match/switch 35 (83 pts), boolean chains 36, loops 9 (19 pts) (nesting depth added 140). Of this number, 293 points are the body's own statements and 2 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.
  • flow_typing_flow_js::implicit_instantiation::walk::solve_targs_in_snapshot (cognitive 191) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:6421 — flow_typing_flow_js::implicit_instantiation::walk::solve_targs_in_snapshot has cognitive complexity 191 (threshold 15). Drivers by points: if/else 35 (77 pts), match/switch 25 (61 pts), loops 18 (37 pts), boolean chains 16 (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_typing_flow_js::subtyping_kit::flow_obj_to_obj (cognitive 139) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1804 — flow_typing_flow_js::subtyping_kit::flow_obj_to_obj has cognitive complexity 139 (threshold 15). Drivers by points: match/switch 24 (68 pts), if/else 28 (62 pts), boolean chains 8, loops 1 (nesting depth added 78). 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.
  • flow_typing_flow_js::flow_js::inheritance_helpers::inst_structural_subtype (cognitive 76) rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:233 — flow_typing_flow_js::flow_js::inheritance_helpers::inst_structural_subtype has cognitive complexity 76 (threshold 15). Drivers by points: if/else 13 (38 pts), match/switch 10 (25 pts), loops 5 (9 pts), boolean chains 4 (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.
  • flow_typing_flow_js::flow_js::unification_helpers::__unify_inner (cognitive 73) rust_port/crates/flow_typing_flow_js/src/flow_js/unification_helpers.rs:168 — flow_typing_flow_js::flow_js::unification_helpers::__unify_inner has cognitive complexity 73 (threshold 15). Drivers by points: match/switch 7 (21 pts), if/else 5 (20 pts), loops 6 (18 pts), boolean chains 14 (nesting depth added 41). 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.
  • flow_typing_flow_js::slice_utils::map_object (cognitive 65) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:3359 — flow_typing_flow_js::slice_utils::map_object has cognitive complexity 65 (threshold 15). Drivers by points: match/switch 17 (42 pts), loops 4 (14 pts), if/else 5 (9 pts) (nesting depth added 39). 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.
  • flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::finish_array (cognitive 64) rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:743 — flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::finish_array has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 10 (23 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 33). 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. This shape REPEATS in the file: 2 other methods here (flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::flatten_spread_args, flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::flatten_call_arg::flatten) 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.
  • flow_typing_flow_js::flow_js::helpers::handle_generic (cognitive 60) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:481 — flow_typing_flow_js::flow_js::helpers::handle_generic has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (46 pts), match/switch 7 (12 pts), 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.
  • flow_typing_flow_js::implicit_instantiation::t_of_use_t (cognitive 57) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:384 — flow_typing_flow_js::implicit_instantiation::t_of_use_t has cognitive complexity 57 (threshold 15). Drivers by points: match/switch 21 (46 pts), if/else 4 (10 pts), boolean chains 1 (nesting depth added 31). Of this number, 51 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
  • flow_typing_flow_js::object_kit::run_with_env (cognitive 55) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:563 — flow_typing_flow_js::object_kit::run_with_env has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (29 pts), match/switch 11 (15 pts), loops 4 (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.
  • flow_typing_flow_js::flow_js::helpers::reposition::recurse (cognitive 50) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:2035 — flow_typing_flow_js::flow_js::helpers::reposition::recurse has cognitive complexity 50 (threshold 15). Drivers by points: match/switch 10 (27 pts), if/else 7 (17 pts), boolean chains 6 (nesting depth added 27). 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.
  • flow_typing_flow_js::slice_utils::spread2 (cognitive 42) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:517 — flow_typing_flow_js::slice_utils::spread2 has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 15, match/switch 6 (9 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.
  • flow_typing_flow_js::implicit_instantiation::merge_upper_bounds (cognitive 36) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:1338 — flow_typing_flow_js::implicit_instantiation::merge_upper_bounds has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 5 (15 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_typing_flow_js::flow_js::eval_helpers::eval_destructor (cognitive 34) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:445 — flow_typing_flow_js::flow_js::eval_helpers::eval_destructor has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 9 (15 pts), if/else 5 (9 pts), boolean chains 7, loops 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.
  • flow_typing_flow_js::flow_js::multi_arg_helpers::multiflow_args (cognitive 34) rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:145 — flow_typing_flow_js::flow_js::multi_arg_helpers::multiflow_args has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (11 pts), match/switch 5 (7 pts), boolean chains 1 (nesting depth added 17). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_flow_js::slice_utils::resolve_with_env (cognitive 34) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2314 — flow_typing_flow_js::slice_utils::resolve_with_env has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 11 (23 pts), if/else 3 (6 pts), boolean chains 5 (nesting depth added 15). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_flow_js::implicit_instantiation::kit::run_conditional (cognitive 32) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3771 — flow_typing_flow_js::implicit_instantiation::kit::run_conditional has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11, match/switch 2 (4 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.
  • flow_typing_flow_js::implicit_instantiation::walk::pin (cognitive 32) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:7077 — flow_typing_flow_js::implicit_instantiation::walk::pin has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (11 pts), loops 5 (6 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.
  • flow_typing_flow_js::renders_kit::try_synthesize_render_type_with_env::on_concretized_react_node_types (cognitive 32) rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:751 — flow_typing_flow_js::renders_kit::try_synthesize_render_type_with_env::on_concretized_react_node_types has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 8 (22 pts), if/else 4 (9 pts), loops 1 (nesting depth added 19). 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.
  • flow_typing_flow_js::template_literal_type::is_number_text (cognitive 30) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:127 — flow_typing_flow_js::template_literal_type::is_number_text has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 12, match/switch 1 (2 pts), loops 1 (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.
  • flow_typing_flow_js::implicit_instantiation::walk::key_markers_seen (cognitive 28) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5958 — flow_typing_flow_js::implicit_instantiation::walk::key_markers_seen has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 3 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 15). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_flow_js::slice_utils::object_rest_with_env (cognitive 27) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1355 — flow_typing_flow_js::slice_utils::object_rest_with_env has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 8 (12 pts), if/else 3 (9 pts), loops 3 (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.
  • flow_typing_flow_js::implicit_instantiation::merge_lower_bounds (cognitive 26) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:1462 — flow_typing_flow_js::implicit_instantiation::merge_lower_bounds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (7 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.
  • flow_typing_flow_js::flow_js::eval_helpers::mk_possibly_evaluated_destructor_for_annotations (cognitive 25) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1477 — flow_typing_flow_js::flow_js::eval_helpers::mk_possibly_evaluated_destructor_for_annotations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
  • + 22 more in this group — see findings.md.
D1 · Cyclomatic Complexity · flow_parser · ×43
  • flow_parser::flow_lexer::token_base_inner (cyclomatic 217) rust_port/crates/flow_parser/src/flow_lexer.rs:1028 — flow_parser::flow_lexer::token_base_inner has cyclomatic complexity 217 (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: flow_parser::flow_lexer::decode_html_entity (cyclomatic 254) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_parser::estree_translator::statement (cyclomatic 95) rust_port/crates/flow_parser/src/estree_translator.rs:287 — flow_parser::estree_translator::statement has cyclomatic complexity 95 (threshold 15). Of this number, 86 points are the body's own statements and 9 belong to 4 function items inside it that branch. 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.
  • flow_parser::estree_translator::expression (cyclomatic 61) rust_port/crates/flow_parser/src/estree_translator.rs:1251 — flow_parser::estree_translator::expression has cyclomatic complexity 61 (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.
  • flow_parser::statement_parser::export_declaration::parse (cyclomatic 61) rust_port/crates/flow_parser/src/statement_parser.rs:2848 — flow_parser::statement_parser::export_declaration::parse has cyclomatic complexity 61 (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.
  • flow_parser::statement_parser::import_declaration (cyclomatic 51) rust_port/crates/flow_parser/src/statement_parser.rs:4394 — flow_parser::statement_parser::import_declaration has cyclomatic complexity 51 (threshold 15). Of this number, 21 points are the body's own statements and 30 belong to 10 function items inside it that branch. 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.
  • flow_parser::ast_utils::acceptable_statement_in_declaration_context (cyclomatic 50) rust_port/crates/flow_parser/src/ast_utils.rs:678 — flow_parser::ast_utils::acceptable_statement_in_declaration_context has cyclomatic complexity 50 (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.
  • flow_parser::object_parser::class_element (cyclomatic 49) rust_port/crates/flow_parser/src/object_parser.rs:1036 — flow_parser::object_parser::class_element 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. This shape REPEATS in the file: 2 other methods here (flow_parser::object_parser::class_element::accessor, flow_parser::object_parser::class_element::init) 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.
  • flow_parser::object_parser::class_element::init (cyclomatic 45) rust_port/crates/flow_parser/src/object_parser.rs:1631 — flow_parser::object_parser::class_element::init 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. This shape REPEATS in the file: 2 other methods here (flow_parser::object_parser::class_element, flow_parser::object_parser::class_element::accessor) 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.
  • flow_parser::statement_parser::declare_export_declaration_body (cyclomatic 43) rust_port/crates/flow_parser/src/statement_parser.rs:3631 — flow_parser::statement_parser::declare_export_declaration_body has cyclomatic complexity 43 (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.
  • flow_parser::type_parser::object_type::property (cyclomatic 41) rust_port/crates/flow_parser/src/type_parser.rs:3587 — flow_parser::type_parser::object_type::property 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.
  • flow_parser::type_parser::primary (cyclomatic 39) rust_port/crates/flow_parser/src/type_parser.rs:685 — flow_parser::type_parser::primary has cyclomatic complexity 39 (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.
  • flow_parser::main_parser::check_for_duplicate_exports (cyclomatic 35) rust_port/crates/flow_parser/src/main_parser.rs:280 — flow_parser::main_parser::check_for_duplicate_exports has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 2 function items inside it that branch. 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.
  • flow_parser::expression_parser::assignment_cover (cyclomatic 33) rust_port/crates/flow_parser/src/expression_parser.rs:141 — flow_parser::expression_parser::assignment_cover has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (try_assignment_parse, try_assignment_or_arrow_function, assignment_but_not_arrow_function_cover, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_parser::expression_parser::add_comments (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_parser::statement_parser::parse_statement (cyclomatic 33) rust_port/crates/flow_parser/src/statement_parser.rs:5171 — flow_parser::statement_parser::parse_statement 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.
  • flow_parser::object_parser::initializer (cyclomatic 31) rust_port/crates/flow_parser/src/object_parser.rs:361 — flow_parser::object_parser::initializer has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 6 function items inside it that branch (property, parse_shorthand, parse_init, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_parser::type_parser::param_list_or_type (cyclomatic 31) rust_port/crates/flow_parser/src/type_parser.rs:2064 — flow_parser::type_parser::param_list_or_type 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. This is NOT this file's highest cyclomatic complexity: flow_parser::type_parser::add_comments (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_parser::jsx_parser::element_with_optional_opening_less_than (cyclomatic 30) rust_port/crates/flow_parser/src/jsx_parser.rs:568 — flow_parser::jsx_parser::element_with_optional_opening_less_than has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 4 function items inside it that branch. 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.
  • flow_parser::match_pattern_parser::subpattern (cyclomatic 29) rust_port/crates/flow_parser/src/match_pattern_parser.rs:114 — flow_parser::match_pattern_parser::subpattern has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
  • flow_parser::parser_env::peek::comma_trailing_comments_after_current_if_line_terminator (cyclomatic 28) rust_port/crates/flow_parser/src/parser_env.rs:1909 — flow_parser::parser_env::peek::comma_trailing_comments_after_current_if_line_terminator 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.
  • flow_parser::flow_lexer::string_escape (cyclomatic 27) rust_port/crates/flow_parser/src/flow_lexer.rs:503 — flow_parser::flow_lexer::string_escape 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: flow_parser::flow_lexer::decode_html_entity (cyclomatic 254) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_parser::parser_env::peek::offset_after_current_trivia (cyclomatic 27) rust_port/crates/flow_parser/src/parser_env.rs:1455 — flow_parser::parser_env::peek::offset_after_current_trivia 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.
  • flow_parser::statement_parser::for_loop (cyclomatic 27) rust_port/crates/flow_parser/src/statement_parser.rs:407 — flow_parser::statement_parser::for_loop has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
  • flow_parser::expression_parser::primary_cover (cyclomatic 26) rust_port/crates/flow_parser/src/expression_parser.rs:2284 — flow_parser::expression_parser::primary_cover 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. This is NOT this file's highest cyclomatic complexity: flow_parser::expression_parser::add_comments (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_parser::statement_parser::declare (cyclomatic 26) rust_port/crates/flow_parser/src/statement_parser.rs:2442 — flow_parser::statement_parser::declare 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.
  • flow_parser::declaration_parser::parse_function_params (cyclomatic 25) rust_port/crates/flow_parser/src/declaration_parser.rs:331 — flow_parser::declaration_parser::parse_function_params has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function items inside it that branch (param, this_param_annotation, param_list, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • + 18 more in this group — see findings.md.
D1 · Cyclomatic Complexity · flow_typing_utils · ×42
  • flow_typing_utils::annotation_inference::elab_t_concrete (cyclomatic 196) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1127 — flow_typing_utils::annotation_inference::elab_t_concrete has cyclomatic complexity 196 (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.
  • flow_typing_utils::type_sig_merge::merge_annot (cyclomatic 108) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2034 — flow_typing_utils::type_sig_merge::merge_annot has cyclomatic complexity 108 (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.
  • flow_typing_utils::members::merge_type (cyclomatic 74) rust_port/crates/flow_typing_utils/src/members.rs:80 — flow_typing_utils::members::merge_type has cyclomatic complexity 74 (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.
  • flow_typing_utils::predicate_kit::intersect_type_guard (cyclomatic 68) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1587 — flow_typing_utils::predicate_kit::intersect_type_guard has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 8 of the 68 points are its own statements and the rest belongs to 16 function items inside it that branch (try_intersect_related, intersect_guard_members, try_intersect, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_utils::check_polarity::check_polarity_impl (cyclomatic 66) rust_port/crates/flow_typing_utils/src/check_polarity.rs:90 — flow_typing_utils::check_polarity::check_polarity_impl has cyclomatic complexity 66 (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.
  • flow_typing_utils::type_hint::type_of_hint_decomposition (cyclomatic 53) rust_port/crates/flow_typing_utils/src/type_hint.rs:827 — flow_typing_utils::type_hint::type_of_hint_decomposition has cyclomatic complexity 53 (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.
  • flow_typing_utils::predicate_kit::instanceof_test (cyclomatic 51) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2739 — flow_typing_utils::predicate_kit::instanceof_test 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. This is NOT this file's highest cyclomatic complexity: flow_typing_utils::predicate_kit::predicate_no_concretization (cyclomatic 61) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_utils::members::extract_type (cyclomatic 47) rust_port/crates/flow_typing_utils/src/members.rs:856 — flow_typing_utils::members::extract_type 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.
  • flow_typing_utils::type_env::predicate_of_refinement::pred (cyclomatic 43) rust_port/crates/flow_typing_utils/src/type_env.rs:1007 — flow_typing_utils::type_env::predicate_of_refinement::pred has cyclomatic complexity 43 (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.
  • flow_typing_utils::exhaustive::filter_object_by_pattern (cyclomatic 41) rust_port/crates/flow_typing_utils/src/exhaustive.rs:1859 — flow_typing_utils::exhaustive::filter_object_by_pattern 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.
  • flow_typing_utils::convert_types::json_of_destructor (cyclomatic 39) rust_port/crates/flow_typing_utils/src/convert_types.rs:1104 — flow_typing_utils::convert_types::json_of_destructor has cyclomatic complexity 39 (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.
  • flow_typing_utils::exhaustive::value_union_builder::of_type_inner (cyclomatic 36) rust_port/crates/flow_typing_utils/src/exhaustive.rs:994 — flow_typing_utils::exhaustive::value_union_builder::of_type_inner 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.
  • flow_typing_utils::exhaustive::value_union_builder::lookup_prop (cyclomatic 33) rust_port/crates/flow_typing_utils/src/exhaustive.rs:1316 — flow_typing_utils::exhaustive::value_union_builder::lookup_prop has cyclomatic complexity 33 (threshold 15). Of this number, 20 points are the body's own statements and 13 belong to 2 function items 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.
  • flow_typing_utils::type_sig_merge::merge_value (cyclomatic 33) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3266 — flow_typing_utils::type_sig_merge::merge_value 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.
  • flow_typing_utils::type_operation_utils::perform_type_cast_with_env (cyclomatic 32) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2089 — flow_typing_utils::type_operation_utils::perform_type_cast_with_env 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.
  • flow_typing_utils::members::extract_members (cyclomatic 31) rust_port/crates/flow_typing_utils/src/members.rs:1040 — flow_typing_utils::members::extract_members has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • flow_typing_utils::type_operation_utils::operators::check_strict_eq (cyclomatic 31) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:706 — flow_typing_utils::type_operation_utils::operators::check_strict_eq has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 3 function items inside it that branch (strict_equatable_error, distribute_strict, not_possible_enum_after_concretization). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_utils::annotation_inference::elab_t (cyclomatic 29) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:816 — flow_typing_utils::annotation_inference::elab_t 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.
  • flow_typing_utils::exhaustive::pattern_union_builder::of_pattern_ast_inner (cyclomatic 29) rust_port/crates/flow_typing_utils/src/exhaustive.rs:507 — flow_typing_utils::exhaustive::pattern_union_builder::of_pattern_ast_inner 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.
  • flow_typing_utils::predicate_kit::sentinel_prop_test_generic (cyclomatic 27) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3223 — flow_typing_utils::predicate_kit::sentinel_prop_test_generic has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to one function item inside it that branches. 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: flow_typing_utils::predicate_kit::predicate_no_concretization (cyclomatic 61) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_utils::type_env::possibly_refined_write_state_of_state::loop_fn (cyclomatic 26) rust_port/crates/flow_typing_utils/src/type_env.rs:1332 — flow_typing_utils::type_env::possibly_refined_write_state_of_state::loop_fn 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.
  • flow_typing_utils::convert_types::type_to_json_uncached (cyclomatic 25) rust_port/crates/flow_typing_utils/src/convert_types.rs:348 — flow_typing_utils::convert_types::type_to_json_uncached 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. This is NOT this file's highest cyclomatic complexity: flow_typing_utils::convert_types::def_t_to_json (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 function is counted neither in this dimension's figures nor in its score.
  • flow_typing_utils::predicate_kit::has_prop (cyclomatic 25) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2220 — flow_typing_utils::predicate_kit::has_prop has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (find_key, some_has_prop, try_some_has_prop, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_typing_utils::predicate_kit::predicate_no_concretization (cyclomatic 61) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_utils::predicate_kit::prop_exists_test_generic (cyclomatic 25) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2432 — flow_typing_utils::predicate_kit::prop_exists_test_generic 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: flow_typing_utils::predicate_kit::predicate_no_concretization (cyclomatic 61) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_utils::type_operation_utils::special_cased_functions::object_assign_with_env::assign_from_after_concretization (cyclomatic 25) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1629 — flow_typing_utils::type_operation_utils::special_cased_functions::object_assign_with_env::assign_from_after_concretization 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.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×42
  • Duplicated block (13 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:568 — rust_port/crates/flow_analysis/src/property_assignment.rs:568-580 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1736-1748 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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, `rust_port/crates/flow_analysis/src/ssa_builder.rs:1749` calls `assert_ssa_env` and `rust_port/crates/flow_analysis/src/property_assignment.rs:581` 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) rust_port/crates/flow_cli/src/apply_code_action_command.rs:44 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:44-56 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:157-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/apply_code_action_command.rs:44` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_cli/src/check_contents_command.rs:131 — rust_port/crates/flow_cli/src/check_contents_command.rs:131-143 | rust_port/crates/flow_cli/src/status_command.rs:139-151 — 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 `rust_port/crates/flow_cli/src/check_contents_command.rs:131` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_cli/src/glean_runner.rs:1086 — rust_port/crates/flow_cli/src/glean_runner.rs:1086-1098 | rust_port/crates/flow_cli/src/glean_runner.rs:1151-1163 — both copies are in the same file, so extract the 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) rust_port/crates/flow_codemods/src/annotate_exports.rs:631 — rust_port/crates/flow_codemods/src/annotate_exports.rs:631-643 | rust_port/crates/flow_codemods/src/annotate_exports.rs:669-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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:631` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder/src/find_providers.rs:856 — rust_port/crates/flow_env_builder/src/find_providers.rs:856-868 | rust_port/crates/flow_env_builder/src/find_providers.rs:1323-1335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/find_providers.rs:856` 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:597 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:597-609 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:616-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:597` 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1563 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1563-1575 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1577-1589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11121 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11121-11133 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11343-11355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11121` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_heap/src/transaction.rs:1257 — rust_port/crates/flow_heap/src/transaction.rs:1257-1269 | rust_port/crates/flow_heap/src/transaction.rs:1669-1681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_heap/src/transaction.rs:1257` 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) rust_port/crates/flow_packed_locs/src/packed_locs.rs:178 — rust_port/crates/flow_packed_locs/src/packed_locs.rs:178-190 | rust_port/crates/flow_packed_locs/src/packed_locs.rs:220-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_packed_locs/src/packed_locs.rs:178` it does not close everything it opens, so those 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, `rust_port/crates/flow_packed_locs/src/packed_locs.rs:219` calls `read_int` and `rust_port/crates/flow_packed_locs/src/packed_locs.rs:177` 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) rust_port/crates/flow_parser/src/estree_translator.rs:4064 — rust_port/crates/flow_parser/src/estree_translator.rs:4064-4076 | rust_port/crates/flow_parser/src/estree_translator.rs:5708-5720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:4064` 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) rust_port/crates/flow_parser/src/expression_parser.rs:68 — rust_port/crates/flow_parser/src/expression_parser.rs:68-80 | rust_port/crates/flow_parser/src/expression_parser.rs:394-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/expression_parser.rs:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:1134 — rust_port/crates/flow_parser/src/expression_parser.rs:1134-1146 | rust_port/crates/flow_parser/src/expression_parser.rs:1150-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/expression_parser.rs:1134` 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:516 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:516-528 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:534-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. 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:552 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:552-564 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:629-641 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/type_parser.rs:1912 — rust_port/crates/flow_parser/src/type_parser.rs:1912-1924 | rust_port/crates/flow_parser/src/type_parser.rs:2044-2056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:1912` 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) rust_port/crates/flow_parser_utils/src/enum_validate.rs:236 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:236-248 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:284-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/enum_validate.rs:236` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3991 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3991-4003 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4171-4183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3991` 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) rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1212 — rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1212-1224 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1381-1393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1212` 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) rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:238 — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:238-250 | rust_port/crates/flow_services_inference/src/type_service.rs:2558-2570 — before extracting anything, compare `rust_port/crates/flow_server_rechecker/src/recheck_updates.rs` and `rust_port/crates/flow_services_inference/src/type_service.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1383 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1383-1395 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1603-1615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1383` 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) rust_port/crates/flow_type_sig/src/ts_enum_sig.rs:169 — rust_port/crates/flow_type_sig/src/ts_enum_sig.rs:169-181 | rust_port/crates/flow_type_sig/src/ts_enum_sig.rs:183-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4416 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4416-4428 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4570-4582 — both copies are in the same file, so extract the 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11993 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11993-12005 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12018-12030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11993` it does not close everything it opens, so those 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, `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12006` calls `dupe` and `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12031` 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.
  • + 17 more in this group — see findings.md.
R4 · Test Coverage · This test file cannot be loaded · ×40
  • This test file cannot be loaded packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11 — packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/flow-remove-types/test/test-node-module.js:4 — packages/flow-remove-types/test/test-node-module.js:4 imports './missing-type-only-module', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/import_unsupported_phase/contextual_default_and_named.js:1 — src/parser/test/flow/import_unsupported_phase/contextual_default_and_named.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/import_unsupported_phase/contextual_default_binding.js:1 — src/parser/test/flow/import_unsupported_phase/contextual_default_binding.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/import_unsupported_phase/contextual_import_equals.js:1 — src/parser/test/flow/import_unsupported_phase/contextual_import_equals.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/import_unsupported_phase/default_binding.js:1 — src/parser/test/flow/import_unsupported_phase/default_binding.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/import_unsupported_phase/unknown_phase.js:1 — src/parser/test/flow/import_unsupported_phase/unknown_phase.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/parser/test/flow/ts_syntax/export_type_specifier.js:2 — src/parser/test/flow/ts_syntax/export_type_specifier.js:2 imports './export.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_components.js:5 — tests/ambient_declarations/use_components.js:5 imports './components.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (2 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_functions_no_semi.js:1 — tests/ambient_declarations/use_functions_no_semi.js:1 imports './functions_no_semi', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_implicit_functions.js:17 — tests/ambient_declarations/use_implicit_functions.js:17 imports './functions', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_optional_destructuring.js:1 — tests/ambient_declarations/use_optional_destructuring.js:1 imports './optional_destructuring', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_optional_methods.js:1 — tests/ambient_declarations/use_optional_methods.js:1 imports './optional_methods', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/ambient_declarations/use_variables.js:5 — tests/ambient_declarations/use_variables.js:5 imports './variables.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/annotate_exports_import_paths/file.js:4 — tests/annotate_exports_import_paths/file.js:4 imports './lib-flow', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/autocomplete_from_a_to_g/bar.js:3 — tests/autocomplete_from_a_to_g/bar.js:3 imports './unknown', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/cancelable_rechecks/sleep_dependent.js:3 — tests/cancelable_rechecks/sleep_dependent.js:3 imports './sleep', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/config_module_file_exts_precedence/test.js:2 — tests/config_module_file_exts_precedence/test.js:2 imports './aaa_vs_zzz', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (4 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/config_module_name_rewrite_node/A.js:3 — tests/config_module_name_rewrite_node/A.js:3 imports './1DoesntExist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/config_untyped/test.js:9 — tests/config_untyped/test.js:9 imports './untyped/bogus', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/declaration_files_node/test_relative.js:19 — tests/declaration_files_node/test_relative.js:19 imports './confusing_dir', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/declaration_files_parse_error/test.js:3 — tests/declaration_files_parse_error/test.js:3 imports './no_pragma', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/dir_coverage/b.js:3 — tests/dir_coverage/b.js:3 imports './folder/c', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/dir_coverage/other_folder/h.js:3 — tests/dir_coverage/other_folder/h.js:3 imports '../folder/c', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded tests/incremental_basic/tmp1/b.js:2 — tests/incremental_basic/tmp1/b.js:2 imports './a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • + 15 more in this group — see findings.md.
D1 · Cyclomatic Complexity · flow_typing_flow_js · ×39
  • flow_typing_flow_js::flow_js::dispatch::__flow_impl (cyclomatic 693) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:633 — flow_typing_flow_js::flow_js::dispatch::__flow_impl has cyclomatic complexity 693 (threshold 15). Of this number, 692 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_flow_js::subtyping_kit::rec_sub_t (cyclomatic 315) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3054 — flow_typing_flow_js::subtyping_kit::rec_sub_t has cyclomatic complexity 315 (threshold 15). Of this number, 313 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_typing_flow_js::implicit_instantiation::walk::solve_targs_in_snapshot (cyclomatic 106) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:6421 — flow_typing_flow_js::implicit_instantiation::walk::solve_targs_in_snapshot has cyclomatic complexity 106 (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.
  • flow_typing_flow_js::default_resolve::default_resolve_touts (cyclomatic 70) rust_port/crates/flow_typing_flow_js/src/default_resolve.rs:68 — flow_typing_flow_js::default_resolve::default_resolve_touts has cyclomatic complexity 70 (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.
  • flow_typing_flow_js::implicit_instantiation::t_of_use_t (cyclomatic 61) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:384 — flow_typing_flow_js::implicit_instantiation::t_of_use_t has cyclomatic complexity 61 (threshold 15). Of this number, 55 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
  • flow_typing_flow_js::subtyping_kit::flow_obj_to_obj (cyclomatic 60) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1804 — flow_typing_flow_js::subtyping_kit::flow_obj_to_obj has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_typing_flow_js::flow_js::eval_helpers::eval_destructor (cyclomatic 59) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:445 — flow_typing_flow_js::flow_js::eval_helpers::eval_destructor has cyclomatic complexity 59 (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.
  • flow_typing_flow_js::flow_js::helpers::handle_generic (cyclomatic 54) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:481 — flow_typing_flow_js::flow_js::helpers::handle_generic 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.
  • flow_typing_flow_js::flow_js::unification_helpers::__unify_inner (cyclomatic 50) rust_port/crates/flow_typing_flow_js/src/flow_js/unification_helpers.rs:168 — flow_typing_flow_js::flow_js::unification_helpers::__unify_inner has cyclomatic complexity 50 (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.
  • flow_typing_flow_js::object_kit::run_with_env (cyclomatic 44) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:563 — flow_typing_flow_js::object_kit::run_with_env has cyclomatic complexity 44 (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.
  • flow_typing_flow_js::slice_utils::resolve_with_env (cyclomatic 39) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2314 — flow_typing_flow_js::slice_utils::resolve_with_env has cyclomatic complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_typing_flow_js::slice_utils::spread2 (cyclomatic 37) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:517 — flow_typing_flow_js::slice_utils::spread2 has cyclomatic complexity 37 (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.
  • flow_typing_flow_js::slice_utils::map_object (cyclomatic 37) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:3359 — flow_typing_flow_js::slice_utils::map_object 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.
  • flow_typing_flow_js::flow_js::inheritance_helpers::inst_structural_subtype (cyclomatic 35) rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:233 — flow_typing_flow_js::flow_js::inheritance_helpers::inst_structural_subtype 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.
  • flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::finish_array (cyclomatic 34) rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:743 — flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::finish_array has cyclomatic complexity 34 (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 shape REPEATS in the file: one other method here (flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::flatten_spread_args) 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.
  • flow_typing_flow_js::flow_js::eval_helpers::mk_possibly_evaluated_destructor_for_annotations (cyclomatic 33) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1477 — flow_typing_flow_js::flow_js::eval_helpers::mk_possibly_evaluated_destructor_for_annotations 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.
  • flow_typing_flow_js::flow_js::helpers::reposition::recurse (cyclomatic 32) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:2035 — flow_typing_flow_js::flow_js::helpers::reposition::recurse 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.
  • flow_typing_flow_js::react_kit::run_with_env (cyclomatic 31) rust_port/crates/flow_typing_flow_js/src/react_kit.rs:741 — flow_typing_flow_js::react_kit::run_with_env has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (tin_to_props, create_element, config_check, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_flow_js::template_literal_type::is_number_text (cyclomatic 26) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:127 — flow_typing_flow_js::template_literal_type::is_number_text 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.
  • flow_typing_flow_js::slice_utils::object_rest_with_env (cyclomatic 25) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1355 — flow_typing_flow_js::slice_utils::object_rest_with_env 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.
  • flow_typing_flow_js::flow_js::any_helpers::any_propagated (cyclomatic 24) rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:366 — flow_typing_flow_js::flow_js::any_helpers::any_propagated 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.
  • flow_typing_flow_js::implicit_instantiation::kit::run_conditional (cyclomatic 22) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3771 — flow_typing_flow_js::implicit_instantiation::kit::run_conditional 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.
  • flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::flatten_spread_args (cyclomatic 21) rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:567 — flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::flatten_spread_args 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. This shape REPEATS in the file: one other method here (flow_typing_flow_js::flow_js::multi_arg_helpers::finish_resolve_spread_list::finish_array) 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.
  • flow_typing_flow_js::implicit_instantiation::walk::pin (cyclomatic 21) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:7077 — flow_typing_flow_js::implicit_instantiation::walk::pin 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. This is NOT this file's highest cyclomatic complexity: Walker::head_at (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_js::implicit_instantiation::walk::key_markers_seen (cyclomatic 20) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5958 — flow_typing_flow_js::implicit_instantiation::walk::key_markers_seen has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. 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: Walker::head_at (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • + 14 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×39
  • ClassTooLong: NameResolver rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1734 — ClassTooLong — 7247 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 174 methods, 4 blocks, lines 1734-12028. The bar is 400 significant lines; this is 6847 over it, 18.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: ErrorMessage rust_port/crates/flow_typing_errors/src/error_message.rs:3526 — ClassTooLong — 6831 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 5 blocks, lines 3526-13680. The bar is 400 significant lines; this is 6431 over it, 17.08× 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: AstVisitor rust_port/crates/flow_parser/src/ast_visitor.rs:135 — ClassTooLong — 4112 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 674 methods. The bar is 400 significant lines; this is 3712 over it, 10.28× 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: DefFinder rust_port/crates/flow_env_builder/src/name_def.rs:1724 — ClassTooLong — 4073 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 3 blocks, lines 1724-7304. The bar is 400 significant lines; this is 3673 over it, 10.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: ScopeId rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1024 — ClassTooLong — 3687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods. The bar is 400 significant lines; this is 3287 over it, 9.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: Walker rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:552 — ClassTooLong — 3529 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 120 methods, 2 blocks, lines 552-5932. The bar is 400 significant lines; this is 3129 over it, 8.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Serializer rust_port/crates/flow_parser_wasm/src/serializer.rs:57 — ClassTooLong — 2946 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 168 methods, 2 blocks, lines 57-4561. The bar is 400 significant lines; this is 2546 over it, 7.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.
  • ClassTooLong: Context rust_port/crates/flow_typing_context/src/lib.rs:878 — ClassTooLong — 1457 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 290 methods, 3 blocks, lines 878-3680. The bar is 400 significant lines; this is 1057 over it, 3.64× 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: SsaBuilder rust_port/crates/flow_analysis/src/ssa_builder.rs:478 — ClassTooLong — 1192 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 4 blocks, lines 478-2298. The bar is 400 significant lines; this is 792 over it, 2.98× 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: ProcessRequestSearcher rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:346 — ClassTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 346-1680. The bar is 400 significant lines; this is 574 over it, 2.44× 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: TyIter2Ty rust_port/crates/flow_common_ty/src/ty.rs:1720 — ClassTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods. The bar is 400 significant lines; this is 454 over it, 2.14× 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: Serializer rust_port/crates/flow_common_ty/src/ty_serializer.rs:160 — ClassTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods. The bar is 400 significant lines; this is 439 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Searcher rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:193 — ClassTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 4 blocks, lines 193-1335. The bar is 400 significant lines; this is 415 over it, 2.04× 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: ParseError rust_port/crates/flow_parser/src/parse_error.rs:94 — ClassTooLong — 808 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 94-1195. The bar is 400 significant lines; this is 408 over it, 2.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FlowJs rust_port/crates/flow_typing_flow_js/src/flow_js.rs:232 — ClassTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 74 methods, 2 blocks, lines 234-1213. The bar is 400 significant lines; this is 398 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UseVisitor rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:244 — ClassTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 3 blocks, lines 244-1438. The bar is 400 significant lines; this is 397 over it, 1.99× 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: MatchLowerer rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:102 — ClassTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 102-1191. The bar is 400 significant lines; this is 389 over it, 1.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: UseTInner rust_port/crates/flow_typing_type/src/type_.rs:3157 — ClassTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 7 blocks, lines 3157-4094. The bar is 400 significant lines; this is 376 over it, 1.94× 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: Transaction rust_port/crates/flow_heap/src/transaction.rs:57 — ClassTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 138 methods, 4 blocks, lines 57-1805. The bar is 400 significant lines; this is 350 over it, 1.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ComponentLowerer rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:45 — ClassTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 3 blocks, lines 45-981. The bar is 400 significant lines; this is 275 over it, 1.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Annot rust_port/crates/flow_type_sig/src/type_sig.rs:2263 — ClassTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 3 blocks, lines 2263-3110. The bar is 400 significant lines; this is 275 over it, 1.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PropertyAssignment rust_port/crates/flow_analysis/src/property_assignment.rs:116 — ClassTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 3 blocks, lines 116-945. The bar is 400 significant lines; this is 221 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TyEndoTy rust_port/crates/flow_common_ty/src/ty.rs:3305 — ClassTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods. The bar is 400 significant lines; this is 210 over it, 1.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.
  • ClassTooLong: SelectionRangeFinder rust_port/crates/flow_lsp_server/src/selection_range_provider.rs:26 — ClassTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 3 blocks, lines 26-892. The bar is 400 significant lines; this is 200 over it, 1.50× 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: FunctionBase packages/flow-api-translator/src/utils/ts-estree-ast-types.js:478 — ClassTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 196 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 14 more in this group — see findings.md.
D2 · Cognitive Complexity · flow_typing_statement · ×36
  • flow_typing_statement::statement::mk_class_sig (cognitive 353) rust_port/crates/flow_typing_statement/src/statement.rs:15438 — flow_typing_statement::statement::mk_class_sig has cognitive complexity 353 (threshold 15). Drivers by points: if/else 62 (184 pts), match/switch 48 (152 pts), boolean chains 13, loops 2 (4 pts) (nesting depth added 228). Of this number, 318 points are the body's own statements and 35 belong to 3 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.
  • flow_typing_statement::type_annotation::add_interface_properties (cognitive 321) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7266 — flow_typing_statement::type_annotation::add_interface_properties has cognitive complexity 321 (threshold 15). Drivers by points: if/else 58 (197 pts), match/switch 22 (109 pts), boolean chains 13, loops 2 (nesting depth added 226). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • flow_typing_statement::type_annotation::convert_inner (cognitive 235) rust_port/crates/flow_typing_statement/src/type_annotation.rs:1143 — flow_typing_statement::type_annotation::convert_inner has cognitive complexity 235 (threshold 15). Drivers by points: match/switch 38 (115 pts), if/else 33 (84 pts), boolean chains 22, loops 7 (14 pts) (nesting depth added 135). 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.
  • flow_typing_statement::statement::statement_ (cognitive 226) rust_port/crates/flow_typing_statement/src/statement.rs:2275 — flow_typing_statement::statement::statement_ has cognitive complexity 226 (threshold 15). Drivers by points: match/switch 46 (111 pts), if/else 44 (91 pts), boolean chains 18, loops 3 (6 pts) (nesting depth added 115). 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.
  • flow_typing_statement::statement::expression_ (cognitive 178) rust_port/crates/flow_typing_statement/src/statement.rs:6775 — flow_typing_statement::statement::expression_ has cognitive complexity 178 (threshold 15). Drivers by points: match/switch 30 (77 pts), if/else 27 (71 pts), boolean chains 19, loops 4 (11 pts) (nesting depth added 98). 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.
  • flow_typing_statement::module_info_analyzer::visit_toplevel_statement (cognitive 135) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:410 — flow_typing_statement::module_info_analyzer::visit_toplevel_statement has cognitive complexity 135 (threshold 15). Drivers by points: if/else 30 (87 pts), match/switch 14 (37 pts), loops 2 (7 pts), boolean chains 4 (nesting depth added 85). 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.
  • flow_typing_statement::statement::optional_chain (cognitive 110) rust_port/crates/flow_typing_statement/src/statement.rs:8699 — flow_typing_statement::statement::optional_chain has cognitive complexity 110 (threshold 15). Drivers by points: match/switch 32 (61 pts), if/else 18 (35 pts), boolean chains 10, loops 4 (nesting depth added 46). Of this number, 90 points are the body's own statements and 20 belong to 5 function items inside it that branch. 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.
  • flow_typing_statement::type_annotation::convert_object (cognitive 70) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4401 — flow_typing_statement::type_annotation::convert_object has cognitive complexity 70 (threshold 15). Drivers by points: if/else 42 (80 pts), match/switch 22 (50 pts), boolean chains 9, loops 1 (nesting depth added 66). To reduce it, split the body into named stages: move each independent 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 (flow_typing_statement::type_annotation::convert_object::named_property) 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.
  • flow_typing_statement::type_annotation::convert_object::named_property (cognitive 58) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4616 — flow_typing_statement::type_annotation::convert_object::named_property has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 9 (21 pts), boolean chains 4 (nesting depth added 30). 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. This shape REPEATS in the file: one other method here (flow_typing_statement::type_annotation::convert_object) 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.
  • flow_typing_statement::statement::mk_func_sig (cognitive 48) rust_port/crates/flow_typing_statement/src/statement.rs:20245 — flow_typing_statement::statement::mk_func_sig has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 17 (22 pts), if/else 16 (20 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 34 points are the body's own statements and 14 belong to 5 function items inside it that branch. 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.
  • flow_typing_statement::switch_to_match::convert_switch_inner (cognitive 46) rust_port/crates/flow_typing_statement/src/switch_to_match.rs:220 — flow_typing_statement::switch_to_match::convert_switch_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 5 (11 pts), boolean chains 9, loops 1 (nesting depth added 16). Of this number, 45 points are the body's own statements and 1 belongs 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.
  • flow_typing_statement::class_sig::check_override_side (cognitive 43) rust_port/crates/flow_typing_statement/src/class_sig.rs:2206 — flow_typing_statement::class_sig::check_override_side has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 2 (9 pts), loops 3 (7 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.
  • flow_typing_statement::func_sig::toplevels (cognitive 43) rust_port/crates/flow_typing_statement/src/func_sig.rs:477 — flow_typing_statement::func_sig::toplevels has cognitive complexity 43 (threshold 15). Drivers by points: match/switch 14 (25 pts), if/else 10 (17 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_statement::class_sig::elements (cognitive 42) rust_port/crates/flow_typing_statement/src/class_sig.rs:810 — flow_typing_statement::class_sig::elements has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 9 (10 pts), match/switch 3 (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.
  • flow_typing_statement::statement::mk_record_sig (cognitive 41) rust_port/crates/flow_typing_statement/src/statement.rs:18949 — flow_typing_statement::statement::mk_record_sig has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 10 (29 pts), if/else 3 (9 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_statement::statement::create_computed_prop (cognitive 40) rust_port/crates/flow_typing_statement/src/statement.rs:5707 — flow_typing_statement::statement::create_computed_prop has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 8 (20 pts), if/else 6 (13 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 20). 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.
  • flow_typing_statement::class_sig::merge_tparam_polarities (cognitive 35) rust_port/crates/flow_typing_statement/src/class_sig.rs:2455 — flow_typing_statement::class_sig::merge_tparam_polarities has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (8 pts), loops 2 (6 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.
  • flow_typing_statement::type_annotation::binding_kind_of_generic_id_post_convert (cognitive 35) rust_port/crates/flow_typing_statement/src/type_annotation.rs:6697 — flow_typing_statement::type_annotation::binding_kind_of_generic_id_post_convert has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 11 (29 pts), if/else 4 (6 pts) (nesting depth added 20). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_typing_statement::class_sig::post_inference_check_abstract_obligations (cognitive 33) rust_port/crates/flow_typing_statement/src/class_sig.rs:1777 — flow_typing_statement::class_sig::post_inference_check_abstract_obligations has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 5 (13 pts), loops 6 (10 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 16). Of this number, 27 points are the body's own statements and 6 belong to 2 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.
  • flow_typing_statement::module_info_analyzer::export_specifiers (cognitive 31) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:195 — flow_typing_statement::module_info_analyzer::export_specifiers has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 13 (22 pts), if/else 4 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). 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.
  • flow_typing_statement::class_sig::collect_inherited_members_both_sides (cognitive 30) rust_port/crates/flow_typing_statement/src/class_sig.rs:2019 — flow_typing_statement::class_sig::collect_inherited_members_both_sides has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (14 pts), match/switch 5 (9 pts), if/else 5 (7 pts) (nesting depth added 14). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 3 function items inside it that branch (visit_static_concrete, walk_one, walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_statement::type_annotation::convert_return_annotation_inner (cognitive 30) rust_port/crates/flow_typing_statement/src/type_annotation.rs:5806 — flow_typing_statement::type_annotation::convert_return_annotation_inner has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 4 (7 pts), boolean chains 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.
  • flow_typing_statement::statement::object_prop (cognitive 29) rust_port/crates/flow_typing_statement/src/statement.rs:5319 — flow_typing_statement::statement::object_prop has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 11 (20 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_statement::statement::variable (cognitive 29) rust_port/crates/flow_typing_statement/src/statement.rs:6184 — flow_typing_statement::statement::variable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 7 (9 pts), boolean chains 2 (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.
  • flow_typing_statement::statement::op_assignment (cognitive 29) rust_port/crates/flow_typing_statement/src/statement.rs:12335 — flow_typing_statement::statement::op_assignment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 7 (14 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.
  • + 11 more in this group — see findings.md.
D1 · Cyclomatic Complexity · flow_typing_statement · ×34
  • flow_typing_statement::type_annotation::convert_inner (cyclomatic 199) rust_port/crates/flow_typing_statement/src/type_annotation.rs:1143 — flow_typing_statement::type_annotation::convert_inner has cyclomatic complexity 199 (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.
  • flow_typing_statement::statement::statement_ (cyclomatic 183) rust_port/crates/flow_typing_statement/src/statement.rs:2275 — flow_typing_statement::statement::statement_ has cyclomatic complexity 183 (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.
  • flow_typing_statement::statement::mk_class_sig (cyclomatic 144) rust_port/crates/flow_typing_statement/src/statement.rs:15438 — flow_typing_statement::statement::mk_class_sig has cyclomatic complexity 144 (threshold 15). Of this number, 121 points are the body's own statements and 23 belong to 3 function items 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.
  • flow_typing_statement::statement::expression_ (cyclomatic 136) rust_port/crates/flow_typing_statement/src/statement.rs:6775 — flow_typing_statement::statement::expression_ has cyclomatic complexity 136 (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.
  • flow_typing_statement::type_annotation::add_interface_properties (cyclomatic 93) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7266 — flow_typing_statement::type_annotation::add_interface_properties has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_typing_statement::statement::optional_chain (cyclomatic 89) rust_port/crates/flow_typing_statement/src/statement.rs:8699 — flow_typing_statement::statement::optional_chain has cyclomatic complexity 89 (threshold 15). Of this number, 73 points are the body's own statements and 16 belong to 5 function items inside it that branch. 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.
  • flow_typing_statement::module_info_analyzer::visit_toplevel_statement (cyclomatic 84) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:410 — flow_typing_statement::module_info_analyzer::visit_toplevel_statement has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_typing_statement::statement::mk_func_sig (cyclomatic 48) rust_port/crates/flow_typing_statement/src/statement.rs:20245 — flow_typing_statement::statement::mk_func_sig has cyclomatic complexity 48 (threshold 15). Of this number, 31 points are the body's own statements and 17 belong to 5 function items inside it that branch. 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.
  • flow_typing_statement::type_annotation::convert_object (cyclomatic 44) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4401 — flow_typing_statement::type_annotation::convert_object 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. This shape REPEATS in the file: one other method here (flow_typing_statement::type_annotation::convert_object::named_property) 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.
  • flow_typing_statement::func_sig::toplevels (cyclomatic 36) rust_port/crates/flow_typing_statement/src/func_sig.rs:477 — flow_typing_statement::func_sig::toplevels 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.
  • flow_typing_statement::switch_to_match::convert_switch_inner (cyclomatic 32) rust_port/crates/flow_typing_statement/src/switch_to_match.rs:220 — flow_typing_statement::switch_to_match::convert_switch_inner has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_typing_statement::type_annotation::convert_object::named_property (cyclomatic 31) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4616 — flow_typing_statement::type_annotation::convert_object::named_property 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 shape REPEATS in the file: one other method here (flow_typing_statement::type_annotation::convert_object) 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.
  • flow_typing_statement::class_sig::elements (cyclomatic 29) rust_port/crates/flow_typing_statement/src/class_sig.rs:810 — flow_typing_statement::class_sig::elements 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.
  • flow_typing_statement::statement::create_computed_prop (cyclomatic 27) rust_port/crates/flow_typing_statement/src/statement.rs:5707 — flow_typing_statement::statement::create_computed_prop 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.
  • flow_typing_statement::type_annotation::binding_kind_of_generic_id_post_convert (cyclomatic 27) rust_port/crates/flow_typing_statement/src/type_annotation.rs:6697 — flow_typing_statement::type_annotation::binding_kind_of_generic_id_post_convert has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_typing_statement::statement::object_prop (cyclomatic 26) rust_port/crates/flow_typing_statement/src/statement.rs:5319 — flow_typing_statement::statement::object_prop 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.
  • flow_typing_statement::statement::static_method_call_object (cyclomatic 26) rust_port/crates/flow_typing_statement/src/statement.rs:14415 — flow_typing_statement::statement::static_method_call_object 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.
  • flow_typing_statement::react_rules::downstream_effects (cyclomatic 25) rust_port/crates/flow_typing_statement/src/react_rules.rs:643 — flow_typing_statement::react_rules::downstream_effects has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 3 function items inside it that branch. 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: flow_typing_statement::react_rules::hook_callee::recur_id (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_statement::module_info_analyzer::export_specifiers (cyclomatic 22) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:195 — flow_typing_statement::module_info_analyzer::export_specifiers has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • flow_typing_statement::statement::check_super_abstract (cyclomatic 22) rust_port/crates/flow_typing_statement/src/statement.rs:6653 — flow_typing_statement::statement::check_super_abstract has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (walk_one, walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_statement::class_sig::post_inference_check_abstract_obligations (cyclomatic 21) rust_port/crates/flow_typing_statement/src/class_sig.rs:1777 — flow_typing_statement::class_sig::post_inference_check_abstract_obligations has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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.
  • flow_typing_statement::class_sig::collect_inherited_members_both_sides (cyclomatic 21) rust_port/crates/flow_typing_statement/src/class_sig.rs:2019 — flow_typing_statement::class_sig::collect_inherited_members_both_sides has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (walk_one, visit_static_concrete, walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_statement::match_pattern::pattern_ (cyclomatic 21) rust_port/crates/flow_typing_statement/src/match_pattern.rs:466 — flow_typing_statement::match_pattern::pattern_ 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.
  • flow_typing_statement::react_rules::is_initializing (cyclomatic 21) rust_port/crates/flow_typing_statement/src/react_rules.rs:825 — flow_typing_statement::react_rules::is_initializing has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (refines_safe, not_refines_safe, is_nullish). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_typing_statement::react_rules::hook_callee::recur_id (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_statement::statement::mk_enum (cyclomatic 21) rust_port/crates/flow_typing_statement/src/statement.rs:21799 — flow_typing_statement::statement::mk_enum 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×34
  • Duplicated block (16 lines × 2) rust_port/crates/flow_parser/src/flow_lexer.rs:713 — rust_port/crates/flow_parser/src/flow_lexer.rs:713-728 | rust_port/crates/flow_parser/src/flow_lexer.rs:730-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:713` 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) rust_port/crates/flow_parser/src/flow_lexer.rs:926 — rust_port/crates/flow_parser/src/flow_lexer.rs:926-941 | rust_port/crates/flow_parser/src/flow_lexer.rs:992-1007 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/parser_env.rs:1926 — rust_port/crates/flow_parser/src/parser_env.rs:1926-1941 | rust_port/crates/flow_parser/src/parser_env.rs:2014-2029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/parser_env.rs:1926` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/parser_env.rs:2393 — rust_port/crates/flow_parser/src/parser_env.rs:2393-2408 | rust_port/crates/flow_parser/src/parser_env.rs:2411-2426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/parser_env.rs:2393` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3769 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3769-3784 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5692-5707 — both copies are in the same file, so extract the 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 (16 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:3753 — rust_port/crates/flow_parser/src/statement_parser.rs:3753-3768 | rust_port/crates/flow_parser/src/statement_parser.rs:3774-3789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3753` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/type_parser.rs:3793 — rust_port/crates/flow_parser/src/type_parser.rs:3793-3808 | rust_port/crates/flow_parser/src/type_parser.rs:3820-3835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:3793` 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5354 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5354-5369 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5378-5393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5354` 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 `t1` to `&ast::types::Union<Loc, Loc>` in one and `&ast::types::Intersection<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1159 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1159-1174 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1203-1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs: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.
  • Duplicated block (16 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:2766 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2766-2781 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2794-2809 — both copies are in the same file, so extract the 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 (16 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:4214 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:4214-4229 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4272-4287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4214` it does not close everything it opens, so those 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, `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4230` calls `map_err` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4288` 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 (16 lines × 2) rust_port/crates/flow_services_code_action/src/code_action_service.rs:3254 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:3254-3269 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:3295-3310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/code_action_service.rs:3254` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:228 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:228-243 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:288-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:374 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:374-389 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:392-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.
  • Duplicated block (16 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1078 — rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1078-1093 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1151-1166 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1150` calls `collect` and `rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1077` 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 × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2930 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2930-2945 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3131-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 `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2930` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3304 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3304-3319 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3355-3370 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:957 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:957-972 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:6363-6378 — 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 (16 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8532 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8532-8547 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8563-8578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8532` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886-9901 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9907-9922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:773 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:773-788 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:803-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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:773` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1930 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1930-1945 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2041-2056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1930` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/get_prop_helpers.rs:457 — rust_port/crates/flow_typing_flow_js/src/flow_js/get_prop_helpers.rs:457-472 | rust_port/crates/flow_typing_flow_js/src/flow_js/get_prop_helpers.rs:474-489 — both copies are in the same file, so extract the 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 (16 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1729 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1729-1744 | rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:2389-2404 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:452 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:452-467 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:471-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:452` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×33
  • Duplicated block (15 lines × 2) rust_port/crates/flow_cli/src/apply_code_action_command.rs:125 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:125-139 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:228-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 `rust_port/crates/flow_cli/src/apply_code_action_command.rs:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_cli/src/lib.rs:110 — rust_port/crates/flow_cli/src/lib.rs:110-124 | rust_port/crates/flow_cli/src/lib.rs:192-206 — both copies are in the same file, so extract the 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 `args` to `&flow_server_monitor::DaemonizeArgs` in one and `&flow_server::server_daemon::ServerDaemonArgs` 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) rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:272 — rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:272-286 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:307-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. 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) rust_port/crates/flow_config/src/flowconfig.rs:1457 — rust_port/crates/flow_config/src/flowconfig.rs:1457-1471 | rust_port/crates/flow_config/src/flowconfig.rs:1495-1509 — both copies are in the same file, so extract the 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 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2792 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2792-2806 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3086-3100 — both copies are in the same file, so extract the 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3748 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3748-3762 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3806-3820 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3821` calls `check_static_type_param_read` and `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3763` 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8537 — rust_port/crates/flow_parser/src/ast_visitor.rs:8537-8551 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:753-767 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_typing/src/typed_ast_finder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13487 — rust_port/crates/flow_parser/src/ast_visitor.rs:13487-13501 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1750-1764 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_typing/src/typed_ast_finder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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) rust_port/crates/flow_parser/src/expression_parser.rs:2660 — rust_port/crates/flow_parser/src/expression_parser.rs:2660-2674 | rust_port/crates/flow_parser/src/type_parser.rs:1030-1044 — before extracting anything, compare `rust_port/crates/flow_parser/src/expression_parser.rs` and `rust_port/crates/flow_parser/src/type_parser.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 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 `rust_port/crates/flow_parser/src/expression_parser.rs:2660` 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) rust_port/crates/flow_parser/src/statement_parser.rs:3043 — rust_port/crates/flow_parser/src/statement_parser.rs:3043-3057 | rust_port/crates/flow_parser/src/statement_parser.rs:3099-3113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3043` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:4613 — rust_port/crates/flow_parser/src/statement_parser.rs:4613-4627 | rust_port/crates/flow_parser/src/statement_parser.rs:4631-4645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:4613` 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6617 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6617-6631 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6638-6652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6617` it does not close everything it opens, so those 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, `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6653` calls `atom` and `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6632` 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:2620 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2620-2634 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3295-3309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:2620` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:680 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:680-694 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:766-780 — before extracting anything, compare `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs` and `rust_port/crates/flow_services_code_action/src/autofix_imports.rs` 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 `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:680` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:851 — rust_port/crates/flow_services_get_def/src/get_def_utils.rs:851-865 | rust_port/crates/flow_services_get_def/src/get_def_utils.rs:886-900 — both copies are in the same file, so extract the 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2642 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2642-2656 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2662-2676 — both copies are in the same file, so extract the 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3477 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3477-3491 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5160-5174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3477` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing/src/merge.rs:1115 — rust_port/crates/flow_typing/src/merge.rs:1115-1129 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:882-896 — 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 `rust_port/crates/flow_typing/src/merge.rs:1115` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5528 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5528-5542 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9427-9441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5528` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6649 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6649-6663 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6666-6680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6649` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4127 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4127-4141 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4171-4185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4127` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:603 — rust_port/crates/flow_typing_flow_js/src/object_kit.rs:603-617 | rust_port/crates/flow_typing_flow_js/src/object_kit.rs:716-730 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:436 — rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:436-450 | rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:494-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:436` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:602 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:602-616 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:624-638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:602` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:8750 — rust_port/crates/flow_typing_statement/src/statement.rs:8750-8764 | rust_port/crates/flow_typing_statement/src/statement.rs:8779-8793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:8750` 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×31
  • Edited copy of a member (10 corresponding lines) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:578 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:578-587 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:663-675 — 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) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:437 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:437-446 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:610-623 — 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) rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:240 — rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:240-249 | rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:303-312 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:2981 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:2981-2992 | rust_port/crates/flow_server_env/src/persistent_connection.rs:66-75 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7783 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7783-7794 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7803-7812 — 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) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:6070 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:6070-6079 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:6108-6126 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:2994 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:2994-3003 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3005-3014 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1844 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1844-1853 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1859-1868 — 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) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:673 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:673-682 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:693-702 — 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:567 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:567-576 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1396-1406 — 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) rust_port/crates/flow_services_code_action/src/insert_type.rs:155 — rust_port/crates/flow_services_code_action/src/insert_type.rs:155-164 | rust_port/crates/flow_services_code_action/src/insert_type.rs:169-178 — 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) rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:90 — rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:90-100 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:106-115 — 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) rust_port/crates/flow_parser/src/comment_attachment.rs:1507 — rust_port/crates/flow_parser/src/comment_attachment.rs:1507-1516 | rust_port/crates/flow_parser/src/comment_attachment.rs:1520-1529 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14489 — rust_port/crates/flow_parser/src/ast_visitor.rs:14489-14498 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1305-1314 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15659 — rust_port/crates/flow_parser/src/ast_visitor.rs:15659-15672 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1924-1933 — 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) rust_port/crates/flow_heap/src/heap_state.rs:912 — rust_port/crates/flow_heap/src/heap_state.rs:912-921 | rust_port/crates/flow_heap/src/heap_state.rs:930-939 — 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) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:355 — rust_port/crates/flow_services_get_def/src/get_def_utils.rs:355-365 | rust_port/crates/flow_services_references/src/property_find_refs.rs:119-128 — 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) rust_port/crates/flow_aloc/src/lib.rs:120 — rust_port/crates/flow_aloc/src/lib.rs:120-129 | rust_port/crates/flow_aloc/src/lib.rs:133-142 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:1779 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1779-1788 | rust_port/crates/flow_parser_wasm/src/serializer.rs:1793-1802 — 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) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:326 — rust_port/crates/flow_services_get_def/src/get_def_utils.rs:326-335 | rust_port/crates/flow_services_references/src/property_find_refs.rs:104-113 — 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) rust_port/crates/flow_typing/src/env_resolution.rs:102 — rust_port/crates/flow_typing/src/env_resolution.rs:102-111 | rust_port/crates/flow_typing_utils/src/members.rs:801-817 — 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) rust_port/crates/flow_analysis/src/hoister.rs:60 — rust_port/crates/flow_analysis/src/hoister.rs:60-69 | rust_port/crates/flow_analysis/src/hoister.rs:71-80 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13334 — rust_port/crates/flow_parser/src/ast_visitor.rs:13334-13343 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4869-4878 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:159 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:159-168 | rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:172-181 — 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) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:377 — rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:377-390 | rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:428-437 — 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×28
  • Duplicated block (17 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:847 — rust_port/crates/flow_analysis/src/scope_builder.rs:847-863 | rust_port/crates/flow_analysis/src/scope_builder.rs:879-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_analysis/src/scope_builder.rs:847` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_cli/src/codemod_command.rs:437 — rust_port/crates/flow_cli/src/codemod_command.rs:437-453 | rust_port/crates/flow_cli/src/codemod_command.rs:707-723 — both copies are in the same file, so extract the 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) rust_port/crates/flow_codemods/src/annotate_exports.rs:333 — rust_port/crates/flow_codemods/src/annotate_exports.rs:333-349 | rust_port/crates/flow_codemods/src/annotate_exports.rs:372-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) rust_port/crates/flow_common/src/lock.rs:64 — rust_port/crates/flow_common/src/lock.rs:64-80 | rust_port/crates/flow_common/src/lock.rs:98-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common/src/lock.rs:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) rust_port/crates/flow_lsp/src/lsp_fmt.rs:1270 — rust_port/crates/flow_lsp/src/lsp_fmt.rs:1270-1286 | rust_port/crates/flow_lsp/src/lsp_fmt.rs:1357-1373 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_lsp/src/lsp_fmt.rs:1356` calls `CodeLensResolveRequest` and `rust_port/crates/flow_lsp/src/lsp_fmt.rs:1269` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:311 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:311-327 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:344-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 `rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:311` 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 × 2) rust_port/crates/flow_services_autocomplete/src/lsp_import_edits.rs:44 — rust_port/crates/flow_services_autocomplete/src/lsp_import_edits.rs:44-60 | rust_port/crates/flow_services_autocomplete/src/lsp_import_edits.rs:229-245 — both copies are in the same file, so extract the 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) rust_port/crates/flow_services_code_action/src/refactor_extract.rs:701 — rust_port/crates/flow_services_code_action/src/refactor_extract.rs:701-717 | rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1004-1020 — both copies are in the same file, so extract the 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) rust_port/crates/flow_type_sig/src/type_sig.rs:2748 — rust_port/crates/flow_type_sig/src/type_sig.rs:2748-2764 | rust_port/crates/flow_type_sig/src/type_sig.rs:2767-2783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig.rs:2748` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_pack.rs:929 — rust_port/crates/flow_type_sig/src/type_sig_pack.rs:929-945 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1064-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_pack.rs:929` 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, `rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1081` calls `namespace_member_polarity` and `rust_port/crates/flow_type_sig/src/type_sig_pack.rs:946` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12645 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12645-12661 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12688-12704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12645` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1048 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1048-1064 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1104-1120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1048` 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 × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3541 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3541-3557 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3577-3593 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:237 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:237-253 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:298-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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs: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.
  • Duplicated block (17 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:224 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:224-240 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:242-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:224` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:763 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:763-779 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:834-850 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2794 — rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2794-2810 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2858-2874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2794` 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) rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:54 — rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:54-70 | rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:156-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) rust_port/crates/flow_typing_statement/src/class_sig.rs:590 — rust_port/crates/flow_typing_statement/src/class_sig.rs:590-606 | rust_port/crates/flow_typing_statement/src/class_sig.rs:631-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:590` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/react_rules.rs:1725 — rust_port/crates/flow_typing_statement/src/react_rules.rs:1725-1741 | rust_port/crates/flow_typing_statement/src/react_rules.rs:2102-2118 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7929 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:7929-7945 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8299-8315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:7929` 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:8367 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:8367-8383 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8429-8445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:8367` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/exhaustive.rs:2561 — rust_port/crates/flow_typing_utils/src/exhaustive.rs:2561-2577 | rust_port/crates/flow_typing_utils/src/exhaustive.rs:2602-2618 — both copies are in the same file, so extract the 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) rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:473 — rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:473-489 | rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:590-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 `rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:473` 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) rust_port/crates/flow_watchman/src/lib.rs:650 — rust_port/crates/flow_watchman/src/lib.rs:650-666 | rust_port/crates/flow_watchman/src/lib.rs:696-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_watchman/src/lib.rs:650` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · flow_type_sig · ×27
  • flow_type_sig::type_sig_parse::class_def (cognitive 102) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11788 — flow_type_sig::type_sig_parse::class_def has cognitive complexity 102 (threshold 15). Drivers by points: if/else 17 (46 pts), match/switch 13 (41 pts), boolean chains 12, loops 2 (3 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_type_sig::type_sig_parse::expression (cognitive 91) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:10357 — flow_type_sig::type_sig_parse::expression has cognitive complexity 91 (threshold 15). Drivers by points: if/else 20 (61 pts), match/switch 11 (28 pts), boolean chains 2 (nesting depth added 58). 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.
  • flow_type_sig::type_sig_parse::maybe_special_unqualified_generic (cognitive 64) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9366 — flow_type_sig::type_sig_parse::maybe_special_unqualified_generic has cognitive complexity 64 (threshold 15). Drivers by points: match/switch 29 (57 pts), if/else 3 (4 pts), boolean chains 3 (nesting depth added 29). 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.
  • flow_type_sig::type_sig_parse::statement (cognitive 61) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14848 — flow_type_sig::type_sig_parse::statement has cognitive complexity 61 (threshold 15). Drivers by points: match/switch 12 (27 pts), if/else 10 (24 pts), loops 5 (10 pts) (nesting depth added 34). Of this number, 60 points are the body's own statements and 1 belongs 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.
  • flow_type_sig::type_sig_parse::interface_props (cognitive 43) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8483 — flow_type_sig::type_sig_parse::interface_props has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 5 (8 pts), boolean chains 1, loops 1 (nesting depth added 21). Of this number, 19 points are the body's own statements and 24 belong to 3 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.
  • flow_type_sig::type_sig_parse::scope::finalize_declare_module_exports_exn (cognitive 42) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4753 — flow_type_sig::type_sig_parse::scope::finalize_declare_module_exports_exn has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 9 (27 pts), loops 6 (15 pts) (nesting depth added 27). 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.
  • flow_type_sig::type_sig_parse::assignment (cognitive 38) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14651 — flow_type_sig::type_sig_parse::assignment has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30 (94 pts), boolean chains 4, match/switch 1 (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. This shape REPEATS in the file: 3 other methods here (flow_type_sig::type_sig_parse::assignment::is_module_exports_assign, flow_type_sig::type_sig_parse::assignment::is_exports_prop_assign, flow_type_sig::type_sig_parse::assignment::is_module_exports_prop_assign) 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.
  • flow_type_sig::type_sig_parse::object_type::object_prop (cognitive 33) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8054 — flow_type_sig::type_sig_parse::object_type::object_prop has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (29 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (flow_type_sig::type_sig_parse::object_type) 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.
  • flow_type_sig::type_sig_parse::scope::bind_interface (cognitive 33) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3440 — flow_type_sig::type_sig_parse::scope::bind_interface has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 9 (16 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_named_prop (cognitive 31) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8841 — flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_named_prop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (30 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. This shape REPEATS in the file: 2 other methods here (flow_type_sig::type_sig_parse::declare_class_props, flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_computed_prop) 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.
  • flow_type_sig::type_sig_mark::mark_local_binding (cognitive 30) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:240 — flow_type_sig::type_sig_mark::mark_local_binding has cognitive complexity 30 (threshold 15). Drivers by points: loops 11 (23 pts), if/else 3 (6 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.
  • flow_type_sig::type_sig_parse::assignment::is_module_exports_prop_assign (cognitive 29) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14717 — flow_type_sig::type_sig_parse::assignment::is_module_exports_prop_assign has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (28 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. This shape REPEATS in the file: 3 other methods here (flow_type_sig::type_sig_parse::assignment, flow_type_sig::type_sig_parse::assignment::is_module_exports_assign, flow_type_sig::type_sig_parse::assignment::is_exports_prop_assign) 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.
  • flow_type_sig::type_sig_parse::declare_class_props (cognitive 27) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8793 — flow_type_sig::type_sig_parse::declare_class_props has cognitive complexity 27 (threshold 15). Drivers by points: if/else 29 (65 pts), match/switch 6 (10 pts), loops 2 (3 pts), boolean chains 2 (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. This shape REPEATS in the file: 2 other methods here (flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_named_prop, flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_computed_prop) 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.
  • flow_type_sig::type_sig_parse::object_type (cognitive 26) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8024 — flow_type_sig::type_sig_parse::object_type has cognitive complexity 26 (threshold 15). Drivers by points: if/else 26 (54 pts), match/switch 7 (12 pts), boolean chains 7, 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. This shape REPEATS in the file: one other method here (flow_type_sig::type_sig_parse::object_type::object_prop) 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.
  • flow_type_sig::type_sig_parse::param (cognitive 26) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11198 — flow_type_sig::type_sig_parse::param has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, 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.
  • flow_type_sig::type_sig_parse::scope::merge_namespace_entries (cognitive 23) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5580 — flow_type_sig::type_sig_parse::scope::merge_namespace_entries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 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.
  • flow_type_sig::type_sig_parse::scope::bind_declare_class (cognitive 21) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3716 — flow_type_sig::type_sig_parse::scope::bind_declare_class has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 6 (9 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_type_sig::type_sig_parse::object_literal (cognitive 19) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12512 — flow_type_sig::type_sig_parse::object_literal has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 6 (7 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (prop, spread). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_computed_prop (cognitive 18) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8938 — flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_computed_prop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 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. This shape REPEATS in the file: 2 other methods here (flow_type_sig::type_sig_parse::declare_class_props, flow_type_sig::type_sig_parse::declare_class_props::declare_class_prop::add_named_prop) 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.
  • flow_type_sig::type_sig_parse::scope::export_ref (cognitive 17) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4381 — flow_type_sig::type_sig_parse::scope::export_ref has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 5 (7 pts) (nesting depth added 7). 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.
  • flow_type_sig::type_sig_parse::scope::resolve_declare_namespace_exports (cognitive 17) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5688 — flow_type_sig::type_sig_parse::scope::resolve_declare_namespace_exports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_type_sig::type_sig_parse::conditional_type (cognitive 16) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9773 — flow_type_sig::type_sig_parse::conditional_type has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (3 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.
  • flow_type_sig::type_sig_parse::function_def_helper (cognitive 16) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11483 — flow_type_sig::type_sig_parse::function_def_helper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 4 (7 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.
  • flow_type_sig::type_sig_parse::record_def (cognitive 16) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13452 — flow_type_sig::type_sig_parse::record_def has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_type_sig::type_sig_parse::assignment::is_module_exports_assign (cognitive 16) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14662 — flow_type_sig::type_sig_parse::assignment::is_module_exports_assign has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (15 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. This shape REPEATS in the file: 3 other methods here (flow_type_sig::type_sig_parse::assignment, flow_type_sig::type_sig_parse::assignment::is_exports_prop_assign, flow_type_sig::type_sig_parse::assignment::is_module_exports_prop_assign) 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×26
  • Edited copy of a member (13 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:16428 — rust_port/crates/flow_parser/src/ast_visitor.rs:16428-16446 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2276-2288 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1728 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1728-1740 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1796-1808 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:2937 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2937-2950 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4308-4320 — 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) rust_port/crates/flow_env_builder/src/find_providers.rs:631 — rust_port/crates/flow_env_builder/src/find_providers.rs:631-643 | rust_port/crates/flow_env_builder/src/find_providers.rs:648-660 — 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) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:625 — rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:625-637 | rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:763-775 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14764 — rust_port/crates/flow_parser/src/ast_visitor.rs:14764-14776 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1451-1463 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:16231 — rust_port/crates/flow_parser/src/ast_visitor.rs:16231-16243 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2202-2218 — 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:760 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:760-772 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1821-1834 — 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) rust_port/crates/flow_typing_loc_env/src/loc_env.rs:115 — rust_port/crates/flow_typing_loc_env/src/loc_env.rs:115-128 | rust_port/crates/flow_typing_loc_env/src/loc_env.rs:135-147 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:1205 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1205-1217 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3157-3171 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:649 — rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:649-661 | rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:663-675 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:995 — rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:995-1007 | rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1197-1209 — 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) rust_port/crates/flow_typing_type/src/type_util.rs:2753 — rust_port/crates/flow_typing_type/src/type_util.rs:2753-2765 | rust_port/crates/flow_typing_type/src/type_util.rs:2767-2779 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:806 — rust_port/crates/flow_analysis/src/property_assignment.rs:806-818 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2007-2020 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10171 — rust_port/crates/flow_parser/src/ast_visitor.rs:10171-10183 | rust_port/crates/flow_parser/src/ast_visitor.rs:10259-10272 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9907 — rust_port/crates/flow_parser/src/ast_visitor.rs:9907-9919 | rust_port/crates/flow_parser/src/ast_visitor.rs:17744-17758 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:17896 — rust_port/crates/flow_parser/src/ast_visitor.rs:17896-17908 | rust_port/crates/flow_parser/src/ast_visitor.rs:18750-18763 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8304 — rust_port/crates/flow_parser/src/ast_visitor.rs:8304-8316 | rust_port/crates/flow_parser/src/ast_visitor.rs:17312-17324 — 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) rust_port/crates/flow_analysis/src/hoister.rs:554 — rust_port/crates/flow_analysis/src/hoister.rs:554-567 | rust_port/crates/flow_analysis/src/scope_builder.rs:1913-1925 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13409 — rust_port/crates/flow_parser/src/ast_visitor.rs:13409-13421 | rust_port/crates/flow_parser/src/ast_visitor.rs:14953-14967 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:6805 — rust_port/crates/flow_parser/src/ast_visitor.rs:6805-6817 | rust_port/crates/flow_parser/src/ast_visitor.rs:9483-9496 — 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) rust_port/crates/flow_profiling/src/memory_utils.rs:51 — rust_port/crates/flow_profiling/src/memory_utils.rs:51-66 | rust_port/crates/flow_server/src/server.rs:79-91 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11111 — rust_port/crates/flow_parser/src/ast_visitor.rs:11111-11123 | rust_port/crates/flow_parser/src/ast_visitor.rs:18549-18561 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11730 — rust_port/crates/flow_parser/src/ast_visitor.rs:11730-11742 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1606-1618 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11760 — rust_port/crates/flow_parser/src/ast_visitor.rs:11760-11772 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1623-1635 — 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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×25
  • Edited copy of a member (17 corresponding lines) rust_port/crates/flow_parser_wasm/src/serializer.rs:2080 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2080-2096 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4544-4560 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1127 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1127-1143 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1149-1168 — 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) rust_port/crates/flow_typing_type/src/type_util.rs:2685 — rust_port/crates/flow_typing_type/src/type_util.rs:2685-2703 | rust_port/crates/flow_typing_type/src/type_util.rs:2709-2725 — 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:910 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:910-926 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:928-944 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1003 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1003-1019 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1055-1073 — 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) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:103 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:103-124 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:157-173 — 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) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:268 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:268-284 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:419-435 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:1981 — rust_port/crates/flow_analysis/src/scope_builder.rs:1981-1997 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1893-1910 — 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) rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1301 — rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1301-1317 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1321-1337 — 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) rust_port/crates/flow_env_builder/src/name_def.rs:736 — rust_port/crates/flow_env_builder/src/name_def.rs:736-752 | rust_port/crates/flow_env_builder/src/name_def.rs:786-802 — 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) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:402 — rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:402-418 | rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:439-469 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14052 — rust_port/crates/flow_parser/src/ast_visitor.rs:14052-14069 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5086-5102 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:894 — rust_port/crates/flow_analysis/src/property_assignment.rs:894-910 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2239-2257 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15343 — rust_port/crates/flow_parser/src/ast_visitor.rs:15343-15359 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5400-5416 — 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3401 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3401-3418 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3572-3588 — 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) rust_port/crates/flow_typing_type/src/type_util.rs:2558 — rust_port/crates/flow_typing_type/src/type_util.rs:2558-2574 | rust_port/crates/flow_typing_type/src/type_util.rs:2576-2593 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:222 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:222-238 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:288-306 — 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) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:435 — rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:435-451 | rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:700-717 — 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) rust_port/crates/flow_heap/src/heap_state.rs:509 — rust_port/crates/flow_heap/src/heap_state.rs:509-527 | rust_port/crates/flow_heap/src/heap_state.rs:597-613 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:87 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:87-103 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:101-117 — 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) rust_port/crates/flow_typing_statement/src/match_pattern.rs:734 — rust_port/crates/flow_typing_statement/src/match_pattern.rs:734-750 | rust_port/crates/flow_typing_statement/src/match_pattern.rs:793-810 — 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) rust_port/crates/flow_config/src/flowconfig.rs:1559 — rust_port/crates/flow_config/src/flowconfig.rs:1559-1575 | rust_port/crates/flow_config/src/flowconfig.rs:1577-1594 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:937 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:937-954 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1004-1020 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:5813 — rust_port/crates/flow_parser/src/estree_translator.rs:5813-5829 | rust_port/crates/flow_parser/src/estree_translator.rs:6260-6284 — 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) rust_port/crates/flow_typing_loc_env/src/match_pattern_ir.rs:685 — rust_port/crates/flow_typing_loc_env/src/match_pattern_ir.rs:685-705 | rust_port/crates/flow_typing_loc_env/src/match_pattern_ir.rs:707-723 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×25
  • Edited copy of a member (11 corresponding lines) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:722 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:722-738 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:807-817 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6488 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:6488-6498 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6767-6778 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1431 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1431-1441 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1592-1603 — 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) rust_port/crates/flow_common_errors/src/error_utils.rs:665 — rust_port/crates/flow_common_errors/src/error_utils.rs:665-675 | rust_port/crates/flow_common_errors/src/error_utils.rs:679-689 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:4484 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4484-4494 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4500-4510 — 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) rust_port/crates/flow_config/src/flowconfig.rs:653 — rust_port/crates/flow_config/src/flowconfig.rs:653-666 | rust_port/crates/flow_config/src/flowconfig.rs:668-678 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:4129 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4129-4139 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4354-4365 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13304 — rust_port/crates/flow_parser/src/ast_visitor.rs:13304-13314 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4698-4710 — 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) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:398 — rust_port/crates/flow_typing_flow_common/src/type_subst.rs:398-412 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:543-553 — 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) rust_port/crates/flow_typing_errors/src/flow_error.rs:106 — rust_port/crates/flow_typing_errors/src/flow_error.rs:106-116 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2351-2366 — 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) rust_port/crates/flow_type_sig/src/type_sig.rs:466 — rust_port/crates/flow_type_sig/src/type_sig.rs:466-476 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2923-2936 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:6862 — rust_port/crates/flow_parser/src/ast_visitor.rs:6862-6872 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:883-895 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5068 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5068-5081 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6287-6297 — 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) rust_port/crates/flow_common_ty/src/ty.rs:1591 — rust_port/crates/flow_common_ty/src/ty.rs:1591-1607 | rust_port/crates/flow_common_ty/src/ty.rs:3178-3188 — 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) rust_port/crates/flow_cli/src/autofix_command.rs:154 — rust_port/crates/flow_cli/src/autofix_command.rs:154-164 | rust_port/crates/flow_cli/src/autofix_command.rs:325-336 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7787 — rust_port/crates/flow_parser/src/ast_visitor.rs:7787-7798 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3288-3298 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13990 — rust_port/crates/flow_parser/src/ast_visitor.rs:13990-14000 | rust_port/crates/flow_parser/src/ast_visitor.rs:16059-16077 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:398 — rust_port/crates/flow_parser_wasm/src/serializer.rs:398-413 | rust_port/crates/flow_parser_wasm/src/serializer.rs:415-425 — 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) rust_port/crates/flow_server_monitor/src/file_watcher.rs:665 — rust_port/crates/flow_server_monitor/src/file_watcher.rs:665-691 | rust_port/crates/flow_server_monitor/src/file_watcher.rs:1408-1418 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:4471 — rust_port/crates/flow_parser/src/estree_translator.rs:4471-4481 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2266-2278 — 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:705 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:705-715 | rust_port/crates/flow_parser/src/ast_visitor.rs:17572-17584 — 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) rust_port/crates/flow_parser/src/ast.rs:145 — rust_port/crates/flow_parser/src/ast.rs:145-155 | rust_port/crates/flow_parser/src/ast.rs:159-169 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4511 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4511-4524 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4661-4671 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:42 — rust_port/crates/flow_analysis/src/property_assignment.rs:42-52 | rust_port/crates/flow_analysis/src/property_assignment.rs:57-67 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:1196 — rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:1196-1207 | rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:420-430 — 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×24
  • Edited copy of a member (15 corresponding lines) rust_port/crates/flow_parser_wasm/src/serializer.rs:2706 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2706-2725 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2743-2757 — 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) rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:324 — rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:324-338 | rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:345-359 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:77 — rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:77-91 | rust_port/crates/flow_parser_wasm/src/babel_adapter/enum_lowering.rs:107-125 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11281 — rust_port/crates/flow_parser/src/ast_visitor.rs:11281-11296 | rust_port/crates/flow_parser/src/comment_attachment.rs:355-369 — 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) rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:92 — rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:92-106 | rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:197-214 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:285 — rust_port/crates/flow_analysis/src/property_assignment.rs:285-299 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1010-1027 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6447 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6447-6461 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6724-6738 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3731 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3731-3746 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3751-3765 — 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) rust_port/crates/flow_server_env/src/server_monitor_listener_state.rs:153 — rust_port/crates/flow_server_env/src/server_monitor_listener_state.rs:153-167 | rust_port/crates/flow_server_env/src/server_monitor_listener_state.rs:173-192 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3968 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3968-3982 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5050-5064 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3402 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3402-3416 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4833-4847 — 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) rust_port/crates/flow_type_sig/src/type_sig.rs:830 — rust_port/crates/flow_type_sig/src/type_sig.rs:830-845 | rust_port/crates/flow_type_sig/src/type_sig.rs:882-896 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8569 — rust_port/crates/flow_parser/src/ast_visitor.rs:8569-8583 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:787-801 — 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) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:550 — rust_port/crates/flow_services_get_def/src/get_def_utils.rs:550-564 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1177-1191 — 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) rust_port/crates/flow_parser_utils/src/ast_builder.rs:2075 — rust_port/crates/flow_parser_utils/src/ast_builder.rs:2075-2089 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:2505-2519 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2046 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2046-2060 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4761-4776 — 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) rust_port/crates/flow_common_ty/src/ty_serializer.rs:111 — rust_port/crates/flow_common_ty/src/ty_serializer.rs:111-125 | rust_port/crates/flow_common_ty/src/ty_serializer.rs:127-141 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:15059 — rust_port/crates/flow_parser/src/ast_visitor.rs:15059-15073 | rust_port/crates/flow_parser/src/ast_visitor.rs:18096-18110 — 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) rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:171 — rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:171-190 | rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:210-224 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10884 — rust_port/crates/flow_parser/src/ast_visitor.rs:10884-10902 | rust_port/crates/flow_parser/src/ast_visitor.rs:11909-11923 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11639 — rust_port/crates/flow_parser/src/ast_visitor.rs:11639-11653 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6793-6807 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:16293 — rust_port/crates/flow_parser/src/ast_visitor.rs:16293-16307 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2257-2271 — 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) rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:118 — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:118-134 | rust_port/crates/flow_services_inference/src/type_service.rs:2536-2550 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8839 — rust_port/crates/flow_parser/src/ast_visitor.rs:8839-8853 | rust_port/crates/flow_parser/src/ast_visitor.rs:18704-18719 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×24
  • Edited copy of a member (12 corresponding lines) rust_port/crates/flow_type_sig/src/type_sig.rs:516 — rust_port/crates/flow_type_sig/src/type_sig.rs:516-527 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2822-2841 — 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) rust_port/crates/flow_cli/src/glean_schema.rs:125 — rust_port/crates/flow_cli/src/glean_schema.rs:125-136 | rust_port/crates/flow_cli/src/glean_schema.rs:550-561 — 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) rust_port/crates/flow_lsp/src/lsp_fmt.rs:509 — rust_port/crates/flow_lsp/src/lsp_fmt.rs:509-521 | rust_port/crates/flow_lsp/src/lsp_fmt.rs:532-543 — 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) rust_port/crates/flow_heap/src/heap_state.rs:558 — rust_port/crates/flow_heap/src/heap_state.rs:558-569 | rust_port/crates/flow_heap/src/heap_state.rs:578-591 — 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) rust_port/crates/flow_parser/src/parser_env.rs:1638 — rust_port/crates/flow_parser/src/parser_env.rs:1638-1649 | rust_port/crates/flow_parser/src/parser_env.rs:1655-1667 — 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) rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:265 — rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:265-277 | rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:279-290 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:12436 — rust_port/crates/flow_parser/src/ast_visitor.rs:12436-12447 | rust_port/crates/flow_parser/src/ast_visitor.rs:12470-12481 — 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) rust_port/crates/flow_server_monitor/src/file_watcher.rs:632 — rust_port/crates/flow_server_monitor/src/file_watcher.rs:632-645 | rust_port/crates/flow_server_monitor/src/file_watcher.rs:1379-1390 — 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) rust_port/crates/flow_typing_statement/src/class_sig.rs:269 — rust_port/crates/flow_typing_statement/src/class_sig.rs:269-280 | rust_port/crates/flow_typing_statement/src/class_sig.rs:293-304 — 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) rust_port/crates/flow_typing_statement/src/destructuring.rs:149 — rust_port/crates/flow_typing_statement/src/destructuring.rs:149-160 | rust_port/crates/flow_typing_statement/src/destructuring.rs:250-261 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:224 — rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:224-242 | rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:260-271 — 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) rust_port/crates/flow_common_vcs/src/git.rs:17 — rust_port/crates/flow_common_vcs/src/git.rs:17-28 | rust_port/crates/flow_common_vcs/src/hg.rs:24-36 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:7413 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:7413-7424 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:7433-7446 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14909 — rust_port/crates/flow_parser/src/ast_visitor.rs:14909-14920 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1541-1554 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15729 — rust_port/crates/flow_parser/src/ast_visitor.rs:15729-15740 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1974-1985 — 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) rust_port/crates/flow_typing_type/src/type_.rs:7230 — rust_port/crates/flow_typing_type/src/type_.rs:7230-7241 | rust_port/crates/flow_typing_type/src/type_.rs:7247-7261 — 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) rust_port/crates/flow_lsp_server/src/jsonrpc.rs:242 — rust_port/crates/flow_lsp_server/src/jsonrpc.rs:242-253 | rust_port/crates/flow_lsp_server/src/jsonrpc.rs:258-269 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15304 — rust_port/crates/flow_parser/src/ast_visitor.rs:15304-15320 | rust_port/crates/flow_parser/src/ast_visitor.rs:16166-16177 — 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) rust_port/crates/flow_services_references/src/rename_mapper.rs:50 — rust_port/crates/flow_services_references/src/rename_mapper.rs:50-61 | rust_port/crates/flow_services_references/src/rename_mapper.rs:346-357 — 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) rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:446 — rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:446-457 | rust_port/crates/flow_utils_concurrency/src/lockfree_overlay_map.rs:472-488 — 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) rust_port/crates/flow_parser/src/ast_utils.rs:343 — rust_port/crates/flow_parser/src/ast_utils.rs:343-354 | rust_port/crates/flow_parser/src/ast_utils.rs:380-394 — 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) rust_port/crates/flow_heap/src/heap_state.rs:457 — rust_port/crates/flow_heap/src/heap_state.rs:457-472 | rust_port/crates/flow_heap/src/heap_state.rs:635-646 — 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) rust_port/crates/flow_services_autocomplete/src/keywords.rs:164 — rust_port/crates/flow_services_autocomplete/src/keywords.rs:164-175 | rust_port/crates/flow_services_code_action/src/insert_type.rs:506-517 — 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) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:498 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:498-509 | rust_port/crates/flow_services_code_action/src/refactor_switch_to_match_statement.rs:84-96 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×23
  • Edited copy of a member (16 corresponding lines) rust_port/crates/flow_parser/src/comment_attachment.rs:400 — rust_port/crates/flow_parser/src/comment_attachment.rs:400-415 | rust_port/crates/flow_parser/src/comment_attachment.rs:616-631 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:865 — rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:865-880 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:894-909 — 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) rust_port/crates/flow_typing_statement/src/type_annotation_cons_gen.rs:71 — rust_port/crates/flow_typing_statement/src/type_annotation_cons_gen.rs:71-86 | rust_port/crates/flow_typing_statement/src/type_annotation_cons_gen.rs:88-106 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8839 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8839-8856 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12079-12094 — 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1842 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1842-1857 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1891-1908 — 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) rust_port/crates/flow_type_sig/src/type_sig.rs:852 — rust_port/crates/flow_type_sig/src/type_sig.rs:852-867 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3045-3068 — 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) rust_port/crates/flow_typing_flow_js/src/intersection_kit.rs:109 — rust_port/crates/flow_typing_flow_js/src/intersection_kit.rs:109-128 | rust_port/crates/flow_typing_flow_js/src/intersection_kit/objects.rs:195-210 — 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:780 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:780-796 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1326-1341 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:2916 — rust_port/crates/flow_parser/src/estree_translator.rs:2916-2931 | rust_port/crates/flow_parser/src/estree_translator.rs:3997-4012 — 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) rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:95 — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:95-116 | rust_port/crates/flow_services_inference/src/type_service.rs:2519-2534 — 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) rust_port/crates/flow_services_code_action/src/autofix_renders_variant.rs:350 — rust_port/crates/flow_services_code_action/src/autofix_renders_variant.rs:350-365 | rust_port/crates/flow_services_code_action/src/autofix_renders_variant.rs:381-396 — 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) rust_port/crates/flow_parser_utils/src/ast_builder.rs:1755 — rust_port/crates/flow_parser_utils/src/ast_builder.rs:1755-1774 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:1814-1829 — 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) rust_port/crates/flow_server_env/src/flow_lsp_conversions.rs:463 — rust_port/crates/flow_server_env/src/flow_lsp_conversions.rs:463-480 | rust_port/crates/flow_server_env/src/flow_lsp_conversions.rs:482-497 — 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) rust_port/crates/flow_parser/src/type_parser.rs:273 — rust_port/crates/flow_parser/src/type_parser.rs:273-288 | rust_port/crates/flow_parser/src/type_parser.rs:331-350 — 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) rust_port/crates/flow_typing_statement/src/match_pattern.rs:80 — rust_port/crates/flow_typing_statement/src/match_pattern.rs:80-98 | rust_port/crates/flow_typing_statement/src/match_pattern.rs:104-119 — 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) rust_port/crates/flow_services_autocomplete/src/insert_jsdoc.rs:128 — rust_port/crates/flow_services_autocomplete/src/insert_jsdoc.rs:128-143 | rust_port/crates/flow_services_autocomplete/src/insert_jsdoc.rs:149-164 — 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) rust_port/crates/flow_typing_type/src/type_.rs:7545 — rust_port/crates/flow_typing_type/src/type_.rs:7545-7560 | rust_port/crates/flow_typing_type/src/type_.rs:7637-7654 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:824 — rust_port/crates/flow_analysis/src/property_assignment.rs:824-839 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2026-2042 — 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) rust_port/crates/flow_aloc/src/lib.rs:580 — rust_port/crates/flow_aloc/src/lib.rs:580-596 | rust_port/crates/flow_aloc/src/lib.rs:946-961 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2837 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2837-2854 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5095-5110 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:18769 — rust_port/crates/flow_parser/src/ast_visitor.rs:18769-18784 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2789-2808 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:115 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:115-130 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:131-147 — 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) rust_port/crates/flow_services_code_action/src/autofix_exports.rs:71 — rust_port/crates/flow_services_code_action/src/autofix_exports.rs:71-86 | rust_port/crates/flow_services_code_action/src/autofix_missing_local_annots.rs:91-107 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×23
  • Edited copy of a member (9 corresponding lines) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2867 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2867-2876 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2879-2887 — 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) rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:128 — rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:128-136 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1720-1730 — 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) rust_port/crates/flow_typing_type/src/type_.rs:7333 — rust_port/crates/flow_typing_type/src/type_.rs:7333-7344 | rust_port/crates/flow_typing_type/src/type_.rs:7349-7357 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6691 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6691-6707 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6711-6719 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6149 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6149-6157 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6159-6167 — 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) rust_port/crates/flow_analysis/src/scope_api.rs:32 — rust_port/crates/flow_analysis/src/scope_api.rs:32-40 | rust_port/crates/flow_analysis/src/scope_api.rs:44-52 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:786 — rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:786-794 | rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:799-807 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2170 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2170-2178 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2581-2592 — 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) rust_port/crates/flow_common_vcs/src/git.rs:66 — rust_port/crates/flow_common_vcs/src/git.rs:66-74 | rust_port/crates/flow_common_vcs/src/hg.rs:75-83 — 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) rust_port/crates/flow_typing_statement/src/component_sig.rs:83 — rust_port/crates/flow_typing_statement/src/component_sig.rs:83-91 | rust_port/crates/flow_typing_statement/src/func_sig.rs:99-107 — 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) rust_port/crates/flow_services_coverage/src/lib.rs:70 — rust_port/crates/flow_services_coverage/src/lib.rs:70-78 | rust_port/crates/flow_services_coverage/src/lib.rs:80-88 — 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) rust_port/crates/flow_common_ty/src/ty_debug.rs:296 — rust_port/crates/flow_common_ty/src/ty_debug.rs:296-305 | rust_port/crates/flow_common_ty/src/ty_debug.rs:530-538 — 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) rust_port/crates/flow_common_vcs/src/git.rs:53 — rust_port/crates/flow_common_vcs/src/git.rs:53-61 | rust_port/crates/flow_common_vcs/src/hg.rs: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) rust_port/crates/flow_parser/src/ast.rs:5425 — rust_port/crates/flow_parser/src/ast.rs:5425-5433 | rust_port/crates/flow_parser/src/ast.rs:5435-5443 — 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) rust_port/crates/flow_parser/src/type_parser.rs:4845 — rust_port/crates/flow_parser/src/type_parser.rs:4845-4853 | rust_port/crates/flow_parser/src/type_parser.rs:4867-4877 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:449 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:449-457 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3252-3266 — 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) rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:1081 — rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:1081-1089 | rust_port/crates/flow_typing_flow_js/src/speculation_kit.rs:1099-1109 — 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:855 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:855-863 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:868-876 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9020 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9020-9028 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9031-9042 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5983 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5983-5992 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6617-6625 — 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) rust_port/crates/flow_env_builder/src/name_def.rs:3043 — rust_port/crates/flow_env_builder/src/name_def.rs:3043-3052 | rust_port/crates/flow_parser/src/ast_visitor.rs:7876-7884 — 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1170 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1170-1178 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10920-10928 — 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) rust_port/crates/flow_parser/src/parser_env.rs:1193 — rust_port/crates/flow_parser/src/parser_env.rs:1193-1201 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1067-1095 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×22
  • Duplicated block (6 lines × 3) rust_port/crates/flow_cli/src/agent_helper_command.rs:113 — rust_port/crates/flow_cli/src/agent_helper_command.rs:113-118 | rust_port/crates/flow_cli/src/dump_types_command.rs:28-33 | rust_port/crates/flow_cli/src/get_def_command.rs:23-28 — before extracting anything, compare `rust_port/crates/flow_cli/src/agent_helper_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` as WHOLE FILES: this scan already matched 4 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_cli/src/agent_helper_command.rs:111` calls `add_reason_flag` and `rust_port/crates/flow_cli/src/dump_types_command.rs:26` 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) rust_port/crates/flow_cli/src/apply_code_action_command.rs:75 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:75-81 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:182-188 | rust_port/crates/flow_cli/src/autofix_command.rs:328-333 — before extracting anything, compare `rust_port/crates/flow_cli/src/apply_code_action_command.rs` and `rust_port/crates/flow_cli/src/autofix_command.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/apply_code_action_command.rs:75` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 3) rust_port/crates/flow_codemods/src/annotate_exports.rs:315 — rust_port/crates/flow_codemods/src/annotate_exports.rs:315-320 | rust_port/crates/flow_codemods/src/annotate_exports.rs:627-632 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:254-259 — before extracting anything, compare `rust_port/crates/flow_codemods/src/annotate_exports.rs` and `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs` 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. If that is what happened, the fix is to keep one copy and have the 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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rust_port/crates/flow_parser/src/flow_lexer.rs:803 — rust_port/crates/flow_parser/src/flow_lexer.rs:803-808 | rust_port/crates/flow_parser/src/flow_lexer.rs:1853-1858 | rust_port/crates/flow_parser/src/flow_lexer.rs:2444-2449 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:803` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:4079 — rust_port/crates/flow_parser/src/statement_parser.rs:4079-4084 | rust_port/crates/flow_parser/src/statement_parser.rs:4100-4105 | rust_port/crates/flow_parser/src/statement_parser.rs:4120-4125 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:4079` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:136 — rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:136-141 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:158-163 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:180-185 — 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 `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs: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 (6 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8034 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8034-8039 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8055-8060 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8067-8072 — 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 (6 lines × 3) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2693 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2693-2698 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1313-1318 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1394-1399 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2693` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1659 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1659-1664 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1686-1691 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1709-1714 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1659` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4196 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4196-4201 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4205-4210 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4251-4256 — 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 (6 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:4273 — rust_port/crates/flow_typing_statement/src/statement.rs:4273-4278 | rust_port/crates/flow_typing_statement/src/statement.rs:4390-4396 | rust_port/crates/flow_typing_statement/src/statement.rs:4508-4514 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:4273` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:10007 — rust_port/crates/flow_typing_statement/src/statement.rs:10007-10012 | rust_port/crates/flow_typing_statement/src/statement.rs:10083-10088 | rust_port/crates/flow_typing_statement/src/statement.rs:10159-10164 — 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, `rust_port/crates/flow_typing_statement/src/statement.rs:10082` calls `Ok` and `rust_port/crates/flow_typing_statement/src/statement.rs:10007` 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) rust_port/crates/flow_typing_statement/src/statement.rs:10259 — rust_port/crates/flow_typing_statement/src/statement.rs:10259-10264 | rust_port/crates/flow_typing_statement/src/statement.rs:18138-18143 | rust_port/crates/flow_typing_statement/src/statement.rs:19471-19476 — 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 (6 lines × 3) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1112 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1112-1118 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1171-1177 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1224-1229 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1112` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:650 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:650-655 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:679-684 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:719-724 — 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 (6 lines × 3) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:601 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:601-606 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:620-625 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:656-661 — 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, `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:663` calls `Ok`, `type_annotation_hint` and `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:607` 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 × 3) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1260 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1260-1265 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12019-12024 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12774-12779 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `patt` to `&ast::pattern::Pattern<ALoc, ALoc>` in one and `&'ast flow_parser::ast::pattern::Pattern<ALoc, ALoc>` 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 × 3) rust_port/crates/flow_parser_wasm/src/serializer.rs:3996 — rust_port/crates/flow_parser_wasm/src/serializer.rs:3996-4001 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4134-4139 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4515-4520 — 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 `rust_port/crates/flow_parser_wasm/src/serializer.rs:3996` it begins part-way through the construct above it, so those 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 `inner` to `&ast::statement::Interface<Loc, Loc>` in one and `&ast::types::Interface<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13155 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13155-13160 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13190-13195 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13219-13224 — 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, `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13153` calls `push_lex` and `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13217` 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 × 3) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:794 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:794-799 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:822-827 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:844-849 — 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 `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:794` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:365 — rust_port/crates/flow_analysis/src/ssa_builder.rs:365-370 | rust_port/crates/flow_typing_type/src/type_.rs:7724-7729 | rust_port/crates/flow_typing_type/src/type_.rs:8228-8233 — 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1492 — rust_port/crates/flow_parser/src/flow_lexer.rs:1492-1497 | rust_port/crates/flow_parser/src/flow_lexer.rs:1518-1523 | rust_port/crates/flow_parser/src/flow_lexer.rs:1595-1600 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:1492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · TooManyMethods · ×21
  • TooManyMethods: Context rust_port/crates/flow_typing_context/src/lib.rs:878 — TooManyMethods — 290 methods. The bar is 30 methods; this is 260 over it, 9.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: NameResolver rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1734 — 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.
  • TooManyMethods: Serializer rust_port/crates/flow_parser_wasm/src/serializer.rs:57 — TooManyMethods — 168 methods. The bar is 30 methods; this is 138 over it, 5.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: Transaction rust_port/crates/flow_heap/src/transaction.rs:57 — TooManyMethods — 138 methods, declared across 2 files: src/parsing_heaps.rs (84), src/transaction.rs (54). The bar is 30 methods; this is 108 over it, 4.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Volume packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:313 — TooManyMethods — 121 methods. The bar is 30 methods; this is 91 over it, 4.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: Walker rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:552 — TooManyMethods — 120 methods. The bar is 30 methods; this is 90 over it, 4.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Referencer packages/flow-eslint/src/scope-manager/referencer/Referencer.js:137 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserEnv rust_port/crates/flow_parser/src/parser_env.rs:373 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlowJs rust_port/crates/flow_typing_flow_js/src/flow_js.rs:232 — TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.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: Transform REDACTED:161 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: DefFinder rust_port/crates/flow_env_builder/src/name_def.rs:1724 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Writer rust_port/crates/flow_parser_utils_output/src/indented_printer.rs:52 — TooManyMethods — 58 methods, declared across 5 files: indented_printer/statements.rs (19), src/indented_printer.rs (16), indented_printer/expressions.rs (11), indented_printer/jsx.rs (8), +1 more file(s). The bar is 30 methods; this is 28 over it, 1.93× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TypeVisitor packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js:64 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UseVisitor rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:244 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NodeCache rust_port/crates/flow_typing_loc_env/src/node_cache.rs:91 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EnvTransaction rust_port/crates/flow_server_env/src/server_env.rs:270 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SsaBuilder rust_port/crates/flow_analysis/src/ssa_builder.rs:478 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: Array lib/lib.es5.js:1293 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Serializer rust_port/crates/flow_common_ty/src/ty_serializer.rs:160 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlowJsEnv rust_port/crates/flow_typing_flow_js_env/src/lib.rs:172 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CommittedHeap rust_port/crates/flow_heap/src/heap_state.rs:60 — TooManyMethods — 32 methods, declared across 2 files: src/transaction.rs (21), src/heap_state.rs (11). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×21
  • Duplicated block (19 lines × 2) rust_port/crates/flow_cli/src/autofix_command.rs:356 — rust_port/crates/flow_cli/src/autofix_command.rs:356-374 | rust_port/crates/flow_cli/src/autofix_command.rs:526-544 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_cli/src/autofix_command.rs:524` calls `get`, `truthy`, `unwrap` and `rust_port/crates/flow_cli/src/autofix_command.rs:354` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:994 — rust_port/crates/flow_cli/src/glean_runner.rs:994-1012 | rust_port/crates/flow_cli/src/glean_runner.rs:1184-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:994` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common_vcs/src/vcs_utils.rs:78 — rust_port/crates/flow_common_vcs/src/vcs_utils.rs:78-96 | rust_port/crates/flow_watchman/src/lib.rs:556-574 — 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 (19 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:5144 — rust_port/crates/flow_env_builder/src/name_def.rs:5144-5162 | rust_port/crates/flow_env_builder/src/name_def.rs:5305-5323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5144` 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) rust_port/crates/flow_parser/src/object_parser.rs:1237 — rust_port/crates/flow_parser/src/object_parser.rs:1237-1255 | rust_port/crates/flow_parser/src/object_parser.rs:1380-1398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7417 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7417-7435 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7452-7470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7417` 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6412 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:6412-6430 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6461-6479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:6412` 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) rust_port/crates/flow_type_sig/src/type_sig.rs:2812 — rust_port/crates/flow_type_sig/src/type_sig.rs:2812-2830 | rust_port/crates/flow_type_sig/src/type_sig.rs:2833-2851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig.rs:2812` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2593 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2593-2611 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2955-2973 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2593` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12553 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12553-12571 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12596-12614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12553` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9114 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9114-9132 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9146-9164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9146` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1432 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1432-1450 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1488-1506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:581 — rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:581-599 | rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:601-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:581` 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) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:229 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:229-247 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:286-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:229` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:3815 — rust_port/crates/flow_typing_statement/src/statement.rs:3815-3833 | rust_port/crates/flow_typing_statement/src/statement.rs:4042-4060 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:3815` 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:590 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:590-608 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:620-638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:590` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6392 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:6392-6410 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6441-6459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:6392` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_type/src/type_util.rs:2190 — rust_port/crates/flow_typing_type/src/type_util.rs:2190-2208 | rust_port/crates/flow_typing_type/src/type_util.rs:2211-2229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_util.rs:2190` 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2342 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2342-2360 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2950-2968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2342` 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, `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2949` calls `unapplied_type_identifier_opt`, `dupe` and `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2341` 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) rust_port/crates/flow_cli/src/codemod_command.rs:372 — rust_port/crates/flow_cli/src/codemod_command.rs:372-390 | rust_port/crates/flow_cli/src/codemod_command.rs:641-659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/codemod_command.rs:372` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8670 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8670-8688 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10344-10362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8670` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · flow_typing_flow_common · ×20
  • flow_typing_flow_common::flow_js_utils::array_elem_check (cognitive 76) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8204 — flow_typing_flow_common::flow_js_utils::array_elem_check has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (56 pts), match/switch 6 (16 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.
  • flow_typing_flow_common::flow_js_utils::is_builtin_class_id (cognitive 74) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3245 — flow_typing_flow_common::flow_js_utils::is_builtin_class_id has cognitive complexity 74 (threshold 15). Drivers by points: if/else 11 (54 pts), match/switch 4 (20 pts) (nesting depth added 59). 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.
  • flow_typing_flow_common::flow_js_utils::propref_for_elem_t_with_env (cognitive 47) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8505 — flow_typing_flow_common::flow_js_utils::propref_for_elem_t_with_env has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (46 pts), match/switch 1 (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_flow_common::flow_js_utils::builtin_react_element_nominal_id (cognitive 36) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3324 — flow_typing_flow_common::flow_js_utils::builtin_react_element_nominal_id has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (35 pts), match/switch 1 (nesting depth added 28). 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. This shape REPEATS in the file: one other method here (flow_typing_flow_common::flow_js_utils::builtin_react_renders_exactly_nominal_id) 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.
  • flow_typing_flow_common::flow_js_utils::builtin_react_renders_exactly_nominal_id (cognitive 36) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3361 — flow_typing_flow_common::flow_js_utils::builtin_react_renders_exactly_nominal_id has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (35 pts), match/switch 1 (nesting depth added 28). 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. This shape REPEATS in the file: one other method here (flow_typing_flow_common::flow_js_utils::builtin_react_element_nominal_id) 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.
  • flow_typing_flow_common::flow_js_utils::cjs_require_t_kit::on_module_t (cognitive 33) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4954 — flow_typing_flow_common::flow_js_utils::cjs_require_t_kit::on_module_t has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 8 (20 pts), if/else 6 (12 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_flow_common::flow_js_utils::error_message_kind_of_upper (cognitive 29) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1593 — flow_typing_flow_common::flow_js_utils::error_message_kind_of_upper has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 6 (11 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.
  • flow_typing_flow_common::flow_js_utils::collect_prototype_t::go (cognitive 28) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:357 — flow_typing_flow_common::flow_js_utils::collect_prototype_t::go has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), match/switch 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.
  • flow_typing_flow_common::flow_js_utils::union_optimization_guard::union_optimization_guard_impl (cognitive 28) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2501 — flow_typing_flow_common::flow_js_utils::union_optimization_guard::union_optimization_guard_impl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, match/switch 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.
  • flow_typing_flow_common::flow_js_utils::import_export_utils::get_module_type_or_any (cognitive 23) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6486 — flow_typing_flow_common::flow_js_utils::import_export_utils::get_module_type_or_any has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (11 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.
  • flow_typing_flow_common::flow_js_utils::import_type_t_kit::canonicalize_imported_type (cognitive 23) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4635 — flow_typing_flow_common::flow_js_utils::import_type_t_kit::canonicalize_imported_type has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 8 (23 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_flow_common::flow_js_utils::quick_error_fun_as_obj (cognitive 21) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2890 — flow_typing_flow_common::flow_js_utils::quick_error_fun_as_obj has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 4 (7 pts), loops 2 (5 pts), boolean chains 2 (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.
  • flow_typing_flow_common::flow_js_utils::collect_construct_ts::go (cognitive 19) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:287 — flow_typing_flow_common::flow_js_utils::collect_construct_ts::go has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 2 (6 pts), loops 2 (4 pts) (nesting depth added 11). 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.
  • flow_typing_flow_common::flow_js_utils::import_named_t_kit::on_module_t_with_env (cognitive 19) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5525 — flow_typing_flow_common::flow_js_utils::import_named_t_kit::on_module_t_with_env has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (7 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.
  • flow_typing_flow_common::flow_js_utils::instantiation_kit::instantiate_poly_with_targs (cognitive 18) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3812 — flow_typing_flow_common::flow_js_utils::instantiation_kit::instantiate_poly_with_targs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 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.
  • flow_typing_flow_common::concrete_type_eq::eq_swap_reason (cognitive 17) rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:120 — flow_typing_flow_common::concrete_type_eq::eq_swap_reason has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 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.
  • flow_typing_flow_common::type_subst::union_ident_map_and_dedup (cognitive 17) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:287 — flow_typing_flow_common::type_subst::union_ident_map_and_dedup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (flatten_into). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_flow_common::concrete_type_eq::eq_with_env (cognitive 16) rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:197 — flow_typing_flow_common::concrete_type_eq::eq_with_env has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 7). 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.
  • flow_typing_flow_common::flow_js_utils::collect_lowers (cognitive 16) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:793 — flow_typing_flow_common::flow_js_utils::collect_lowers 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.
  • flow_typing_flow_common::flow_js_utils::render_types::on_concretized_renders_normalization (cognitive 16) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9854 — flow_typing_flow_common::flow_js_utils::render_types::on_concretized_renders_normalization has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (6 pts), if/else 2 (5 pts), loops 1 (5 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities · Medium CVE · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×20
  • Duplicated block (18 lines × 2) rust_port/crates/flow_cli/src/codemod_command.rs:312 — rust_port/crates/flow_cli/src/codemod_command.rs:312-329 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:663-680 — before extracting anything, compare `rust_port/crates/flow_cli/src/codemod_command.rs` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (18 lines × 2) rust_port/crates/flow_common/src/files.rs:1421 — rust_port/crates/flow_common/src/files.rs:1421-1438 | rust_port/crates/flow_parser/src/file_key.rs:156-173 — before extracting anything, compare `rust_port/crates/flow_common/src/files.rs` and `rust_port/crates/flow_parser/src/file_key.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 `rust_port/crates/flow_common/src/files.rs:1421` 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) rust_port/crates/flow_common_errors/src/error_utils.rs:2217 — rust_port/crates/flow_common_errors/src/error_utils.rs:2217-2234 | rust_port/crates/flow_common_errors/src/error_utils.rs:2235-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 `rust_port/crates/flow_common_errors/src/error_utils.rs:2217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) rust_port/crates/flow_config/src/flowconfig.rs:521 — rust_port/crates/flow_config/src/flowconfig.rs:521-538 | rust_port/crates/flow_config/src/flowconfig.rs:554-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_config/src/flowconfig.rs:521` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder/src/name_def.rs:5469 — rust_port/crates/flow_env_builder/src/name_def.rs:5469-5486 | rust_port/crates/flow_env_builder/src/name_def.rs:5557-5574 — both copies are in the same file, so extract the 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) rust_port/crates/flow_heap/src/transaction.rs:1151 — rust_port/crates/flow_heap/src/transaction.rs:1151-1168 | rust_port/crates/flow_heap/src/transaction.rs:1215-1232 — both copies are in the same file, so extract the 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) rust_port/crates/flow_hh_json/src/lib.rs:128 — rust_port/crates/flow_hh_json/src/lib.rs:128-145 | rust_port/crates/flow_hh_json/src/lib.rs:162-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_hh_json/src/lib.rs:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) rust_port/crates/flow_parser/src/ast.rs:6019 — rust_port/crates/flow_parser/src/ast.rs:6019-6036 | rust_port/crates/flow_parser/src/ast.rs:6039-6056 — both copies are in the same file, so extract the 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 (18 lines × 2) rust_port/crates/flow_parser/src/type_parser.rs:4326 — rust_port/crates/flow_parser/src/type_parser.rs:4326-4343 | rust_port/crates/flow_parser/src/type_parser.rs:4425-4442 — both copies are in the same file, so extract the 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1119 — rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1119-1136 | rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1144-1161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1119` 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) rust_port/crates/flow_services_code_action/src/code_action_service.rs:1743 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:1743-1760 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:1777-1794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/code_action_service.rs:1743` 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) rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1070 — rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1070-1087 | rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1127-1144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1070` 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, `rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1126` calls `extend` and `rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1069` 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) rust_port/crates/flow_services_inference/src/check_service.rs:486 — rust_port/crates/flow_services_inference/src/check_service.rs:486-503 | rust_port/crates/flow_services_inference/src/check_service.rs:526-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_inference/src/check_service.rs:486` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2867 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2867-2884 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3272-3290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3272` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4654 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4654-4671 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4690-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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4654` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108-7125 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7666-7683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108` 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 (18 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:9499 — rust_port/crates/flow_typing_statement/src/statement.rs:9499-9516 | rust_port/crates/flow_typing_statement/src/statement.rs:9600-9617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:9499` 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) rust_port/crates/flow_typing_statement/src/statement.rs:14616 — rust_port/crates/flow_typing_statement/src/statement.rs:14616-14633 | rust_port/crates/flow_typing_statement/src/statement.rs:14667-14684 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:901 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:901-918 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:931-948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:901` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_cli/src/apply_code_action_command.rs:67 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:67-84 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:174-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
D2 · Cognitive Complexity · NameResolver · ×19
  • NameResolver::visit_match_pattern (cognitive 70) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4416 — NameResolver::visit_match_pattern has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (42 pts), match/switch 12 (22 pts), loops 5 (6 pts) (nesting depth added 35). Of this number, 68 points are the body's own statements and 2 belong to 2 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.
  • NameResolver::merge_conditional_branches_with_refinements (cognitive 50) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:5070 — NameResolver::merge_conditional_branches_with_refinements has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 33). 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.
  • NameResolver::mk_env (cognitive 41) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2731 — NameResolver::mk_env has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 5 (13 pts), loops 3 (7 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.
  • NameResolver::assignment (cognitive 38) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9549 — NameResolver::assignment has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 9 (18 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.
  • NameResolver::variable_declarator (cognitive 35) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9752 — NameResolver::variable_declarator has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 5 (12 pts), boolean chains 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.
  • NameResolver::mk_type_env (cognitive 32) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3023 — NameResolver::mk_type_env has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 5 (11 pts), boolean chains 3, 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.
  • NameResolver::binding_type_identifier (cognitive 27) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8970 — NameResolver::binding_type_identifier has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 7 (9 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.
  • NameResolver::binding_pattern_track_object_destructuring (cognitive 25) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3376 — NameResolver::binding_pattern_track_object_destructuring has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 2 (6 pts), loops 1 (2 pts) (nesting depth added 17). Of this number, 16 points are the body's own statements and 9 belong to one function item inside it that branches. 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.
  • NameResolver::normalize_total_refinements::recur (cognitive 23) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6775 — NameResolver::normalize_total_refinements::recur has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (4 pts), 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.
  • NameResolver::member_expression_refinement_must_be_able_to_refine_base_object_to_non_maybe (cognitive 22) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8493 — NameResolver::member_expression_refinement_must_be_able_to_refine_base_object_to_non_maybe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 6 (8 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.
  • NameResolver::jsx_element (cognitive 21) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11858 — NameResolver::jsx_element has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 3 (13 pts), if/else 2 (4 pts), loops 1 (4 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • NameResolver::havoc_current_env (cognitive 18) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2515 — NameResolver::havoc_current_env has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (6 pts), boolean chains 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.
  • NameResolver::havoc_changed_refinement_keys (cognitive 18) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:5357 — NameResolver::havoc_changed_refinement_keys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (3 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.
  • NameResolver::scoped_for_statement (cognitive 17) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:5561 — NameResolver::scoped_for_statement 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.
  • NameResolver::add_assertion_call_refinement (cognitive 17) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7016 — NameResolver::add_assertion_call_refinement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (4 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.
  • NameResolver::maybe_prop_nullish (cognitive 17) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7695 — NameResolver::maybe_prop_nullish has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 5). 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.
  • NameResolver::declare_namespace (cognitive 17) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11935 — NameResolver::declare_namespace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1, 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.
  • NameResolver::env_switch_case (cognitive 16) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:5866 — NameResolver::env_switch_case has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 3 (5 pts), loops 2 (nesting depth added 6). 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.
  • NameResolver::commit_refinement (cognitive 16) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6862 — NameResolver::commit_refinement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2, boolean chains 1, 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.
D29 · Static Analysis (SAST) · REDACTED · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×19
  • Edited copy of a member (21 corresponding lines) rust_port/crates/flow_analysis/src/scope_builder.rs:2055 — rust_port/crates/flow_analysis/src/scope_builder.rs:2055-2082 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2169-2189 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1560 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1560-1580 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1611-1634 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3682 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3682-3702 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3708-3733 — 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) rust_port/crates/flow_env_builder/src/name_def.rs:3761 — rust_port/crates/flow_env_builder/src/name_def.rs:3761-3781 | rust_port/crates/flow_env_builder/src/name_def.rs:3789-3809 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:18376 — rust_port/crates/flow_parser/src/ast_visitor.rs:18376-18396 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5595-5621 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8924 — rust_port/crates/flow_parser/src/ast_visitor.rs:8924-8950 | rust_port/crates/flow_parser/src/ast_visitor.rs:10376-10396 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:2194 — rust_port/crates/flow_analysis/src/scope_builder.rs:2194-2214 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9940-9962 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4816 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4816-4845 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4992-5012 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13485 — rust_port/crates/flow_parser/src/ast_visitor.rs:13485-13505 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1748-1769 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5552 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5552-5572 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5620-5640 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3505 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3505-3528 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:7028-7048 — 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) rust_port/crates/flow_parser/src/ast_utils.rs:358 — rust_port/crates/flow_parser/src/ast_utils.rs:358-378 | rust_port/crates/flow_parser/src/ast_utils.rs:398-419 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:229 — rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:229-249 | rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:282-302 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:3811 — rust_port/crates/flow_parser/src/estree_translator.rs:3811-3831 | rust_port/crates/flow_parser/src/estree_translator.rs:4210-4230 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:307 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:307-327 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:339-360 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14236 — rust_port/crates/flow_parser/src/ast_visitor.rs:14236-14258 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1168-1188 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11021 — rust_port/crates/flow_parser/src/ast_visitor.rs:11021-11044 | rust_port/crates/flow_parser/src/ast_visitor.rs:11525-11545 — 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) rust_port/crates/flow_services_inference/src/type_contents.rs:449 — rust_port/crates/flow_services_inference/src/type_contents.rs:449-469 | rust_port/crates/flow_services_inference/src/type_contents.rs:488-514 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4177 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4177-4198 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4211-4231 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×19
  • Edited copy of a member (14 corresponding lines) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3677 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3677-3690 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:6102-6117 — 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) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:1184 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:1184-1197 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:1203-1216 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9048 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9048-9061 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9067-9080 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:2036 — rust_port/crates/flow_analysis/src/scope_builder.rs:2036-2049 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2148-2163 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1381 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1381-1395 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1602-1615 — 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) rust_port/crates/flow_common_ty/src/ty_utils.rs:527 — rust_port/crates/flow_common_ty/src/ty_utils.rs:527-540 | rust_port/crates/flow_common_ty/src/ty_utils.rs:542-555 — 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) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:77 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:77-96 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs: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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:976 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:976-991 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:996-1009 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2282 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2282-2297 | rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:63-76 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3368 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3368-3381 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3830-3844 — 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) rust_port/crates/flow_typing_statement/src/react_rules.rs:1167 — rust_port/crates/flow_typing_statement/src/react_rules.rs:1167-1180 | rust_port/crates/flow_typing_statement/src/react_rules.rs:1185-1198 — 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:1848 — rust_port/crates/flow_common_ty/src/ty_printer.rs:1848-1861 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1867-1881 — 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) rust_port/crates/flow_typing_statement/src/react_rules.rs:1898 — rust_port/crates/flow_typing_statement/src/react_rules.rs:1898-1916 | rust_port/crates/flow_typing_statement/src/react_rules.rs:1921-1934 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11263 — rust_port/crates/flow_parser/src/ast_visitor.rs:11263-11276 | rust_port/crates/flow_parser/src/ast_visitor.rs:12015-12028 — 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:757 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:757-772 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:782-795 — 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) rust_port/crates/flow_aloc/src/lib.rs:86 — rust_port/crates/flow_aloc/src/lib.rs:86-99 | rust_port/crates/flow_aloc/src/lib.rs:103-116 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8012 — rust_port/crates/flow_parser/src/ast_visitor.rs:8012-8028 | rust_port/crates/flow_parser/src/ast_visitor.rs:8066-8079 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:5289 — rust_port/crates/flow_parser/src/statement_parser.rs:5289-5302 | rust_port/crates/flow_parser/src/statement_parser.rs:5333-5346 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4609 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4609-4622 | rust_port/crates/flow_parser/src/ast_visitor.rs:17215-17228 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×18
  • Edited copy of a member (19 corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5351 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5351-5369 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5375-5393 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:1359 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1359-1377 | rust_port/crates/flow_parser_wasm/src/serializer.rs:1965-1986 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:675 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:675-694 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:762-780 — 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) rust_port/crates/flow_common_vcs/src/git.rs:81 — rust_port/crates/flow_common_vcs/src/git.rs:81-99 | rust_port/crates/flow_common_vcs/src/hg.rs:90-117 — 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) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:133 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:133-151 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:182-200 — 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) rust_port/crates/flow_logging_utils/src/lib.rs:85 — rust_port/crates/flow_logging_utils/src/lib.rs:85-103 | rust_port/crates/flow_server/src/server_daemon.rs:200-221 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1516 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1516-1534 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:4291-4316 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6316 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6316-6342 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6567-6585 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9925 — rust_port/crates/flow_parser/src/ast_visitor.rs:9925-9943 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4076-4094 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14690 — rust_port/crates/flow_parser/src/ast_visitor.rs:14690-14710 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1412-1430 — 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) rust_port/crates/flow_server_monitor/src/file_watcher.rs:507 — rust_port/crates/flow_server_monitor/src/file_watcher.rs:507-525 | rust_port/crates/flow_server_monitor/src/file_watcher.rs:1219-1239 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9307 — rust_port/crates/flow_parser/src/ast_visitor.rs:9307-9325 | rust_port/crates/flow_parser/src/ast_visitor.rs:18567-18585 — 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) rust_port/crates/flow_typing/src/typed_ast_finder.rs:833 — rust_port/crates/flow_typing/src/typed_ast_finder.rs:833-851 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1268-1286 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8858 — rust_port/crates/flow_parser/src/ast_visitor.rs:8858-8876 | rust_port/crates/flow_parser/src/ast_visitor.rs:18725-18744 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:16131 — rust_port/crates/flow_parser/src/ast_visitor.rs:16131-16149 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2107-2130 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1728 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1728-1746 | rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:2388-2406 — 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) rust_port/crates/flow_parser_utils/src/ast_builder.rs:160 — rust_port/crates/flow_parser_utils/src/ast_builder.rs:160-178 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:189-207 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6775 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6775-6795 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6804-6822 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×17
  • Edited copy of a member (8 corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:2800 — rust_port/crates/flow_typing_type/src/type_.rs:2800-2807 | rust_port/crates/flow_typing_type/src/type_.rs:2871-2878 — 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) rust_port/crates/flow_typing_statement/src/component_params.rs:239 — rust_port/crates/flow_typing_statement/src/component_params.rs:239-246 | rust_port/crates/flow_typing_statement/src/func_params.rs:136-144 — 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) rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:138 — rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:138-145 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1707-1716 — 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) rust_port/crates/flow_parser_utils_output/src/replacement_printer.rs:51 — rust_port/crates/flow_parser_utils_output/src/replacement_printer.rs:51-58 | rust_port/crates/flow_parser_utils_output/src/replacement_printer.rs:92-99 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:1191 — rust_port/crates/flow_typing_statement/src/statement.rs:1191-1211 | rust_port/crates/flow_typing_statement/src/statement.rs:14384-14391 — 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) rust_port/crates/flow_heap/src/resolved_requires.rs:188 — rust_port/crates/flow_heap/src/resolved_requires.rs:188-196 | rust_port/crates/flow_heap/src/resolved_requires.rs:198-205 — 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) rust_port/crates/flow_cli/src/codemod_command.rs:396 — rust_port/crates/flow_cli/src/codemod_command.rs:396-403 | rust_port/crates/flow_cli/src/codemod_command.rs:665-673 — 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) rust_port/crates/flow_server_env/src/server_orchestrator.rs:527 — rust_port/crates/flow_server_env/src/server_orchestrator.rs:527-534 | rust_port/crates/flow_server_env/src/server_orchestrator.rs:557-568 — 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) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:1127 — rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:1127-1134 | rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:1139-1146 — 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) rust_port/crates/flow_common/src/reason.rs:727 — rust_port/crates/flow_common/src/reason.rs:727-734 | rust_port/crates/flow_common/src/reason.rs:745-752 — 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) rust_port/crates/flow_typing_type/src/type_.rs:7267 — rust_port/crates/flow_typing_type/src/type_.rs:7267-7276 | rust_port/crates/flow_typing_type/src/type_.rs:7278-7285 — 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) rust_port/crates/flow_cli/src/init_command.rs:49 — rust_port/crates/flow_cli/src/init_command.rs:49-57 | rust_port/crates/flow_command_utils/src/lib.rs:812-819 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10027 — rust_port/crates/flow_parser/src/ast_visitor.rs:10027-10034 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4162-4175 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6213 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6213-6220 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4526-4538 — 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) rust_port/crates/flow_services_autocomplete/src/find_documentation.rs:381 — rust_port/crates/flow_services_autocomplete/src/find_documentation.rs:381-810 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15473-15480 — 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) rust_port/crates/flow_parser/src/file_key.rs:221 — rust_port/crates/flow_parser/src/file_key.rs:221-228 | rust_port/crates/flow_saved_state/src/saved_state.rs:386-393 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:1485 — rust_port/crates/flow_analysis/src/scope_builder.rs:1485-1492 | rust_port/crates/flow_data_structure_wrapper/src/multi_level_map.rs:35-42 — 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.
D2 · Cognitive Complexity · flow_services_code_action · ×16
  • flow_services_code_action::code_action_service::ast_transforms_of_error (cognitive 154) rust_port/crates/flow_services_code_action/src/code_action_service.rs:1106 — flow_services_code_action::code_action_service::ast_transforms_of_error has cognitive complexity 154 (threshold 15). Drivers by points: if/else 86 (132 pts), match/switch 10 (21 pts), boolean chains 1 (nesting depth added 57). 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_statement (cognitive 37) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:203 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_statement has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 3 (8 pts), loops 3 (7 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.
  • flow_services_code_action::refactor_extract::extract_from_expression_refactors (cognitive 34) rust_port/crates/flow_services_code_action/src/refactor_extract.rs:982 — flow_services_code_action::refactor_extract::extract_from_expression_refactors has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (9 pts), 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.
  • flow_services_code_action::refactor_extract_utils::variable_analysis::collect_relevant_defs_with_scope (cognitive 33) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:844 — flow_services_code_action::refactor_extract_utils::variable_analysis::collect_relevant_defs_with_scope has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (11 pts), loops 4 (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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_expression (cognitive 32) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:371 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_expression has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (15 pts), loops 6 (13 pts), if/else 2 (4 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_expression (cognitive 29) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:831 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_expression has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 5 (14 pts), loops 4 (8 pts), if/else 2 (7 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_code_action::autofix_imports::update_import (cognitive 28) rust_port/crates/flow_services_code_action/src/autofix_imports.rs:317 — flow_services_code_action::autofix_imports::update_import has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (6 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_code_action::code_action_service::autofix_imports_fn (cognitive 28) rust_port/crates/flow_services_code_action/src/code_action_service.rs:2962 — flow_services_code_action::code_action_service::autofix_imports_fn has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (19 pts), match/switch 4 (9 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_statement (cognitive 22) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:736 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_statement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_class_body (cognitive 21) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:553 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_class_body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 2 (7 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.
  • flow_services_code_action::autofix_missing_local_annots::map_of_fixable_missing_local_params (cognitive 21) rust_port/crates/flow_services_code_action/src/autofix_missing_local_annots.rs:29 — flow_services_code_action::autofix_missing_local_annots::map_of_fixable_missing_local_params has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 2 (8 pts), loops 1 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_code_action::refactor_extract::create_extracted_function_call (cognitive 21) rust_port/crates/flow_services_code_action/src/refactor_extract.rs:249 — flow_services_code_action::refactor_extract::create_extracted_function_call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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.
  • flow_services_code_action::stub_unbound_name::stub (cognitive 19) rust_port/crates/flow_services_code_action/src/stub_unbound_name.rs:139 — flow_services_code_action::stub_unbound_name::stub has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 5, loops 3, boolean chains 1 (nesting depth added 5). 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_class (cognitive 18) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:630 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_class has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (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.
  • flow_services_code_action::refactor_extract_utils::variable_analysis::collect_escaping_local_defs (cognitive 17) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:947 — flow_services_code_action::refactor_extract_utils::variable_analysis::collect_escaping_local_defs has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (9 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). 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.
  • flow_services_code_action::document_paste::provide_document_paste_edits (cognitive 16) rust_port/crates/flow_services_code_action/src/document_paste.rs:298 — flow_services_code_action::document_paste::provide_document_paste_edits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×16
  • Edited copy of a member (18 corresponding lines) rust_port/crates/flow_profiling/src/profiling_js.rs:166 — rust_port/crates/flow_profiling/src/profiling_js.rs:166-183 | rust_port/crates/flow_profiling/src/profiling_js.rs:185-202 — 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) rust_port/crates/flow_typing_type/src/type_.rs:8772 — rust_port/crates/flow_typing_type/src/type_.rs:8772-8789 | rust_port/crates/flow_typing_type/src/type_.rs:8794-8811 — 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) rust_port/crates/flow_env_builder/src/find_providers.rs:852 — rust_port/crates/flow_env_builder/src/find_providers.rs:852-869 | rust_port/crates/flow_env_builder/src/find_providers.rs:1313-1337 — 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) rust_port/crates/flow_parser/src/type_parser.rs:1907 — rust_port/crates/flow_parser/src/type_parser.rs:1907-1924 | rust_port/crates/flow_parser/src/type_parser.rs:2039-2056 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:89 — rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:89-106 | rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:111-134 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:513 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:513-530 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:558-587 — 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) rust_port/crates/flow_parser/src/jsx_parser.rs:53 — rust_port/crates/flow_parser/src/jsx_parser.rs:53-70 | rust_port/crates/flow_parser/src/jsx_parser.rs:85-107 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4790 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4790-4810 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5318-5335 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:14600 — rust_port/crates/flow_parser/src/ast_visitor.rs:14600-14617 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:1161-1178 — 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) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:679 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:679-702 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:726-743 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:1305 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:1305-1322 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:1330-1349 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7328 — rust_port/crates/flow_parser/src/ast_visitor.rs:7328-7345 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5625-5648 — 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) rust_port/crates/flow_type_sig/src/type_sig.rs:553 — rust_port/crates/flow_type_sig/src/type_sig.rs:553-576 | rust_port/crates/flow_type_sig/src/type_sig.rs:668-685 — 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) rust_port/crates/flow_typing_errors/src/flow_error.rs:182 — rust_port/crates/flow_typing_errors/src/flow_error.rs:182-199 | rust_port/crates/flow_typing_errors/src/flow_error.rs:375-392 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8179 — rust_port/crates/flow_parser/src/ast_visitor.rs:8179-8201 | rust_port/crates/flow_parser/src/ast_visitor.rs:8663-8680 — 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) rust_port/crates/flow_cli/src/apply_code_action_command.rs:385 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:385-408 | rust_port/crates/flow_cli/src/graph_command.rs:126-143 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×16
  • Duplicated block (22 lines × 2) rust_port/crates/flow_common/src/hint.rs:216 — rust_port/crates/flow_common/src/hint.rs:216-237 | rust_port/crates/flow_common/src/hint.rs:285-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) rust_port/crates/flow_env_builder/src/find_providers.rs:2137 — rust_port/crates/flow_env_builder/src/find_providers.rs:2137-2158 | rust_port/crates/flow_env_builder/src/find_providers.rs:2180-2201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/find_providers.rs:2137` 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) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2060 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2060-2081 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2110-2131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2060` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:183 — rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:183-204 | rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:235-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:183` 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) rust_port/crates/flow_services_inference/src/type_service.rs:3825 — rust_port/crates/flow_services_inference/src/type_service.rs:3825-3846 | rust_port/crates/flow_services_inference/src/type_service.rs:3934-3955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_inference/src/type_service.rs:3825` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10700 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10700-10721 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10836-10857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10700` 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) rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:836 — rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:836-857 | rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:893-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/renders_kit.rs:836` 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) rust_port/crates/flow_typing_statement/src/statement.rs:17265 — rust_port/crates/flow_typing_statement/src/statement.rs:17265-17286 | rust_port/crates/flow_typing_statement/src/statement.rs:17594-17615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:17265` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:18434 — rust_port/crates/flow_typing_statement/src/statement.rs:18434-18455 | rust_port/crates/flow_typing_statement/src/statement.rs:18607-18628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:18434` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_type/src/type_.rs:9736 — rust_port/crates/flow_typing_type/src/type_.rs:9736-9757 | rust_port/crates/flow_typing_type/src/type_.rs:9829-9850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:9736` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3813 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3813-3834 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3886-3907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) rust_port/crates/flow_typing_utils/src/type_filter.rs:1092 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1092-1113 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1139-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_filter.rs:1092` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1186 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1186-1207 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1239-1260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_filter.rs:1186` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1316 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1316-1337 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1363-1384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_filter.rs:1316` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1412 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1412-1433 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1459-1480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_filter.rs:1412` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1705 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1705-1726 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1763-1784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1705` 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 (16–17 lines × 2) · ×16
  • Duplicated block (16–17 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:2336 — rust_port/crates/flow_parser/src/statement_parser.rs:2336-2351 | rust_port/crates/flow_parser/src/statement_parser.rs:2385-2401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:2336` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) rust_port/crates/flow_parser_utils/src/type_param_analysis.rs:57 — rust_port/crates/flow_parser_utils/src/type_param_analysis.rs:57-72 | rust_port/crates/flow_parser_utils/src/type_param_analysis.rs:214-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 `rust_port/crates/flow_parser_utils/src/type_param_analysis.rs: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 (16–17 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:2271 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2271-2287 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2475-2490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs: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 (16–17 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8976 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8976-8991 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9000-9016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8976` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4319 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4319-4334 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4346-4362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4319` it does not close everything it opens, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5581 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5581-5597 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5664-5679 — both copies are in the same file, so extract the 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 (16–17 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9166 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9166-9181 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9182-9198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9182` it does not close everything it opens, so those 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4880 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4880-4896 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4922-4937 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4938` calls `Some`, `continue_` and `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4897` 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 (16–17 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6594 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6594-6609 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6660-6676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6594` it does not close everything it opens, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:4372 — rust_port/crates/flow_typing_statement/src/statement.rs:4372-4387 | rust_port/crates/flow_typing_statement/src/statement.rs:4489-4505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:4372` it does not close everything it opens, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_statement/src/type_annotation.rs:3422 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:3422-3438 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3464-3479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:3422` 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–17 lines × 2) rust_port/crates/flow_typing_type/src/type_.rs:6147 — rust_port/crates/flow_typing_type/src/type_.rs:6147-6162 | rust_port/crates/flow_typing_type/src/type_.rs:6233-6249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:6147` it does not close everything it opens, so those 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1222 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1222-1237 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1248-1264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs: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 (16–17 lines × 2) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2882 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2882-2897 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2908-2924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2882` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2900 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2900-2916 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3169-3184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2900` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4824 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4824-4840 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5551-5566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4824` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×16
  • Duplicated block (7 lines × 3) rust_port/crates/flow_parser/src/object_parser.rs:1091 — rust_port/crates/flow_parser/src/object_parser.rs:1091-1097 | rust_port/crates/flow_parser/src/object_parser.rs:1166-1172 | rust_port/crates/flow_parser/src/object_parser.rs:1860-1866 — 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 `rust_port/crates/flow_parser/src/object_parser.rs: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.
  • Duplicated block (7 lines × 3) rust_port/crates/flow_parser/src/object_parser.rs:2080 — rust_port/crates/flow_parser/src/object_parser.rs:2080-2086 | rust_port/crates/flow_parser/src/object_parser.rs:2096-2102 | rust_port/crates/flow_parser/src/object_parser.rs:2112-2118 — 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 `rust_port/crates/flow_parser/src/object_parser.rs:2080` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14998 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14998-15004 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15010-15016 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:15022-15028 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14998` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) rust_port/crates/flow_typing/src/ty_normalizer_flow.rs:97 — rust_port/crates/flow_typing/src/ty_normalizer_flow.rs:97-103 | rust_port/crates/flow_typing_utils/src/type_hint.rs:1112-1118 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1051-1057 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8540 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8540-8546 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8571-8577 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8590-8596 — 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) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3304 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3304-3310 | rust_port/crates/flow_typing_flow_js/src/intersection_kit.rs:117-123 | rust_port/crates/flow_typing_flow_js/src/intersection_kit/objects.rs:199-205 — 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 `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3304` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:7898 — rust_port/crates/flow_typing_statement/src/statement.rs:7898-7904 | rust_port/crates/flow_typing_statement/src/statement.rs:8376-8382 | rust_port/crates/flow_typing_statement/src/statement.rs:8926-8932 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:7898` 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 (7 lines × 3) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:275 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:275-281 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:617-623 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:928-934 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1130 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1130-1136 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1187-1193 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1265-1271 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1130` 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 (7 lines × 3) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5602 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5602-5608 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5690-5696 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5712-5718 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5602` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_common/src/hint.rs:238 — rust_port/crates/flow_common/src/hint.rs:238-244 | rust_port/crates/flow_common/src/hint.rs:245-251 | rust_port/crates/flow_common/src/hint.rs:270-276 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8493 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8493-8499 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8504-8510 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8592-8598 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8804 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8804-8810 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8842-8848 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8939-8945 — 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) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:462 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:462-468 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:471-477 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:480-486 — 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 (7 lines × 3) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:531 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:531-537 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:539-545 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:548-554 — 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 (7 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8390 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8390-8396 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8703-8709 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9105-9111 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×16
  • Low cohesion: FindDeclarations (LCOM4 31) rust_port/crates/flow_env_builder/src/find_providers.rs:1066 — FindDeclarations's methods fall into 31 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 31 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: FindProviders (LCOM4 25) rust_port/crates/flow_env_builder/src/find_providers.rs:1753 — FindProviders's methods fall into 25 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 25 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: TrailingCommentsRemover (LCOM4 18) rust_port/crates/flow_parser/src/comment_attachment.rs:24 — TrailingCommentsRemover's methods fall into 18 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 18 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: ScopeBuilder (LCOM4 16) rust_port/crates/flow_analysis/src/scope_builder.rs:1496 — ScopeBuilder's methods fall into 16 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 16 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: NameResolver (LCOM4 14) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1734 — NameResolver's methods fall into 14 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 14 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: SsaBuilder (LCOM4 13) rust_port/crates/flow_analysis/src/ssa_builder.rs:478 — SsaBuilder's methods fall into 13 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 13 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: TypedParse (LCOM4 8) rust_port/crates/flow_heap/src/parse.rs:155 — TypedParse's methods fall into 8 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 8 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: UseVisitor (LCOM4 7) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:244 — UseVisitor's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: StripFlow (LCOM4 6) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:26 — StripFlow's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ExtractedInformationCollector (LCOM4 6) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:40 — ExtractedInformationCollector's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DeadCodeMarker (LCOM4 5) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12038 — DeadCodeMarker's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DefFinder (LCOM4 4) rust_port/crates/flow_env_builder/src/name_def.rs:1724 — DefFinder's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ProcessRequestSearcher (LCOM4 4) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:346 — ProcessRequestSearcher's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Searcher (LCOM4 4) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:113 — Searcher's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Substituter (LCOM4 4) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:450 — Substituter's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Op (LCOM4 4) rust_port/crates/flow_typing_type/src/type_.rs:11028 — Op's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · flow_typing · ×15
  • flow_typing::env_resolution::resolve_binding (cyclomatic 58) rust_port/crates/flow_typing/src/env_resolution.rs:1306 — flow_typing::env_resolution::resolve_binding has cyclomatic complexity 58 (threshold 15). Of this number, 43 points are the body's own statements and 15 belong to 2 function items inside it that branch. 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.
  • flow_typing::merge::check_conditional (cyclomatic 51) rust_port/crates/flow_typing/src/merge.rs:755 — flow_typing::merge::check_conditional 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.
  • flow_typing::merge::try_eval_concrete_type_truthyness (cyclomatic 46) rust_port/crates/flow_typing/src/merge.rs:494 — flow_typing::merge::try_eval_concrete_type_truthyness 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.
  • flow_typing::ty_members::members_of_ty (cyclomatic 40) rust_port/crates/flow_typing/src/ty_members.rs:96 — flow_typing::ty_members::members_of_ty has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 6 of the 40 points are its own statements and the rest belongs to 8 function items inside it that branch (union_of_members, members_of_union, intersection_of_members, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing::type_inference::stmt_validator (cyclomatic 40) rust_port/crates/flow_typing/src/type_inference.rs:990 — flow_typing::type_inference::stmt_validator has cyclomatic complexity 40 (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.
  • flow_typing::type_inference::scan_for_lint_suppressions (cyclomatic 39) rust_port/crates/flow_typing/src/type_inference.rs:136 — flow_typing::type_inference::scan_for_lint_suppressions has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 2 of the 39 points are its own statements and the rest belongs to 12 function items inside it that branch (process_comment, update_pos, parse_keyword::prefix_length, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing::merge::detect_sketchy_null_checks::make_checks (cyclomatic 35) rust_port/crates/flow_typing/src/merge.rs:222 — flow_typing::merge::detect_sketchy_null_checks::make_checks 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 shape REPEATS in the file: one other method here (flow_typing::merge::detect_sketchy_null_checks) 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.
  • flow_typing::env_resolution::resolve (cyclomatic 32) rust_port/crates/flow_typing/src/env_resolution.rs:2882 — flow_typing::env_resolution::resolve has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • flow_typing::query_types::type_at_pos_type (cyclomatic 25) rust_port/crates/flow_typing/src/query_types.rs:479 — flow_typing::query_types::type_at_pos_type 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.
  • flow_typing::merge::detect_sketchy_null_checks (cyclomatic 24) rust_port/crates/flow_typing/src/merge.rs:139 — flow_typing::merge::detect_sketchy_null_checks 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 shape REPEATS in the file: one other method here (flow_typing::merge::detect_sketchy_null_checks::make_checks) 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.
  • flow_typing::env_resolution::resolve_component_type_params (cyclomatic 20) rust_port/crates/flow_typing/src/env_resolution.rs:3392 — flow_typing::env_resolution::resolve_component_type_params 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.
  • flow_typing::merge::check_multiplatform_conformance (cyclomatic 18) rust_port/crates/flow_typing/src/merge.rs:1503 — flow_typing::merge::check_multiplatform_conformance 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.
  • flow_typing::merge::check_strict_comparison (cyclomatic 17) rust_port/crates/flow_typing/src/merge.rs:1049 — flow_typing::merge::check_strict_comparison has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
  • flow_typing::env_resolution::resolve_hint (cyclomatic 16) rust_port/crates/flow_typing/src/env_resolution.rs:522 — flow_typing::env_resolution::resolve_hint has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (resolve_hint_node). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing::env_resolution::entries_of_def (cyclomatic 16) rust_port/crates/flow_typing/src/env_resolution.rs:3137 — flow_typing::env_resolution::entries_of_def has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · flow_typing · ×15
  • flow_typing::env_resolution::resolve_binding (cognitive 86) rust_port/crates/flow_typing/src/env_resolution.rs:1306 — flow_typing::env_resolution::resolve_binding has cognitive complexity 86 (threshold 15). Drivers by points: if/else 23 (40 pts), match/switch 16 (36 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 43). Of this number, 75 points are the body's own statements and 11 belong to 2 function items inside it that branch. 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.
  • flow_typing::merge::check_multiplatform_conformance (cognitive 63) rust_port/crates/flow_typing/src/merge.rs:1503 — flow_typing::merge::check_multiplatform_conformance has cognitive complexity 63 (threshold 15). Drivers by points: if/else 8 (36 pts), loops 3 (14 pts), match/switch 5 (11 pts), boolean chains 2 (nesting depth added 45). 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.
  • flow_typing::merge::detect_sketchy_null_checks (cognitive 54) rust_port/crates/flow_typing/src/merge.rs:139 — flow_typing::merge::detect_sketchy_null_checks has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (51 pts), match/switch 16 (39 pts), loops 4 (9 pts), boolean chains 1 (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. This shape REPEATS in the file: one other method here (flow_typing::merge::detect_sketchy_null_checks::make_checks) 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.
  • flow_typing::ty_members::members_of_ty (cognitive 43) rust_port/crates/flow_typing/src/ty_members.rs:96 — flow_typing::ty_members::members_of_ty has cognitive complexity 43 (threshold 15). Drivers by points: loops 12 (16 pts), if/else 9 (12 pts), match/switch 6 (9 pts), boolean chains 6 (nesting depth added 10). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 8 function items inside it that branch (intersection_of_members, union_of_members, members_of_union, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing::query_types::type_at_pos_type (cognitive 38) rust_port/crates/flow_typing/src/query_types.rs:479 — flow_typing::query_types::type_at_pos_type has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 9 (19 pts), if/else 8 (18 pts), boolean chains 1 (nesting depth added 20). 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.
  • flow_typing::merge::check_conditional (cognitive 37) rust_port/crates/flow_typing/src/merge.rs:755 — flow_typing::merge::check_conditional has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 8 (17 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.
  • flow_typing::env_resolution::merge_with_conflicts (cognitive 31) rust_port/crates/flow_typing/src/env_resolution.rs:2611 — flow_typing::env_resolution::merge_with_conflicts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 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.
  • flow_typing::merge::detect_sketchy_null_checks::make_checks (cognitive 30) rust_port/crates/flow_typing/src/merge.rs:222 — flow_typing::merge::detect_sketchy_null_checks::make_checks has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 14 (24 pts), if/else 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). 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. This shape REPEATS in the file: one other method here (flow_typing::merge::detect_sketchy_null_checks) 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.
  • flow_typing::merge::try_eval_concrete_type_truthyness (cognitive 27) rust_port/crates/flow_typing/src/merge.rs:494 — flow_typing::merge::try_eval_concrete_type_truthyness has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 6 (11 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.
  • flow_typing::type_inference::scan_for_lint_suppressions::process_comment (cognitive 26) rust_port/crates/flow_typing/src/type_inference.rs:473 — flow_typing::type_inference::scan_for_lint_suppressions::process_comment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 1 (3 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.
  • flow_typing::env_resolution::resolve_component (cognitive 25) rust_port/crates/flow_typing/src/env_resolution.rs:3543 — flow_typing::env_resolution::resolve_component has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 5 (8 pts), 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.
  • flow_typing::env_resolution::resolve_component_type_params (cognitive 24) rust_port/crates/flow_typing/src/env_resolution.rs:3392 — flow_typing::env_resolution::resolve_component_type_params has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 6 (8 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.
  • flow_typing::type_inference::stmt_validator (cognitive 21) rust_port/crates/flow_typing/src/type_inference.rs:990 — flow_typing::type_inference::stmt_validator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 3 (4 pts), boolean chains 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.
  • flow_typing::merge::detect_non_voidable_properties (cognitive 19) rust_port/crates/flow_typing/src/merge.rs:1371 — flow_typing::merge::detect_non_voidable_properties has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (5 pts), loops 3 (5 pts) (nesting depth added 9). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function items inside it that branch (check_properties, is_voidable). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing::env_resolution::resolve_import (cognitive 17) rust_port/crates/flow_typing/src/env_resolution.rs:2405 — flow_typing::env_resolution::resolve_import has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 2 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×15
  • Edited copy of a member (20 corresponding lines) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12570 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12570-12598 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12604-12626 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:4771 — rust_port/crates/flow_typing_statement/src/statement.rs:4771-4790 | rust_port/crates/flow_typing_statement/src/statement.rs:4977-5007 — 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) rust_port/crates/flow_services_references/src/rename_mapper.rs:243 — rust_port/crates/flow_services_references/src/rename_mapper.rs:243-264 | rust_port/crates/flow_services_references/src/rename_mapper.rs:266-285 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2283 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2283-2302 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:4894-4917 — 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) rust_port/crates/flow_cli/src/check_contents_command.rs:23 — rust_port/crates/flow_cli/src/check_contents_command.rs:23-50 | rust_port/crates/flow_cli/src/foreground_check_commands.rs:325-344 — 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) rust_port/crates/flow_server_env/src/collated_errors.rs:163 — rust_port/crates/flow_server_env/src/collated_errors.rs:163-192 | rust_port/crates/flow_server_env/src/server_env.rs:106-125 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:196 — rust_port/crates/flow_analysis/src/property_assignment.rs:196-215 | rust_port/crates/flow_analysis/src/ssa_builder.rs:771-790 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3581 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3581-3606 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3850-3869 — 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) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:337 — rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:337-359 | rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:363-382 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6386 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6386-6405 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6409-6429 — 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) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:757 — rust_port/crates/flow_typing_visitors/src/type_mapper.rs:757-776 | rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1658-1677 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8734 — rust_port/crates/flow_parser/src/ast_visitor.rs:8734-8753 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6134-6154 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8321 — rust_port/crates/flow_parser/src/ast_visitor.rs:8321-8341 | rust_port/crates/flow_parser/src/ast_visitor.rs:9101-9120 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4242 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4242-4262 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4272-4291 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6638 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6638-6659 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:6834-6853 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×15
  • Duplicated block (12–13 lines × 2) rust_port/crates/flow_cli/src/coverage_command.rs:415 — rust_port/crates/flow_cli/src/coverage_command.rs:415-427 | rust_port/crates/flow_cli/src/dump_types_command.rs:216-227 — before extracting anything, compare `rust_port/crates/flow_cli/src/coverage_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` 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 `rust_port/crates/flow_cli/src/coverage_command.rs:415` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_cli/src/dump_types_command.rs:215` calls `content_of_file_input`, `ok`, `guess_root` and `rust_port/crates/flow_cli/src/coverage_command.rs:415` 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–13 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:1071 — rust_port/crates/flow_cli/src/glean_runner.rs:1071-1082 | rust_port/crates/flow_cli/src/glean_runner.rs:1136-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:1071` 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–13 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2279 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2279-2291 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2320-2331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2279` it begins part-way through the construct above it, so those 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–13 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:3059 — rust_port/crates/flow_parser_wasm/src/serializer.rs:3059-3071 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4021-4032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:3059` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5740 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5740-5751 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5861-5873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5740` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11850 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11850-11862 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12929-12940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11850` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:737 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:737-749 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:779-790 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:737` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10730 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10730-10742 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10880-10891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10730` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10878` calls `msg_with_locs`, `clone` and `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10730` 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–13 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8379 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8379-8391 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8438-8449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8377` calls `DefT`, `ArrT`, `GenericT` and `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10866 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10866-10878 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10883-10894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10866` it begins part-way through the construct above it, so those 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–13 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2499 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2499-2511 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2702-2713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2499` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:17372 — rust_port/crates/flow_typing_statement/src/statement.rs:17372-17384 | rust_port/crates/flow_typing_statement/src/statement.rs:17693-17704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:17372` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:19945 — rust_port/crates/flow_typing_statement/src/statement.rs:19945-19956 | rust_port/crates/flow_typing_statement/src/statement.rs:20425-20437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:19945` 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:812 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:812-823 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:825-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:812` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1214 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1214-1225 | rust_port/crates/flow_services_get_def/src/get_def_utils.rs:249-261 — 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 `rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×15
  • Duplicated block (5 lines × 3) rust_port/crates/flow_cli/src/autocomplete_command.rs:161 — rust_port/crates/flow_cli/src/autocomplete_command.rs:161-165 | rust_port/crates/flow_cli/src/get_def_command.rs:64-68 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:250-254 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_cli/src/get_def_command.rs:71` calls `get`, `optional`, `unwrap` and `rust_port/crates/flow_cli/src/autocomplete_command.rs:167` 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7714 — rust_port/crates/flow_parser/src/ast_visitor.rs:7714-7718 | rust_port/crates/flow_parser/src/ast_visitor.rs:7851-7855 | rust_port/crates/flow_parser/src/ast_visitor.rs:7950-7954 — 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 (5 lines × 3) rust_port/crates/flow_parser/src/enum_parser.rs:196 — rust_port/crates/flow_parser/src/enum_parser.rs:196-200 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:327-332 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:582-587 — 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 `rust_port/crates/flow_parser/src/enum_parser.rs: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. 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 × 3) rust_port/crates/flow_parser/src/flow_lexer.rs:1205 — rust_port/crates/flow_parser/src/flow_lexer.rs:1205-1211 | rust_port/crates/flow_parser/src/flow_lexer.rs:1231-1237 | rust_port/crates/flow_parser/src/flow_lexer.rs:1275-1279 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:1205` 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 (5 lines × 3) rust_port/crates/flow_parser/src/object_parser.rs:318 — rust_port/crates/flow_parser/src/object_parser.rs:318-322 | rust_port/crates/flow_parser/src/object_parser.rs:1258-1262 | rust_port/crates/flow_parser/src/object_parser.rs:1833-1838 — 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 (5 lines × 3) rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795-1799 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2025-2032 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2156-2161 — 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 `rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795` it does not close everything it opens, so those 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 × 3) rust_port/crates/flow_typing_statement/src/destructuring.rs:115 — rust_port/crates/flow_typing_statement/src/destructuring.rs:115-119 | rust_port/crates/flow_typing_statement/src/destructuring.rs:176-181 | rust_port/crates/flow_typing_statement/src/destructuring.rs:227-231 — 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 `rust_port/crates/flow_typing_statement/src/destructuring.rs:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:8219 — rust_port/crates/flow_typing_statement/src/statement.rs:8219-8223 | rust_port/crates/flow_typing_statement/src/statement.rs:11204-11208 | rust_port/crates/flow_typing_statement/src/statement.rs:21742-21746 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:8219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2079 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2079-2083 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2100-2104 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4690-4694 — 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 (5 lines × 3) rust_port/crates/flow_parser/src/flow_lexer.rs:1366 — rust_port/crates/flow_parser/src/flow_lexer.rs:1366-1370 | rust_port/crates/flow_parser/src/flow_lexer.rs:1616-1620 | rust_port/crates/flow_parser/src/flow_lexer.rs:1627-1631 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:1366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:130 — rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:130-134 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:152-156 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:174-178 — 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 `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) rust_port/crates/flow_common_ty/src/ty.rs:3514 — rust_port/crates/flow_common_ty/src/ty.rs:3514-3518 | rust_port/crates/flow_common_ty/src/ty.rs:3522-3526 | rust_port/crates/flow_common_ty/src/ty.rs:3530-3534 — 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 (5 lines × 3) rust_port/crates/flow_server_monitor/src/file_watcher.rs:619 — rust_port/crates/flow_server_monitor/src/file_watcher.rs:619-623 | rust_port/crates/flow_server_monitor/src/file_watcher.rs:1356-1360 | rust_port/crates/flow_server_monitor/src/file_watcher.rs:1569-1573 — 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 `rust_port/crates/flow_server_monitor/src/file_watcher.rs:619` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_server_monitor/src/file_watcher.rs:1354` calls `clone` and `rust_port/crates/flow_server_monitor/src/file_watcher.rs:1568` 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 × 3) rust_port/crates/flow_services_inference/src/type_service.rs:204 — rust_port/crates/flow_services_inference/src/type_service.rs:204-208 | rust_port/crates/flow_services_inference/src/type_service.rs:209-213 | rust_port/crates/flow_services_inference/src/type_service.rs:214-218 — 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 (5 lines × 3) rust_port/crates/flow_typing_type/src/type_util.rs:1531 — rust_port/crates/flow_typing_type/src/type_util.rs:1531-1535 | rust_port/crates/flow_typing_type/src/type_util.rs:1596-1600 | rust_port/crates/flow_typing_type/src/type_util.rs:1611-1615 — 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 `rust_port/crates/flow_typing_type/src/type_util.rs:1531` 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.
D1 · Cyclomatic Complexity · flow_typing_flow_common · ×14
  • flow_typing_flow_common::flow_js_utils::primary_reason_of_use_op (cyclomatic 39) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1761 — flow_typing_flow_common::flow_js_utils::primary_reason_of_use_op has cyclomatic complexity 39 (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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::error_message_kind_of_upper (cyclomatic 35) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1593 — flow_typing_flow_common::flow_js_utils::error_message_kind_of_upper 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::array_elem_check (cyclomatic 25) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8204 — flow_typing_flow_common::flow_js_utils::array_elem_check 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::value_to_type_reference_transform::run_on_concrete_type_with_env (cyclomatic 23) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4257 — flow_typing_flow_common::flow_js_utils::value_to_type_reference_transform::run_on_concrete_type_with_env 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::flow_arith (cyclomatic 22) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9213 — flow_typing_flow_common::flow_js_utils::flow_arith has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::concrete_type_eq::eq_with_env (cyclomatic 19) rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:197 — flow_typing_flow_common::concrete_type_eq::eq_with_env 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.
  • flow_typing_flow_common::flow_js_utils::propref_for_elem_t_with_env (cyclomatic 19) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8505 — flow_typing_flow_common::flow_js_utils::propref_for_elem_t_with_env 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::concrete_type_eq::eq_swap_reason (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:120 — flow_typing_flow_common::concrete_type_eq::eq_swap_reason 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.
  • flow_typing_flow_common::flow_js_utils::collect_prototype_t::go (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:357 — flow_typing_flow_common::flow_js_utils::collect_prototype_t::go 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::is_builtin_class_id (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3245 — flow_typing_flow_common::flow_js_utils::is_builtin_class_id 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::wraps_utility_type::loop_inner (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9412 — flow_typing_flow_common::flow_js_utils::wraps_utility_type::loop_inner 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. This is NOT this file's highest cyclomatic complexity: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::import_named_t_kit::on_module_t_with_env (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5525 — flow_typing_flow_common::flow_js_utils::import_named_t_kit::on_module_t_with_env 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. This is NOT this file's highest cyclomatic complexity: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::import_type_t_kit::canonicalize_imported_type (cyclomatic 17) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4635 — flow_typing_flow_common::flow_js_utils::import_type_t_kit::canonicalize_imported_type 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. This is NOT this file's highest cyclomatic complexity: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_flow_common::flow_js_utils::union_optimization_guard::union_optimization_guard_impl (cyclomatic 16) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2501 — flow_typing_flow_common::flow_js_utils::union_optimization_guard::union_optimization_guard_impl 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: flow_typing_flow_common::flow_js_utils::error_message_loc_of_upper (cyclomatic 52) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · flow_dev_tools · ×14
  • flow_dev_tools::runtests::check_annotate_exports::normal_diff (cognitive 47) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:84 — flow_dev_tools::runtests::check_annotate_exports::normal_diff has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 5 (13 pts), boolean chains 4, match/switch 1 (2 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.
  • flow_dev_tools::runtests::check_exec_file_promise::split_shell_args (cognitive 42) rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:51 — flow_dev_tools::runtests::check_exec_file_promise::split_shell_args has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 2, 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.
  • flow_dev_tools::comment::comment_mutator::expand_comment (cognitive 35) rust_port/crates/flow_dev_tools/src/comment/comment_mutator.rs:67 — flow_dev_tools::comment::comment_mutator::expand_comment has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 10, loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_dev_tools::update_suppressions::update_suppressions::runner (cognitive 33) rust_port/crates/flow_dev_tools/src/update_suppressions/update_suppressions.rs:442 — flow_dev_tools::update_suppressions::update_suppressions::runner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (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.
  • flow_dev_tools::runtests::check_website::render_snapshots (cognitive 30) rust_port/crates/flow_dev_tools/src/runtests/check_website.rs:160 — flow_dev_tools::runtests::check_website::render_snapshots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (7 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.
  • flow_dev_tools::update_suppressions::update_suppressions::get_errors_for_all_roots (cognitive 30) rust_port/crates/flow_dev_tools/src/update_suppressions/update_suppressions.rs:141 — flow_dev_tools::update_suppressions::update_suppressions::get_errors_for_all_roots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (11 pts), match/switch 1 (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.
  • flow_dev_tools::comment::comment_mutator::add_comment_to_text (cognitive 29) rust_port/crates/flow_dev_tools/src/comment/comment_mutator.rs:195 — flow_dev_tools::comment::comment_mutator::add_comment_to_text has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, loops 1 (2 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.
  • flow_dev_tools::runtests::check_annotate_exports::run_annotate_exports (cognitive 22) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:221 — flow_dev_tools::runtests::check_annotate_exports::run_annotate_exports has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 8, boolean chains 1, 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.
  • flow_dev_tools::update_suppressions::update_suppressions::update_suppressions_in_text (cognitive 22) rust_port/crates/flow_dev_tools/src/update_suppressions/update_suppressions.rs:314 — flow_dev_tools::update_suppressions::update_suppressions::update_suppressions_in_text has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 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.
  • flow_dev_tools::runtests::check_website::extract_blocks (cognitive 21) rust_port/crates/flow_dev_tools/src/runtests/check_website.rs:92 — flow_dev_tools::runtests::check_website::extract_blocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 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.
  • flow_dev_tools::comment::comment_mutator::format_comment (cognitive 20) rust_port/crates/flow_dev_tools/src/comment/comment_mutator.rs:365 — flow_dev_tools::comment::comment_mutator::format_comment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 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.
  • flow_dev_tools::comment::add_comments::add_comments_to_code (cognitive 18) rust_port/crates/flow_dev_tools/src/comment/add_comments.rs:167 — flow_dev_tools::comment::add_comments::add_comments_to_code has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_dev_tools::comment::get_context::get_context (cognitive 18) rust_port/crates/flow_dev_tools/src/comment/get_context.rs:22 — flow_dev_tools::comment::get_context::get_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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.
  • flow_dev_tools::runtests::check_annotate_exports::find_files (cognitive 16) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:30 — flow_dev_tools::runtests::check_annotate_exports::find_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (5 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×14
  • Duplicated block (9 lines × 3) rust_port/crates/flow_env_builder/src/name_def.rs:1285 — rust_port/crates/flow_env_builder/src/name_def.rs:1285-1293 | rust_port/crates/flow_env_builder/src/name_def.rs:1310-1318 | rust_port/crates/flow_env_builder/src/name_def.rs:1330-1338 — 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 (9 lines × 3) rust_port/crates/flow_parser/src/flow_lexer.rs:1090 — rust_port/crates/flow_parser/src/flow_lexer.rs:1090-1098 | rust_port/crates/flow_parser/src/flow_lexer.rs:2512-2520 | rust_port/crates/flow_parser/src/flow_lexer.rs:2704-2712 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:1090` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rust_port/crates/flow_parser_utils/src/enum_validate.rs:310 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:310-318 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:335-343 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:430-438 — 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 `rust_port/crates/flow_parser_utils/src/enum_validate.rs:310` 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:3856 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:3856-3864 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:5581-5589 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6556-6564 — 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 `rust_port/crates/flow_server_command_handler/src/command_handler.rs:3856` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1703 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1703-1711 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1804-1812 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1840-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.
  • Duplicated block (9 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:326 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:326-334 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:402-410 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:434-442 — 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 `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:326` 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, `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:323` calls `mark_loc`, `get_forced`, `mark_fun` and `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:433` 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8411 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8411-8419 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8724-8732 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9126-9134 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8411` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:251 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:251-259 | rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:339-347 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:272-280 — before extracting anything, compare `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs` and `rust_port/crates/flow_typing_statement/src/func_stmt_config.rs` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:260` calls `dupe` and `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:348` 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 × 3) rust_port/crates/flow_typing_statement/src/statement.rs:17376 — rust_port/crates/flow_typing_statement/src/statement.rs:17376-17385 | rust_port/crates/flow_typing_statement/src/statement.rs:17697-17705 | rust_port/crates/flow_typing_statement/src/statement.rs:18044-18054 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17376` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:979 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:979-987 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1030-1038 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1047-1055 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) rust_port/crates/flow_parser_wasm/src/serializer.rs:4095 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4095-4103 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4107-4115 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4286-4294 — 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 `inner` to `&ast::statement::ComponentDeclaration<Loc, Loc>` in one and `&ast::statement::DeclareComponent<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:878 — rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:878-886 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:935-943 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1402-1410 — 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 `rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:878` it does not close everything it opens, so those 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, `rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:931` calls `Union`, `on_union`, `dupe` and `rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:877` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4904 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4904-4912 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:5030-5038 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:5096-5104 — 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 `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4904` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) rust_port/crates/flow_typing_statement/src/func_sig.rs:694 — rust_port/crates/flow_typing_statement/src/func_sig.rs:694-702 | rust_port/crates/flow_typing_statement/src/func_sig.rs:721-729 | rust_port/crates/flow_typing_statement/src/func_sig.rs:748-756 — 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 `rust_port/crates/flow_typing_statement/src/func_sig.rs:694` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×14
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:663 — rust_port/crates/flow_analysis/src/property_assignment.rs:663-670 | rust_port/crates/flow_analysis/src/ssa_builder.rs:878-886 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:701 — rust_port/crates/flow_analysis/src/property_assignment.rs:701-708 | rust_port/crates/flow_analysis/src/ssa_builder.rs:923-931 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_cli/src/agent_helper_command.rs:112 — rust_port/crates/flow_cli/src/agent_helper_command.rs:112-119 | rust_port/crates/flow_cli/src/dump_types_command.rs:26-34 — before extracting anything, compare `rust_port/crates/flow_cli/src/agent_helper_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` as WHOLE FILES: this scan already matched 4 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 `rust_port/crates/flow_cli/src/agent_helper_command.rs:112` it does not close everything it opens, so those 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, `rust_port/crates/flow_cli/src/agent_helper_command.rs:111` calls `add_reason_flag`, `add_base_flags` and `rust_port/crates/flow_cli/src/dump_types_command.rs:26` 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–9 lines × 2) rust_port/crates/flow_codemods/src/annotate_exports.rs:498 — rust_port/crates/flow_codemods/src/annotate_exports.rs:498-506 | rust_port/crates/flow_codemods/src/annotate_exports.rs:618-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_codemods/src/annotate_exports.rs: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. 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–9 lines × 2) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:1058 — rust_port/crates/flow_lsp_server/src/flow_lsp.rs:1058-1066 | rust_port/crates/flow_lsp_server/src/flow_lsp.rs:1409-1416 — both copies are in the same file, so extract the 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 (8–9 lines × 2) rust_port/crates/flow_parser/src/type_parser.rs:3649 — rust_port/crates/flow_parser/src/type_parser.rs:3649-3656 | rust_port/crates/flow_parser/src/type_parser.rs:3658-3666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:3658` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_typing_debug/src/lib.rs:2538 — rust_port/crates/flow_typing_debug/src/lib.rs:2538-2545 | rust_port/crates/flow_typing_debug/src/lib.rs:4320-4328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_debug/src/lib.rs:4320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8970 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8970-8978 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9000-9007 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8968` calls `dupe` and `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8997` 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) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3783 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3783-3790 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3797-3805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3783` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3813 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3813-3820 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3827-3835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3813` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:16695 — rust_port/crates/flow_typing_statement/src/statement.rs:16695-16702 | rust_port/crates/flow_typing_statement/src/statement.rs:19466-19474 — both copies are in the same file, so extract the 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, `rust_port/crates/flow_typing_statement/src/statement.rs:19475` calls `clone` and `rust_port/crates/flow_typing_statement/src/statement.rs:16703` 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) rust_port/crates/flow_typing_statement/src/statement.rs:19992 — rust_port/crates/flow_typing_statement/src/statement.rs:19992-19999 | rust_port/crates/flow_typing_statement/src/statement.rs:20473-20481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:19992` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) rust_port/crates/flow_typing_type/src/type_util.rs:2166 — rust_port/crates/flow_typing_type/src/type_util.rs:2166-2174 | rust_port/crates/flow_typing_type/src/type_util.rs:2179-2186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_util.rs:2166` 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–9 lines × 2) rust_port/crates/flow_typing_utils/src/convert_types.rs:245 — rust_port/crates/flow_typing_utils/src/convert_types.rs:245-252 | rust_port/crates/flow_typing_utils/src/convert_types.rs:260-268 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×14
  • Duplicated block (7–8 lines × 2) rust_port/crates/flow_cli/src/coverage_command.rs:217 — rust_port/crates/flow_cli/src/coverage_command.rs:217-223 | rust_port/crates/flow_cli/src/coverage_command.rs:262-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/coverage_command.rs:262` it begins part-way through the construct above it, so those 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–8 lines × 2) rust_port/crates/flow_common_ty/src/ty.rs:3019 — rust_port/crates/flow_common_ty/src/ty.rs:3019-3025 | rust_port/crates/flow_common_ty/src/ty.rs:3032-3039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty.rs:3032` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_common_ty/src/ty.rs:3040` calls `Some`, `plus`, `on_t` and `rust_port/crates/flow_common_ty/src/ty.rs:3026` 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–8 lines × 2) rust_port/crates/flow_parser/src/match_pattern_parser.rs:351 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:351-358 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:603-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs:351` it does not close everything it opens, so those 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–8 lines × 2) rust_port/crates/flow_parser/src/match_pattern_parser.rs:371 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:371-378 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:620-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs:371` it does not close everything it opens, so those 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–8 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:2885 — rust_port/crates/flow_parser/src/statement_parser.rs:2885-2892 | rust_port/crates/flow_parser/src/statement_parser.rs:2911-2917 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:2885` it does not close everything it opens, so those 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–8 lines × 2) rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:349 — rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:349-355 | rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:564-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/refactor_extract_utils.rs:564` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) rust_port/crates/flow_type_sig/src/compact_table.rs:364 — rust_port/crates/flow_type_sig/src/compact_table.rs:364-370 | rust_port/crates/flow_type_sig/src/compact_table.rs:379-386 — both copies are in the same file, so extract the 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–8 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:635 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:635-642 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4915-4921 — both copies are in the same file, so extract the 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–8 lines × 2) rust_port/crates/flow_typing/src/env_resolution.rs:1637 — rust_port/crates/flow_typing/src/env_resolution.rs:1637-1644 | rust_port/crates/flow_typing/src/env_resolution.rs:1675-1681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing/src/env_resolution.rs: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 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2689 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2689-2696 | rust_port/crates/flow_typing_type/src/type_util.rs:2691-2697 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2689` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:829 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:829-836 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:874-880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:829` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) rust_port/crates/flow_watchman/src/lib.rs:487 — rust_port/crates/flow_watchman/src/lib.rs:487-493 | rust_port/crates/flow_watchman/src/lib.rs:495-502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_watchman/src/lib.rs:495` it begins part-way through the construct above it, so those 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–8 lines × 2) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:512 — rust_port/crates/flow_typing_flow_js/src/object_kit.rs:512-518 | rust_port/crates/flow_typing_flow_js/src/object_kit.rs:1290-1297 — both copies are in the same file, so extract the 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 (7–8 lines × 2) rust_port/crates/flow_typing_flow_js/src/react_kit.rs:882 — rust_port/crates/flow_typing_flow_js/src/react_kit.rs:882-888 | rust_port/crates/flow_typing_flow_js/src/react_kit.rs:902-909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/react_kit.rs:902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · flow_type_sig · ×13
  • flow_type_sig::type_sig_parse::expression (cyclomatic 71) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:10357 — flow_type_sig::type_sig_parse::expression has cyclomatic complexity 71 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • flow_type_sig::type_sig_parse::statement (cyclomatic 68) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14848 — flow_type_sig::type_sig_parse::statement has cyclomatic complexity 68 (threshold 15). Of this number, 67 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
  • flow_type_sig::type_sig_parse::maybe_special_unqualified_generic (cyclomatic 66) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9366 — flow_type_sig::type_sig_parse::maybe_special_unqualified_generic has cyclomatic complexity 66 (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.
  • flow_type_sig::type_sig_parse::class_def (cyclomatic 66) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11788 — flow_type_sig::type_sig_parse::class_def has cyclomatic complexity 66 (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.
  • flow_type_sig::type_sig_parse::declare_class_props (cyclomatic 47) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8793 — flow_type_sig::type_sig_parse::declare_class_props has cyclomatic complexity 47 (threshold 15). Of this number, 18 points are the body's own statements and 29 belong to 4 function items 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.
  • flow_type_sig::type_sig_parse::annot_with_loc (cyclomatic 46) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7208 — flow_type_sig::type_sig_parse::annot_with_loc 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.
  • flow_type_sig::type_sig_parse::object_type (cyclomatic 43) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8024 — flow_type_sig::type_sig_parse::object_type has cyclomatic complexity 43 (threshold 15). Of this number, 21 points are the body's own statements and 22 belong to 4 function items 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.
  • flow_type_sig::type_sig_parse::assignment (cyclomatic 36) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14651 — flow_type_sig::type_sig_parse::assignment has cyclomatic complexity 36 (threshold 15). Of this number, 16 points are the body's own statements and 20 belong to 3 function items 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.
  • flow_type_sig::type_sig_parse::interface_props (cyclomatic 29) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8483 — flow_type_sig::type_sig_parse::interface_props has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (interface_prop::add_named_prop, interface_prop::add_computed_prop, interface_prop). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_type_sig::type_sig_mark::mark_local_binding (cyclomatic 27) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:240 — flow_type_sig::type_sig_mark::mark_local_binding has cyclomatic complexity 27 (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.
  • flow_type_sig::type_sig_parse::object_literal::prop (cyclomatic 24) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12526 — flow_type_sig::type_sig_parse::object_literal::prop 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.
  • flow_type_sig::type_sig_pack::pack_local_binding (cyclomatic 19) rust_port/crates/flow_type_sig/src/type_sig_pack.rs:863 — flow_type_sig::type_sig_pack::pack_local_binding 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.
  • flow_type_sig::type_sig_parse::scope::finalize_declare_module_exports_exn (cyclomatic 18) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4753 — flow_type_sig::type_sig_parse::scope::finalize_declare_module_exports_exn 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.
D2 · Cognitive Complexity · flow_cli_support · ×13
  • flow_cli_support::autocomplete_command::main (cognitive 33) rust_port/crates/flow_cli/src/autocomplete_command.rs:160 — flow_cli_support::autocomplete_command::main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (10 pts), match/switch 4 (8 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.
  • flow_cli_support::ast_command::main (cognitive 31) rust_port/crates/flow_cli/src/ast_command.rs:187 — flow_cli_support::ast_command::main has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 10 (14 pts) (nesting depth added 12). 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.
  • flow_cli_support::get_def_command::main (cognitive 31) rust_port/crates/flow_cli/src/get_def_command.rs:63 — flow_cli_support::get_def_command::main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (8 pts), match/switch 4 (8 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.
  • flow_cli_support::ls_command::main_impl (cognitive 31) rust_port/crates/flow_cli/src/ls_command.rs:347 — flow_cli_support::ls_command::main_impl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 4, match/switch 3 (4 pts), loops 1 (2 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.
  • flow_cli_support::ls_command::get_ls_files (cognitive 27) rust_port/crates/flow_cli/src/ls_command.rs:217 — flow_cli_support::ls_command::get_ls_files has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts), boolean chains 3, 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.
  • flow_cli_support::glean_runner::source_of_exports (cognitive 26) rust_port/crates/flow_cli/src/glean_runner.rs:968 — flow_cli_support::glean_runner::source_of_exports has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 12 (26 pts) (nesting depth added 14). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (soes_of_packed, soes_of_packed_value, soes_of_packed_def, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_cli_support::stop_command::main (cognitive 26) rust_port/crates/flow_cli/src/stop_command.rs:33 — flow_cli_support::stop_command::main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (5 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.
  • flow_cli_support::config_command::check_subcommand (cognitive 22) rust_port/crates/flow_cli/src/config_command.rs:58 — flow_cli_support::config_command::check_subcommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, match/switch 2 (nesting depth added 8). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • flow_cli_support::check_contents_command::main (cognitive 21) rust_port/crates/flow_cli/src/check_contents_command.rs:52 — flow_cli_support::check_contents_command::main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
  • flow_cli_support::env_builder_debug_command::main (cognitive 21) rust_port/crates/flow_cli/src/env_builder_debug_command.rs:126 — flow_cli_support::env_builder_debug_command::main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 9). Of this number, 18 points are the body's own statements and 3 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.
  • flow_cli_support::status_command::check_status (cognitive 21) rust_port/crates/flow_cli/src/status_command.rs:126 — flow_cli_support::status_command::check_status has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (3 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.
  • flow_cli_support::type_of_name_command::handle_response (cognitive 18) rust_port/crates/flow_cli/src/type_of_name_command.rs:59 — flow_cli_support::type_of_name_command::handle_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 5 (9 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.
  • flow_cli_support::agent_helper_command::run_inspect_types (cognitive 16) rust_port/crates/flow_cli/src/agent_helper_command.rs:245 — flow_cli_support::agent_helper_command::run_inspect_types has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 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.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×13
  • Edited copy of a member (7 corresponding lines) rust_port/crates/flow_common_ty/src/ty.rs:2578 — rust_port/crates/flow_common_ty/src/ty.rs:2578-2584 | rust_port/crates/flow_common_ty/src/ty.rs:2591-2599 — 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) rust_port/crates/flow_typing_context/src/lib.rs:3495 — rust_port/crates/flow_typing_context/src/lib.rs:3495-3501 | rust_port/crates/flow_typing_context/src/lib.rs:3506-3512 — 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) rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:188 — rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:188-197 | rust_port/crates/flow_env_builder_resolver/src/super_call_in_derived_ctor_checker.rs:204-210 — 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) rust_port/crates/flow_typing_type/src/type_.rs:7735 — rust_port/crates/flow_typing_type/src/type_.rs:7735-7744 | rust_port/crates/flow_typing_type/src/type_.rs:8251-8257 — 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) rust_port/crates/flow_parser/src/type_parser.rs:2304 — rust_port/crates/flow_parser/src/type_parser.rs:2304-2310 | rust_port/crates/flow_parser/src/type_parser.rs:2336-2343 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:177 — rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:177-183 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:193-199 — 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) rust_port/crates/flow_parser/src/parser_env.rs:1692 — rust_port/crates/flow_parser/src/parser_env.rs:1692-1698 | rust_port/crates/flow_parser/src/parser_env.rs:1866-1874 — 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) rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:577 — rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:577-583 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:883-889 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:2244 — rust_port/crates/flow_analysis/src/scope_builder.rs:2244-2250 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2105-2111 — 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) rust_port/crates/flow_services_code_action/src/refactor_add_jsx_props.rs:324 — rust_port/crates/flow_services_code_action/src/refactor_add_jsx_props.rs:324-335 | rust_port/crates/flow_services_jsx/src/linked_editing_jsx.rs:82-88 — 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:725 — rust_port/crates/flow_analysis/src/ssa_builder.rs:725-731 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3259-3266 — 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) rust_port/crates/flow_cli/src/coverage_command.rs:82 — rust_port/crates/flow_cli/src/coverage_command.rs:82-88 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:236-247 — 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) rust_port/crates/flow_lsp/src/lsp_fmt.rs:22 — rust_port/crates/flow_lsp/src/lsp_fmt.rs:22-28 | rust_port/crates/flow_lsp_server/src/flow_lsp.rs:656-662 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×13
  • Duplicated block (23 lines × 2) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3929 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3929-3951 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4015-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3929` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5067 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5067-5089 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5211-5233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5067` 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, `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5234` calls `dupe` and `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5090` 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 (23 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8511 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8511-8533 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8850-8872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8511` 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) rust_port/crates/flow_typing/src/marked.rs:28 — rust_port/crates/flow_typing/src/marked.rs:28-50 | rust_port/crates/flow_typing_flow_js/src/marked.rs:28-50 — before extracting anything, compare `rust_port/crates/flow_typing/src/marked.rs` and `rust_port/crates/flow_typing_flow_js/src/marked.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:6042 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:6042-6064 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:11002-11032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:6042` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1872 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1872-1894 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1985-2007 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_statement/src/statement.rs:12505 — rust_port/crates/flow_typing_statement/src/statement.rs:12505-12527 | rust_port/crates/flow_typing_statement/src/statement.rs:12538-12560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:12505` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_statement/src/statement.rs:12537` calls `check_default_pattern`, `loc`, `dupe` and `rust_port/crates/flow_typing_statement/src/statement.rs:12504` 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 (23 lines × 2) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1705 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1705-1727 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5955-5977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1705` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1150 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1150-1172 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1505-1527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1150` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2011 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2011-2033 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2044-2066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2011` 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 (23 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2571 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2571-2593 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2599-2621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2571` 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3517 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3517-3539 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5238-5260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3517` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5809 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5809-5831 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5992-6014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5809` it begins part-way through the construct above it, so those 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) · ×13
  • Duplicated block (10 lines × 3) rust_port/crates/flow_cli/src/apply_code_action_command.rs:89 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:89-98 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:196-205 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:295-304 — 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, `rust_port/crates/flow_cli/src/apply_code_action_command.rs:293` calls `get`, `truthy`, `unwrap` and `rust_port/crates/flow_cli/src/apply_code_action_command.rs:88` 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 × 3) rust_port/crates/flow_cli/src/coverage_command.rs:418 — rust_port/crates/flow_cli/src/coverage_command.rs:418-427 | rust_port/crates/flow_cli/src/dump_types_command.rs:218-227 | rust_port/crates/flow_cli/src/get_def_command.rs:84-93 — before extracting anything, compare `rust_port/crates/flow_cli/src/coverage_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` 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 `rust_port/crates/flow_cli/src/coverage_command.rs:418` 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, `rust_port/crates/flow_cli/src/dump_types_command.rs:215` calls `content_of_file_input`, `ok` and `rust_port/crates/flow_cli/src/coverage_command.rs:415` 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 × 3) rust_port/crates/flow_codemods/src/annotate_exports.rs:322 — rust_port/crates/flow_codemods/src/annotate_exports.rs:322-331 | rust_port/crates/flow_codemods/src/annotate_exports.rs:634-643 | rust_port/crates/flow_codemods/src/annotate_exports.rs:672-681 — 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 `rust_port/crates/flow_codemods/src/annotate_exports.rs: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.
  • Duplicated block (10 lines × 3) rust_port/crates/flow_env_builder/src/name_def.rs:2052 — rust_port/crates/flow_env_builder/src/name_def.rs:2052-2061 | rust_port/crates/flow_env_builder/src/name_def.rs:2308-2317 | rust_port/crates/flow_env_builder/src/name_def.rs:2417-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.
  • Duplicated block (10 lines × 3) rust_port/crates/flow_parser/src/type_parser.rs:2847 — rust_port/crates/flow_parser/src/type_parser.rs:2847-2856 | rust_port/crates/flow_parser/src/type_parser.rs:3185-3194 | rust_port/crates/flow_parser/src/type_parser.rs:3226-3235 — 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 `rust_port/crates/flow_parser/src/type_parser.rs:2847` 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5047 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5047-5056 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5063-5072 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5207-5216 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5047` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5348 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5348-5357 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5431-5440 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5549-5558 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5348` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1550 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1550-1559 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1579-1588 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1608-1617 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1550` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:895 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:895-904 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:939-948 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:994-1003 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:895` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:215 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:215-224 | rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:308-317 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:239-248 — before extracting anything, compare `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs` and `rust_port/crates/flow_typing_statement/src/func_stmt_config.rs` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:225` calls `dupe` and `rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:318` 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 × 3) rust_port/crates/flow_typing_statement/src/statement.rs:10984 — rust_port/crates/flow_typing_statement/src/statement.rs:10984-10993 | rust_port/crates/flow_typing_statement/src/statement.rs:11045-11054 | rust_port/crates/flow_typing_statement/src/statement.rs:11152-11161 — 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) rust_port/crates/flow_typing_debug/src/lib.rs:3634 — rust_port/crates/flow_typing_debug/src/lib.rs:3634-3643 | rust_port/crates/flow_typing_debug/src/lib.rs:4182-4191 | rust_port/crates/flow_typing_debug/src/lib.rs:4199-4208 — 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 `rust_port/crates/flow_typing_debug/src/lib.rs:3634` 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) rust_port/crates/flow_typing_debug/src/lib.rs:3210 — rust_port/crates/flow_typing_debug/src/lib.rs:3210-3219 | rust_port/crates/flow_typing_debug/src/lib.rs:3232-3241 | rust_port/crates/flow_typing_debug/src/lib.rs:3243-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. 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 (9–10 lines × 2) · ×13
  • Duplicated block (9–10 lines × 2) rust_port/crates/flow_cli/src/config_command.rs:33 — rust_port/crates/flow_cli/src/config_command.rs:33-42 | rust_port/crates/flow_cli/src/config_command.rs:124-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 `rust_port/crates/flow_cli/src/config_command.rs:33` it does not close everything it opens, so those 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) rust_port/crates/flow_cli/src/glean_runner.rs:1038 — rust_port/crates/flow_cli/src/glean_runner.rs:1038-1046 | rust_port/crates/flow_cli/src/glean_runner.rs:1206-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 `rust_port/crates/flow_cli/src/glean_runner.rs:1038` 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) rust_port/crates/flow_common/src/files.rs:419 — rust_port/crates/flow_common/src/files.rs:419-427 | rust_port/crates/flow_common/src/files.rs:434-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 `rust_port/crates/flow_common/src/files.rs:419` it begins part-way through the construct above it, so those 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) rust_port/crates/flow_env_builder/src/name_def.rs:5488 — rust_port/crates/flow_env_builder/src/name_def.rs:5488-5496 | rust_port/crates/flow_env_builder/src/name_def.rs:5576-5585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5488` it does not close everything it opens, so those 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8178 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8178-8187 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11476-11484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8178` it does not close everything it opens, so those 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 `loc` to `ALoc` in one and `&ALoc` 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–10 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:4642 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:4642-4651 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:8079-8087 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4642` 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) rust_port/crates/flow_services_code_action/src/code_action_service.rs:2976 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:2976-2984 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:3317-3326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/code_action_service.rs:2976` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5768 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5768-5777 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5887-5895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5768` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:675 — rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:675-683 | rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:686-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/inheritance_helpers.rs:675` 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) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4866 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4866-4874 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5440-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. The matched lines also transfer control out of the body holding them, which cannot 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) rust_port/crates/flow_typing_statement/src/class_sig.rs:1609 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1609-1617 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1619-1628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:1609` 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2297 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2297-2306 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2944-2952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2297` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_env.rs:148 — rust_port/crates/flow_typing_utils/src/type_env.rs:148-157 | rust_port/crates/flow_typing_utils/src/type_env.rs:183-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_env.rs:148` 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 (8 lines × 3) · ×13
  • Duplicated block (8 lines × 3) rust_port/crates/flow_parser/src/ast_utils.rs:429 — rust_port/crates/flow_parser/src/ast_utils.rs:429-436 | rust_port/crates/flow_parser/src/ast_utils.rs:449-456 | rust_port/crates/flow_parser/src/ast_utils.rs:554-561 — 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 `rust_port/crates/flow_parser/src/ast_utils.rs:429` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/enum_parser.rs:119 — rust_port/crates/flow_parser/src/enum_parser.rs:119-126 | rust_port/crates/flow_parser/src/enum_parser.rs:196-203 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:583-590 — 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 `rust_port/crates/flow_parser/src/enum_parser.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) rust_port/crates/flow_parser_wasm/src/serializer.rs:2270 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2270-2277 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2453-2460 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2474-2481 — 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, `rust_port/crates/flow_parser_wasm/src/serializer.rs:2278` calls `write_bool`, `is_key_computed` and `rust_port/crates/flow_parser_wasm/src/serializer.rs:2461` 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 × 3) rust_port/crates/flow_services_code_action/src/code_action_service.rs:758 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:758-765 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:805-812 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:851-858 — 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 `rust_port/crates/flow_services_code_action/src/code_action_service.rs:758` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_debug/src/lib.rs:2578 — rust_port/crates/flow_typing_debug/src/lib.rs:2578-2585 | rust_port/crates/flow_typing_debug/src/lib.rs:2601-2608 | rust_port/crates/flow_typing_debug/src/lib.rs:2774-2781 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8522 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8522-8529 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8553-8560 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8582-8589 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9666 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9666-9673 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9736-9743 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9754-9761 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9666` 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 × 3) rust_port/crates/flow_typing_statement/src/statement.rs:10990 — rust_port/crates/flow_typing_statement/src/statement.rs:10990-10997 | rust_port/crates/flow_typing_statement/src/statement.rs:11024-11031 | rust_port/crates/flow_typing_statement/src/statement.rs:11051-11058 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:10990` 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 × 3) rust_port/crates/flow_typing_statement/src/statement.rs:17542 — rust_port/crates/flow_typing_statement/src/statement.rs:17542-17549 | rust_port/crates/flow_typing_statement/src/statement.rs:17761-17768 | rust_port/crates/flow_typing_statement/src/statement.rs:18675-18682 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17542` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:230 — rust_port/crates/flow_typing_utils/src/type_filter.rs:230-237 | rust_port/crates/flow_typing_utils/src/type_filter.rs:251-258 | rust_port/crates/flow_typing_utils/src/type_filter.rs:280-287 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs: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 (8 lines × 3) rust_port/crates/flow_typing_utils/src/type_hint.rs:1020 — rust_port/crates/flow_typing_utils/src/type_hint.rs:1020-1027 | rust_port/crates/flow_typing_utils/src/type_hint.rs:1436-1443 | rust_port/crates/flow_typing_utils/src/type_hint.rs:1470-1477 — 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 `rust_port/crates/flow_typing_utils/src/type_hint.rs:1020` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9028 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9028-9035 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9048-9055 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9072-9079 — 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 `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9028` 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) rust_port/crates/flow_typing_statement/src/statement.rs:14587 — rust_port/crates/flow_typing_statement/src/statement.rs:14587-14594 | rust_port/crates/flow_typing_statement/src/statement.rs:14615-14622 | rust_port/crates/flow_typing_statement/src/statement.rs:14666-14673 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:14587` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D2 · Cognitive Complexity · Walker · ×12
  • Walker::walk_structural (cognitive 114) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1146 — Walker::walk_structural has cognitive complexity 114 (threshold 15). Drivers by points: if/else 21 (52 pts), loops 11 (23 pts), boolean chains 21, match/switch 9 (18 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.
  • Walker::walk_to_union (cognitive 89) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3713 — Walker::walk_to_union has cognitive complexity 89 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 15, loops 6 (14 pts), match/switch 5 (12 pts) (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.
  • Walker::walk_def (cognitive 56) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1826 — Walker::walk_def has cognitive complexity 56 (threshold 15). Drivers by points: match/switch 15 (30 pts), if/else 10 (23 pts), boolean chains 3 (nesting depth added 28). 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.
  • Walker::walk_from_eval (cognitive 55) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5333 — Walker::walk_from_eval has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (34 pts), match/switch 7 (13 pts), boolean chains 8 (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.
  • Walker::walk_to_eval (cognitive 46) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4647 — Walker::walk_to_eval has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 9 (17 pts), boolean chains 12 (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.
  • Walker::walk_call (cognitive 43) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2180 — Walker::walk_call has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 8 (17 pts), match/switch 2 (5 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.
  • Walker::walk_fun (cognitive 29) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2960 — Walker::walk_fun has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 3 (7 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.
  • Walker::flatten_args (cognitive 26) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2300 — Walker::flatten_args has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 4 (12 pts), loops 1 (nesting depth added 17). 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.
  • Walker::walk_renders (cognitive 26) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4897 — Walker::walk_renders has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 4 (10 pts), boolean chains 3 (nesting depth added 12). Of this number, 23 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • Walker::propagate_any (cognitive 23) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5707 — Walker::propagate_any has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (8 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.
  • Walker::ancestors (cognitive 22) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3287 — Walker::ancestors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Walker::walk_inst_ (cognitive 19) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3535 — Walker::walk_inst_ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
  • Members sharing a duplicated core (4 members, 50+ identical tokens) rust_port/crates/flow_dot_js_wasm/src/lib.rs:813 — rust_port/crates/flow_dot_js_wasm/src/lib.rs:813-848 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1027-1052 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1142-1178 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1180-1238 — 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) rust_port/crates/flow_parser/src/enum_parser.rs:98 — rust_port/crates/flow_parser/src/enum_parser.rs:98-189 | rust_port/crates/flow_parser/src/enum_parser.rs:193-232 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:114-498 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:577-796 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:3411 — rust_port/crates/flow_parser/src/estree_translator.rs:3411-3480 | rust_port/crates/flow_parser/src/estree_translator.rs:3486-3515 | rust_port/crates/flow_parser/src/estree_translator.rs:3521-3555 | rust_port/crates/flow_parser/src/estree_translator.rs:5411-5460 — 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1033 — rust_port/crates/flow_parser/src/flow_lexer.rs:1033-1844 | rust_port/crates/flow_parser/src/flow_lexer.rs:1925-1995 | rust_port/crates/flow_parser/src/flow_lexer.rs:2481-2595 | rust_port/crates/flow_parser/src/flow_lexer.rs:2673-2750 — 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) rust_port/crates/flow_parser_utils/src/enum_validate.rs:94 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:94-104 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:113-121 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:123-131 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:179-187 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3017 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3017-3035 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3149-3167 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3208-3226 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3770-3788 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3173 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3173-3202 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3418-3447 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3505-3533 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3794-3824 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2330 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2330-2386 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5355-5394 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6887-6972 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6978-7022 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7277 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7277-7344 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7349-7407 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7412-7442 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7447-7478 — 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) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:434 — rust_port/crates/flow_typing_flow_js/src/object_kit.rs:434-495 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1273-1307 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1761-1822 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1835-1920 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:2278 — rust_port/crates/flow_typing_statement/src/statement.rs:2278-4561 | rust_port/crates/flow_typing_statement/src/statement.rs:5949-6172 | rust_port/crates/flow_typing_statement/src/statement.rs:12784-12889 | rust_port/crates/flow_typing_statement/src/statement.rs:21073-21124 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:5949 — rust_port/crates/flow_typing_statement/src/statement.rs:5949-6172 | rust_port/crates/flow_typing_statement/src/statement.rs:6780-8494 | rust_port/crates/flow_typing_statement/src/statement.rs:10946-11174 | rust_port/crates/flow_typing_statement/src/statement.rs:11528-11676 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×12
  • Edited copy of a member (24 corresponding lines) rust_port/crates/flow_typing_statement/src/component_sig.rs:121 — rust_port/crates/flow_typing_statement/src/component_sig.rs:121-146 | rust_port/crates/flow_typing_statement/src/func_sig.rs:113-136 — 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) rust_port/crates/flow_parser/src/type_parser.rs:138 — rust_port/crates/flow_parser/src/type_parser.rs:138-161 | rust_port/crates/flow_parser/src/type_parser.rs:168-192 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2037 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2037-2061 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2063-2086 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:497 — rust_port/crates/flow_analysis/src/property_assignment.rs:497-520 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1577-1603 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8961 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8961-8986 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8993-9016 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15154 — rust_port/crates/flow_parser/src/ast_visitor.rs:15154-15177 | rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:541-571 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7191 — rust_port/crates/flow_parser/src/ast_visitor.rs:7191-7214 | rust_port/crates/flow_parser/src/ast_visitor.rs:16327-16352 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1761 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1761-1784 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5420-5443 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13260 — rust_port/crates/flow_parser/src/ast_visitor.rs:13260-13283 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4801-4829 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:5967 — rust_port/crates/flow_parser/src/ast_visitor.rs:5967-5990 | rust_port/crates/flow_services_code_action/src/autofix_type_to_value_import.rs:52-81 — 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) rust_port/crates/flow_codemods/src/annotate_exports.rs:251 — rust_port/crates/flow_codemods/src/annotate_exports.rs:251-274 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:201-224 — 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) rust_port/crates/flow_cli/src/codemod_command.rs:367 — rust_port/crates/flow_cli/src/codemod_command.rs:367-390 | rust_port/crates/flow_cli/src/codemod_command.rs:636-659 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×12
  • Duplicated block (14–15 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:1321 — rust_port/crates/flow_analysis/src/scope_builder.rs:1321-1335 | rust_port/crates/flow_analysis/src/scope_builder.rs:1400-1413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_analysis/src/scope_builder.rs:1321` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_codemods/src/annotate_exports.rs:648 — rust_port/crates/flow_codemods/src/annotate_exports.rs:648-662 | rust_port/crates/flow_codemods/src/annotate_exports.rs:686-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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:648` 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–15 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:2937 — rust_port/crates/flow_env_builder/src/name_def.rs:2937-2951 | rust_port/crates/flow_env_builder/src/name_def.rs:2953-2966 — both copies are in the same file, so extract the 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–15 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:1002 — rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:1002-1016 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:1021-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:1002` 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 (14–15 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1757 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1757-1770 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1829-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1756` calls `HooklikeT` and `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1829` 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–15 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1966 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1966-1980 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2066-2079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1966` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:624 — rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:624-638 | rust_port/crates/flow_typing_flow_js/src/flow_js/multi_arg_helpers.rs:665-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:4200 — rust_port/crates/flow_typing_statement/src/statement.rs:4200-4213 | rust_port/crates/flow_typing_statement/src/statement.rs:4445-4459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:4445` it does not close everything it opens, so those 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1174 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1174-1188 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1529-1542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1174` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3037 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3037-3050 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3061-3075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3037` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_env.rs:1681 — rust_port/crates/flow_typing_utils/src/type_env.rs:1681-1695 | rust_port/crates/flow_typing_utils/src/type_env.rs:1813-1826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) evals/compile_swebench.py:440 — evals/compile_swebench.py:440-453 | evals/compile_swebench.py:530-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · flow_parser_utils_output · ×11
  • flow_parser_utils_output::js_layout_generator::expression (cyclomatic 64) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1536 — flow_parser_utils_output::js_layout_generator::expression has cyclomatic complexity 64 (threshold 15). Of this number, 62 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_parser_utils_output::js_layout_generator::statement (cyclomatic 55) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1032 — flow_parser_utils_output::js_layout_generator::statement has cyclomatic complexity 55 (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.
  • flow_parser_utils_output::js_layout_generator::precedence_of_expression (cyclomatic 26) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:241 — flow_parser_utils_output::js_layout_generator::precedence_of_expression 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. This is NOT this file's highest cyclomatic complexity: flow_parser_utils_output::js_layout_generator::type_ (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 function is counted neither in this dimension's figures nor in its score.
  • flow_parser_utils_output::js_layout_generator::type_object_property (cyclomatic 26) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6573 — flow_parser_utils_output::js_layout_generator::type_object_property 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. This is NOT this file's highest cyclomatic complexity: flow_parser_utils_output::js_layout_generator::type_ (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 function is counted neither in this dimension's figures nor in its score.
  • flow_parser_utils_output::layout::print_node (cyclomatic 20) rust_port/crates/flow_parser_utils_output/src/layout.rs:595 — flow_parser_utils_output::layout::print_node 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.
  • flow_parser_utils_output::js_layout_generator::match_pattern (cyclomatic 19) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5396 — flow_parser_utils_output::js_layout_generator::match_pattern 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: flow_parser_utils_output::js_layout_generator::type_ (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 function is counted neither in this dimension's figures nor in its score.
  • flow_parser_utils_output::js_layout_generator::type_object (cyclomatic 19) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6468 — flow_parser_utils_output::js_layout_generator::type_object has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. 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: flow_parser_utils_output::js_layout_generator::type_ (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 function is counted neither in this dimension's figures nor in its score.
  • flow_parser_utils_output::pretty_printer::print::print_node (cyclomatic 19) rust_port/crates/flow_parser_utils_output/src/pretty_printer.rs:120 — flow_parser_utils_output::pretty_printer::print::print_node has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_parser_utils_output::layout::fuse_with_space (cyclomatic 18) rust_port/crates/flow_parser_utils_output/src/layout.rs:379 — flow_parser_utils_output::layout::fuse_with_space has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (ugly_char, helper). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_parser_utils_output::layout::fits (cyclomatic 18) rust_port/crates/flow_parser_utils_output/src/layout.rs:513 — flow_parser_utils_output::layout::fits 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.
  • flow_parser_utils_output::pretty_printer::fits (cyclomatic 18) rust_port/crates/flow_parser_utils_output/src/pretty_printer.rs:35 — flow_parser_utils_output::pretty_printer::fits 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.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×11
  • Edited copy of a member (30 corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:7758 — rust_port/crates/flow_typing_type/src/type_.rs:7758-7787 | rust_port/crates/flow_typing_type/src/type_.rs:7792-7821 — 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) rust_port/crates/flow_env_builder/src/find_providers.rs:1240 — rust_port/crates/flow_env_builder/src/find_providers.rs:1240-1269 | rust_port/crates/flow_env_builder/src/find_providers.rs:1275-1307 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:1148 — rust_port/crates/flow_parser/src/statement_parser.rs:1148-1177 | rust_port/crates/flow_parser/src/statement_parser.rs:1179-1209 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:589 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:589-627 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:677-706 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3744 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3744-3773 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3798-3832 — 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) rust_port/crates/flow_common/src/reason.rs:1772 — rust_port/crates/flow_common/src/reason.rs:1772-1801 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2081-2115 — 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) rust_port/crates/flow_codemods/src/utils/codemod_annotator.rs:269 — rust_port/crates/flow_codemods/src/utils/codemod_annotator.rs:269-298 | rust_port/crates/flow_codemods/src/utils/codemod_annotator.rs:306-342 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10467 — rust_port/crates/flow_parser/src/ast_visitor.rs:10467-10496 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5896-5925 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10811 — rust_port/crates/flow_parser/src/ast_visitor.rs:10811-10847 | rust_port/crates/flow_parser/src/ast_visitor.rs:11049-11078 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/instantiation_helpers.rs:141 — rust_port/crates/flow_typing_flow_js/src/flow_js/instantiation_helpers.rs:141-170 | rust_port/crates/flow_typing_flow_js/src/flow_js/instantiation_helpers.rs:179-208 — 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:678 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:678-707 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:718-747 — 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 · Duplicated block (20 lines × 2) · ×11
  • Duplicated block (20 lines × 2) rust_port/crates/flow_env_builder/src/name_def.rs:5094 — rust_port/crates/flow_env_builder/src/name_def.rs:5094-5113 | rust_port/crates/flow_env_builder/src/name_def.rs:5252-5271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5094` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12577 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12577-12596 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12605-12624 — both copies are in the same file, so extract the 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) rust_port/crates/flow_parser/src/statement_parser.rs:3313 — rust_port/crates/flow_parser/src/statement_parser.rs:3313-3332 | rust_port/crates/flow_parser/src/statement_parser.rs:4161-4180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3313` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/type_parser.rs:2897 — rust_port/crates/flow_parser/src/type_parser.rs:2897-2916 | rust_port/crates/flow_parser/src/type_parser.rs:3198-3217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:2897` 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6071 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6071-6090 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6142-6161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6071` it does not close everything it opens, so those 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 `c1` to `&ast::match_::Case<Loc, Loc, expression::Expression<Loc, Loc>>` in one and `&ast::match_::Case<Loc, Loc, statement::Statement<Loc, Loc>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:209 — rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:209-228 | rust_port/crates/flow_parser_wasm/src/strip_flow.rs:183-202 — before extracting anything, compare `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs` and `rust_port/crates/flow_parser_wasm/src/strip_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:209` 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12183 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12183-12202 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12206-12225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12183` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing/src/env_resolution.rs:3429 — rust_port/crates/flow_typing/src/env_resolution.rs:3429-3448 | rust_port/crates/flow_typing/src/env_resolution.rs:3450-3469 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6491 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6491-6510 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6531-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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:6491` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1884 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1884-1903 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1930-1949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1884` 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:504 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:504-523 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:524-543 — both copies are in the same file, so extract the 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 (10–11 lines × 2) · ×11
  • Duplicated block (10–11 lines × 2) rust_port/crates/flow_commands_connect/src/command_mean_kill.rs:74 — rust_port/crates/flow_commands_connect/src/command_mean_kill.rs:74-84 | rust_port/crates/flow_commands_connect/src/command_mean_kill.rs:100-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 `rust_port/crates/flow_commands_connect/src/command_mean_kill.rs:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4053 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4053-4062 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4976-4986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4053` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:3254 — rust_port/crates/flow_parser/src/statement_parser.rs:3254-3264 | rust_port/crates/flow_parser/src/statement_parser.rs:3504-3513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3254` 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 (10–11 lines × 2) rust_port/crates/flow_parser_utils/src/enum_validate.rs:255 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:255-265 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:271-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils/src/enum_validate.rs: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.
  • Duplicated block (10–11 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:1207 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1207-1217 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3162-3171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:1207` 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–11 lines × 2) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:325 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:325-335 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:390-399 — before extracting anything, compare `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs` and `rust_port/crates/flow_services_code_action/src/autofix_imports.rs` 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 `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs: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 (10–11 lines × 2) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1449 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1449-1458 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1495-1505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1449` 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–11 lines × 2) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1179 — rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1179-1189 | rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1584-1593 — 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 `rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1179` it begins part-way through the construct above it, so those 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–11 lines × 2) rust_port/crates/flow_typing_statement/src/class_sig.rs:1360 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1360-1370 | rust_port/crates/flow_typing_statement/src/class_sig.rs:2682-2691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:1360` 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–11 lines × 2) rust_port/crates/flow_typing_utils/src/type_filter.rs:599 — rust_port/crates/flow_typing_utils/src/type_filter.rs:599-608 | rust_port/crates/flow_typing_utils/src/type_filter.rs:754-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_filter.rs:599` 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–11 lines × 2) evals/compile_swebench.py:464 — evals/compile_swebench.py:464-473 | evals/compile_swebench.py:561-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · Walker · ×10
  • Walker::walk_structural (cyclomatic 118) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1146 — Walker::walk_structural has cyclomatic complexity 118 (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.
  • Walker::walk_def (cyclomatic 57) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:1826 — Walker::walk_def has cyclomatic complexity 57 (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.
  • Walker::walk_to_union (cyclomatic 51) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:3713 — Walker::walk_to_union 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.
  • Walker::walk_to_eval (cyclomatic 48) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4647 — Walker::walk_to_eval has cyclomatic complexity 48 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Walker::walk_from_eval (cyclomatic 41) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5333 — Walker::walk_from_eval 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.
  • Walker::walk_fun (cyclomatic 28) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2960 — Walker::walk_fun has cyclomatic complexity 28 (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.
  • Walker::walk_call (cyclomatic 25) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:2180 — Walker::walk_call has cyclomatic complexity 25 (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.
  • Walker::expand_typeapp_uncached (cyclomatic 22) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4532 — Walker::expand_typeapp_uncached has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Walker::walk_renders (cyclomatic 20) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:4897 — Walker::walk_renders has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. 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: Walker::head_at (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • Walker::propagate_any (cyclomatic 18) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation/walk.rs:5707 — Walker::propagate_any has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Walker::head_at (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · NameResolver · ×10
  • NameResolver::visit_match_pattern (cyclomatic 53) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4416 — NameResolver::visit_match_pattern has cyclomatic complexity 53 (threshold 15). Of this number, 49 points are the body's own statements and 4 belong to 2 function items 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.
  • NameResolver::mk_env (cyclomatic 25) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2731 — NameResolver::mk_env has cyclomatic complexity 25 (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.
  • NameResolver::binding_type_identifier (cyclomatic 25) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8970 — NameResolver::binding_type_identifier 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.
  • NameResolver::assignment (cyclomatic 22) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9549 — NameResolver::assignment has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::variable_declarator (cyclomatic 19) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:9752 — NameResolver::variable_declarator 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: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::mk_type_env (cyclomatic 18) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:3023 — NameResolver::mk_type_env 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: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::normalize_total_refinements (cyclomatic 18) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6752 — NameResolver::normalize_total_refinements has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (recur, nnf). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::member_expression_refinement_must_be_able_to_refine_base_object_to_non_maybe (cyclomatic 17) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8493 — NameResolver::member_expression_refinement_must_be_able_to_refine_base_object_to_non_maybe 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. This is NOT this file's highest cyclomatic complexity: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::merge_conditional_branches_with_refinements (cyclomatic 16) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:5070 — NameResolver::merge_conditional_branches_with_refinements 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: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
  • NameResolver::maybe_prop_nullish (cyclomatic 16) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7695 — NameResolver::maybe_prop_nullish 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: flow_env_builder_resolver::name_resolver::error_for_assignment_kind (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 function is counted neither in this dimension's figures nor in its score.
D3 · God Classes · TooManyFunctions · ×10
  • TooManyFunctions: flow_type_sig::type_sig_parse rust_port/crates/flow_type_sig/src/type_sig_parse.rs:626 — TooManyFunctions — 109 free functions. The bar is 30 free functions; this is 79 over it, 3.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.
  • TooManyFunctions: flow_type_sig::type_sig_parse::scope rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1186 — TooManyFunctions — 85 free functions. The bar is 30 free functions; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: flow_event_logger::fb_facade rust_port/crates/flow_event_logger/src/lib.rs:830 — TooManyFunctions — 76 free functions. The bar is 30 free functions; this is 46 over it, 2.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.
  • TooManyFunctions: flow_event_logger::stub rust_port/crates/flow_event_logger/src/lib.rs:128 — TooManyFunctions — 74 free functions. The bar is 30 free functions; this is 44 over it, 2.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.
  • TooManyFunctions: flow_parser_utils::ast_builder::expressions rust_port/crates/flow_parser_utils/src/ast_builder.rs:1987 — TooManyFunctions — 53 free functions. The bar is 30 free functions; this is 23 over it, 1.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.
  • TooManyFunctions: flow_typing_ty_normalizer::normalizer::type_converter rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1287 — TooManyFunctions — 50 free functions. The bar is 30 free functions; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: flow_parser_utils::ast_builder::statements rust_port/crates/flow_parser_utils/src/ast_builder.rs:1060 — TooManyFunctions — 44 free functions. The bar is 30 free functions; this is 14 over it, 1.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.
  • TooManyFunctions: flow_type_sig::type_sig_parse::scope::type_param_renaming rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2201 — TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: flow_common_utils::measure rust_port/crates/flow_common_utils/src/measure.rs:65 — TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: flow_typing_ty_normalizer::normalizer rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:434 — TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×10
  • Edited copy of a member (25 corresponding lines) rust_port/crates/flow_typing_utils/src/type_filter.rs:610 — rust_port/crates/flow_typing_utils/src/type_filter.rs:610-634 | rust_port/crates/flow_typing_utils/src/type_filter.rs:696-721 — 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) rust_port/crates/flow_env_builder/src/name_def.rs:6064 — rust_port/crates/flow_env_builder/src/name_def.rs:6064-6088 | rust_port/crates/flow_env_builder/src/name_def.rs:6093-6117 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6349 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6349-6373 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6592-6618 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15952 — rust_port/crates/flow_parser/src/ast_visitor.rs:15952-15976 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2078-2102 — 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) rust_port/crates/flow_watchman/src/lib.rs:633 — rust_port/crates/flow_watchman/src/lib.rs:633-666 | rust_port/crates/flow_watchman/src/lib.rs:688-712 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2492 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2492-2516 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2522-2548 — 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) rust_port/crates/flow_common_errors/src/error_utils.rs:4623 — rust_port/crates/flow_common_errors/src/error_utils.rs:4623-4647 | rust_port/crates/flow_hh_json/src/lib.rs:8-32 — 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:1039 — rust_port/crates/flow_analysis/src/ssa_builder.rs:1039-1068 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1075-1099 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1258 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1258-1282 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1351-1378 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:117 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:117-142 | rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:55-79 — 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 · Duplicated block (24 lines × 2) · ×10
  • Duplicated block (24 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1526 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1526-1549 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2143-2166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1526` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:1113 — rust_port/crates/flow_parser/src/object_parser.rs:1113-1136 | rust_port/crates/flow_parser/src/object_parser.rs:1185-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/object_parser.rs:1113` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7724 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7724-7747 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7759-7782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7724` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:934 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:934-957 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:989-1012 — both copies are in the same file, so extract the 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 (24 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4056 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4056-4079 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4086-4109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4056` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:17501 — rust_port/crates/flow_typing_statement/src/statement.rs:17501-17524 | rust_port/crates/flow_typing_statement/src/statement.rs:17718-17741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:17501` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24 lines × 2) rust_port/crates/flow_typing_statement/src/switch_to_match.rs:422 — rust_port/crates/flow_typing_statement/src/switch_to_match.rs:422-445 | rust_port/crates/flow_typing_statement/src/switch_to_match.rs:469-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/switch_to_match.rs:422` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7797 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:7797-7820 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8152-8175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:7797` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:8829 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:8829-8852 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:9351-9374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:8829` 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 (24 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:14750 — rust_port/crates/flow_typing_statement/src/statement.rs:14750-14773 | rust_port/crates/flow_typing_statement/src/statement.rs:15048-15071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:14750` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · flow_env_builder · ×9
  • flow_env_builder::name_def::expression_is_definitely_synthesizable::synthesizable (cyclomatic 41) rust_port/crates/flow_env_builder/src/name_def.rs:1204 — flow_env_builder::name_def::expression_is_definitely_synthesizable::synthesizable has cyclomatic complexity 41 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • flow_env_builder::name_def::collect_declared_namespace_members::collect_one (cyclomatic 40) rust_port/crates/flow_env_builder/src/name_def.rs:1496 — flow_env_builder::name_def::collect_declared_namespace_members::collect_one 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.
  • flow_env_builder::env_api::show_refinement_kind_without_locs (cyclomatic 37) rust_port/crates/flow_env_builder/src/env_api.rs:928 — flow_env_builder::env_api::show_refinement_kind_without_locs 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.
  • flow_env_builder::name_def::obj_properties_synthesizable (cyclomatic 27) rust_port/crates/flow_env_builder/src/name_def.rs:901 — flow_env_builder::name_def::obj_properties_synthesizable has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 2 function items inside it that branch (synthesizable_expression, handle_fun). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_env_builder::env_api::writes_of_write_loc::collect (cyclomatic 26) rust_port/crates/flow_env_builder/src/env_api.rs:786 — flow_env_builder::env_api::writes_of_write_loc::collect 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.
  • flow_env_builder::name_def::match_pattern::visit_pattern (cyclomatic 20) rust_port/crates/flow_env_builder/src/name_def.rs:548 — flow_env_builder::name_def::match_pattern::visit_pattern 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.
  • flow_env_builder::find_providers::join_envs (cyclomatic 16) rust_port/crates/flow_env_builder/src/find_providers.rs:477 — flow_env_builder::find_providers::join_envs has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (join_entries, join_scopes). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_env_builder::find_providers::extended_state_opt (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 function is counted neither in this dimension's figures nor in its score.
  • flow_env_builder::find_providers::simplify_providers (cyclomatic 16) rust_port/crates/flow_env_builder/src/find_providers.rs:2256 — flow_env_builder::find_providers::simplify_providers 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: flow_env_builder::find_providers::extended_state_opt (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 function is counted neither in this dimension's figures nor in its score.
  • flow_env_builder::name_def_types::print::on_hint (cyclomatic 16) rust_port/crates/flow_env_builder/src/name_def_types.rs:506 — flow_env_builder::name_def_types::print::on_hint 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: flow_env_builder::name_def_types::print::string_of_source (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 function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · DefFinder · ×9
  • DefFinder::statement_list (cognitive 230) rust_port/crates/flow_env_builder/src/name_def.rs:4827 — DefFinder::statement_list has cognitive complexity 230 (threshold 15). Drivers by points: if/else 68 (217 pts), loops 7 (20 pts), match/switch 6 (15 pts), boolean chains 10 (nesting depth added 171). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (DefFinder::statement_list::extract_func_static_assign) 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.
  • DefFinder::jsx_element (cognitive 44) rust_port/crates/flow_env_builder/src/name_def.rs:6891 — DefFinder::jsx_element has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 10 (22 pts), if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 21). Of this number, 35 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
  • DefFinder::visit_object_expression (cognitive 35) rust_port/crates/flow_env_builder/src/name_def.rs:4391 — DefFinder::visit_object_expression has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 6 (12 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.
  • DefFinder::class_internal (cognitive 33) rust_port/crates/flow_env_builder/src/name_def.rs:2893 — DefFinder::class_internal has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 2 (3 pts), loops 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.
  • DefFinder::statement_list::extract_func_static_assign (cognitive 28) rust_port/crates/flow_env_builder/src/name_def.rs:4958 — DefFinder::statement_list::extract_func_static_assign has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (28 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. This shape REPEATS in the file: one other method here (DefFinder::statement_list) 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.
  • DefFinder::visit_function (cognitive 20) rust_port/crates/flow_env_builder/src/name_def.rs:2750 — DefFinder::visit_function has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 5 (7 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.
  • DefFinder::hint_pred_kind (cognitive 18) rust_port/crates/flow_env_builder/src/name_def.rs:2684 — DefFinder::hint_pred_kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 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.
  • DefFinder::visit_assignment_expression::other_pattern_hint_opt (cognitive 18) rust_port/crates/flow_env_builder/src/name_def.rs:3241 — DefFinder::visit_assignment_expression::other_pattern_hint_opt has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 2 (4 pts), if/else 2 (3 pts) (nesting depth added 10). 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.
  • DefFinder::visit_function_param (cognitive 17) rust_port/crates/flow_env_builder/src/name_def.rs:2000 — DefFinder::visit_function_param has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4, loops 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 · flow_common_errors · ×9
  • flow_common_errors::error_utils::friendly::message_group_of_error::loop_ (cognitive 96) rust_port/crates/flow_common_errors/src/error_utils.rs:829 — flow_common_errors::error_utils::friendly::message_group_of_error::loop_ has cognitive complexity 96 (threshold 15). Drivers by points: if/else 30 (58 pts), match/switch 12 (26 pts), boolean chains 7, loops 2 (5 pts) (nesting depth added 45). 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.
  • flow_common_errors::error_utils::cli_output::print_code_frames_friendly_without_coalesced_references (cognitive 72) rust_port/crates/flow_common_errors/src/error_utils.rs:3838 — flow_common_errors::error_utils::cli_output::print_code_frames_friendly_without_coalesced_references has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (51 pts), match/switch 5 (11 pts), boolean chains 8, loops 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.
  • flow_common_errors::error_utils::cli_output::print_colorful_code_frames_friendly_with_coalesced_references (cognitive 34) rust_port/crates/flow_common_errors/src/error_utils.rs:3363 — flow_common_errors::error_utils::cli_output::print_colorful_code_frames_friendly_with_coalesced_references has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (27 pts), match/switch 6 (7 pts) (nesting depth added 7). Of this number, 25 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • flow_common_errors::error_utils::cli_output::layout_references (cognitive 32) rust_port/crates/flow_common_errors/src/error_utils.rs:2723 — flow_common_errors::error_utils::cli_output::layout_references has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 4 (9 pts), loops 4, boolean chains 2 (nesting depth added 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 3 function items inside it that branch (add_tags, add_close_tag, update_colors). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_common_errors::error_utils::compare_printable_error (cognitive 31) rust_port/crates/flow_common_errors/src/error_utils.rs:2056 — flow_common_errors::error_utils::compare_printable_error has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29 (60 pts), match/switch 7 (10 pts), loops 1 (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. This shape REPEATS in the file: one other method here (flow_common_errors::error_utils::compare_printable_error::compare_friendly_message) 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.
  • flow_common_errors::error_utils::json_output::json_of_loc_context_abridged (cognitive 26) rust_port/crates/flow_common_errors/src/error_utils.rs:4767 — flow_common_errors::error_utils::json_output::json_of_loc_context_abridged has cognitive complexity 26 (threshold 15). Drivers by points: loops 3 (15 pts), match/switch 3 (6 pts), if/else 2 (5 pts) (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.
  • flow_common_errors::error_utils::compare_printable_error::compare_friendly_message (cognitive 25) rust_port/crates/flow_common_errors/src/error_utils.rs:2159 — flow_common_errors::error_utils::compare_printable_error::compare_friendly_message has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), 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. This shape REPEATS in the file: one other method here (flow_common_errors::error_utils::compare_printable_error) 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.
  • flow_common_errors::error_utils::cli_output::print_message_friendly::concat_words_into_lines (cognitive 20) rust_port/crates/flow_common_errors/src/error_utils.rs:3125 — flow_common_errors::error_utils::cli_output::print_message_friendly::concat_words_into_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (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.
  • flow_common_errors::error_utils::cli_output::format_errors (cognitive 19) rust_port/crates/flow_common_errors/src/error_utils.rs:4461 — flow_common_errors::error_utils::cli_output::format_errors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), loops 2, boolean chains 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 7 belong to one function item inside it that branches. 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 · flow_typing_ty_normalizer · ×9
  • flow_typing_ty_normalizer::normalizer::type_converter::type_app::singleton_poly (cognitive 78) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2710 — flow_typing_ty_normalizer::normalizer::type_converter::type_app::singleton_poly has cognitive complexity 78 (threshold 15). Drivers by points: match/switch 12 (62 pts), if/else 6 (16 pts) (nesting depth added 60). 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.
  • flow_typing_ty_normalizer::normalizer::element_converter::toplevel::singleton (cognitive 56) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4491 — flow_typing_ty_normalizer::normalizer::element_converter::toplevel::singleton has cognitive complexity 56 (threshold 15). Drivers by points: match/switch 14 (38 pts), if/else 3 (12 pts), loops 1 (6 pts) (nesting depth added 38). 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.
  • flow_typing_ty_normalizer::normalizer::type_converter::type_ctor (cognitive 30) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1416 — flow_typing_ty_normalizer::normalizer::type_converter::type_ctor has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 8 (20 pts), if/else 3 (6 pts), loops 1 (4 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_typing_ty_normalizer::normalizer::type_variable (cognitive 21) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:962 — flow_typing_ty_normalizer::normalizer::type_variable has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 5 (9 pts), loops 2 (nesting depth added 10). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (uses_t, resolve_from_lower_bounds). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_ty_normalizer::normalizer::type_converter::inline_interface (cognitive 21) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2230 — flow_typing_ty_normalizer::normalizer::type_converter::inline_interface has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 8 (11 pts), loops 3 (6 pts), if/else 1 (3 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (construct_props, has_implicit_receiver, extends). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_ty_normalizer::normalizer::type_converter::tuple_spread (cognitive 20) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3506 — flow_typing_ty_normalizer::normalizer::type_converter::tuple_spread has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (10 pts), loops 3 (6 pts), if/else 1 (4 pts) (nesting depth added 12). 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.
  • flow_typing_ty_normalizer::normalizer::expand_members::type__ (cognitive 18) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5431 — flow_typing_ty_normalizer::normalizer::expand_members::type__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 pts) (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.
  • flow_typing_ty_normalizer::normalizer::type_converter::convert_component (cognitive 18) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2412 — flow_typing_ty_normalizer::normalizer::type_converter::convert_component has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 4, boolean chains 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • flow_typing_ty_normalizer::normalizer::type_converter::arr_ty (cognitive 16) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2086 — flow_typing_ty_normalizer::normalizer::type_converter::arr_ty has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). 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 · flow_parser_wasm · ×9
  • flow_parser_wasm::position::compute_positions (cognitive 60) rust_port/crates/flow_parser_wasm/src/position.rs:71 — flow_parser_wasm::position::compute_positions has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (46 pts), boolean chains 8, loops 4 (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.
  • flow_parser_wasm::has_flow_pragma (cognitive 57) rust_port/crates/flow_parser_wasm/src/lib.rs:579 — flow_parser_wasm::has_flow_pragma has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (39 pts), loops 4 (12 pts), 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.
  • flow_parser_wasm::hermesParse (cognitive 51) rust_port/crates/flow_parser_wasm/src/lib.rs:130 — flow_parser_wasm::hermesParse has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (28 pts), match/switch 10 (19 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • flow_parser_wasm::serializer::decode_template_raw (cognitive 43) rust_port/crates/flow_parser_wasm/src/serializer.rs:4763 — flow_parser_wasm::serializer::decode_template_raw has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 5, loops 2 (5 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.
  • flow_parser_wasm::bin::codegen::print_mechanical_deserializer (cognitive 41) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:242 — flow_parser_wasm::bin::codegen::print_mechanical_deserializer has cognitive complexity 41 (threshold 15). Drivers by points: loops 10 (21 pts), if/else 9 (20 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • flow_parser_wasm::serializer::decode_escaped_raw_bytes (cognitive 26) rust_port/crates/flow_parser_wasm/src/serializer.rs:4596 — flow_parser_wasm::serializer::decode_escaped_raw_bytes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (5 pts), boolean chains 4, 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.
  • flow_parser_wasm::bin::codegen::generate_estree_visitor_keys (cognitive 25) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:850 — flow_parser_wasm::bin::codegen::generate_estree_visitor_keys has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 7 (10 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.
  • flow_parser_wasm::serializer::parse_bigint_value (cognitive 22) rust_port/crates/flow_parser_wasm/src/serializer.rs:5145 — flow_parser_wasm::serializer::parse_bigint_value has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 8 (10 pts), boolean chains 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.
  • flow_parser_wasm::bin::codegen::generate_estree_predicates (cognitive 21) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:1363 — flow_parser_wasm::bin::codegen::generate_estree_predicates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 8 (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 · Serializer · ×9
  • Serializer::serialize_class_body_element (cognitive 48) rust_port/crates/flow_parser_wasm/src/serializer.rs:2398 — Serializer::serialize_class_body_element has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 13 (27 pts), if/else 6 (13 pts), loops 4 (8 pts) (nesting depth added 25). 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.
  • Serializer::serialize_match_pattern (cognitive 42) rust_port/crates/flow_parser_wasm/src/serializer.rs:1474 — Serializer::serialize_match_pattern has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 15 (34 pts), loops 4 (8 pts) (nesting depth added 23). 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.
  • Serializer::serialize_export_named_declaration (cognitive 32) rust_port/crates/flow_parser_wasm/src/serializer.rs:2977 — Serializer::serialize_export_named_declaration has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 8 (18 pts), if/else 6 (10 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Serializer::serialize_type_object (cognitive 30) rust_port/crates/flow_parser_wasm/src/serializer.rs:3215 — Serializer::serialize_type_object has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 7 (20 pts), if/else 3 (6 pts), loops 4 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Serializer::serialize_declare_export_declaration (cognitive 20) rust_port/crates/flow_parser_wasm/src/serializer.rs:3927 — Serializer::serialize_declare_export_declaration has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 4 (6 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.
  • Serializer::serialize_component_declaration (cognitive 20) rust_port/crates/flow_parser_wasm/src/serializer.rs:4061 — Serializer::serialize_component_declaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 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.
  • Serializer::serialize_import_declaration (cognitive 19) rust_port/crates/flow_parser_wasm/src/serializer.rs:2835 — Serializer::serialize_import_declaration has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 5, loops 1 (2 pts) (nesting depth added 7). 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.
  • Serializer::serialize_pattern (cognitive 17) rust_port/crates/flow_parser_wasm/src/serializer.rs:1251 — Serializer::serialize_pattern has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), 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.
  • Serializer::serialize_tuple_type (cognitive 16) rust_port/crates/flow_parser_wasm/src/serializer.rs:3581 — Serializer::serialize_tuple_type has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 5 (7 pts), loops 1 (nesting depth added 7). 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 · flow_services_inference · ×9
  • flow_services_inference::merge_service::sig_hash (cognitive 47) rust_port/crates/flow_services_inference/src/merge_service.rs:89 — flow_services_inference::merge_service::sig_hash has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 8 (15 pts), match/switch 9 (15 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.
  • flow_services_inference::type_service::recheck::recheck_merge (cognitive 26) rust_port/crates/flow_services_inference/src/type_service.rs:1821 — flow_services_inference::type_service::recheck::recheck_merge has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (8 pts), boolean chains 2, match/switch 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.
  • flow_services_inference::type_service::check_files::check_files (cognitive 24) rust_port/crates/flow_services_inference/src/type_service.rs:934 — flow_services_inference::type_service::check_files::check_files has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 4 (6 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • flow_services_inference::type_service::recheck (cognitive 22) rust_port/crates/flow_services_inference/src/type_service.rs:3782 — flow_services_inference::type_service::recheck has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (9 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.
  • flow_services_inference::type_service::check_files_for_init (cognitive 22) rust_port/crates/flow_services_inference/src/type_service.rs:3973 — flow_services_inference::type_service::check_files_for_init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (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.
  • flow_services_inference::pure_dep_graph_operations::rdep_closure::loop_impl (cognitive 17) rust_port/crates/flow_services_inference/src/pure_dep_graph_operations.rs:23 — flow_services_inference::pure_dep_graph_operations::rdep_closure::loop_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (8 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.
  • flow_services_inference::type_service::recheck::recheck_parse_and_update_dependency_info (cognitive 17) rust_port/crates/flow_services_inference/src/type_service.rs:1477 — flow_services_inference::type_service::recheck::recheck_parse_and_update_dependency_info has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (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.
  • flow_services_inference::type_service::handle_updates_since_saved_state (cognitive 16) rust_port/crates/flow_services_inference/src/type_service.rs:3052 — flow_services_inference::type_service::handle_updates_since_saved_state has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 3 (4 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.
  • flow_services_inference::type_service::check_once (cognitive 16) rust_port/crates/flow_services_inference/src/type_service.rs:4268 — flow_services_inference::type_service::check_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 1 (3 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 · flow_server_command_handler · ×9
  • flow_server_command_handler::command_handler::handle_persistent_infer_type (cognitive 31) rust_port/crates/flow_server_command_handler/src/command_handler.rs:4987 — flow_server_command_handler::command_handler::handle_persistent_infer_type has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 4 (6 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.
  • flow_server_command_handler::command_handler::handle_persistent_signaturehelp_lsp (cognitive 25) rust_port/crates/flow_server_command_handler/src/command_handler.rs:5337 — flow_server_command_handler::command_handler::handle_persistent_signaturehelp_lsp has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 10 (24 pts), boolean chains 1 (nesting depth added 14). 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.
  • flow_server_command_handler::command_handler::handle_global_find_references (cognitive 20) rust_port/crates/flow_server_command_handler/src/command_handler.rs:5745 — flow_server_command_handler::command_handler::handle_global_find_references has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 2 (5 pts) (nesting depth added 12). 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.
  • flow_server_command_handler::command_handler::handle_persistent_coverage (cognitive 20) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6193 — flow_server_command_handler::command_handler::handle_persistent_coverage has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 4 (9 pts) (nesting depth added 10). 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.
  • flow_server_command_handler::command_handler::get_persistent_handler (cognitive 20) rust_port/crates/flow_server_command_handler/src/command_handler.rs:7244 — flow_server_command_handler::command_handler::get_persistent_handler has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 6 (9 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_server_command_handler::command_handler::check_that_we_care_about_this_file (cognitive 17) rust_port/crates/flow_server_command_handler/src/command_handler.rs:534 — flow_server_command_handler::command_handler::check_that_we_care_about_this_file has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (check_file_is_opted_in, check_file_included, check_file_not_ignored, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_server_command_handler::command_handler::collect_rage (cognitive 17) rust_port/crates/flow_server_command_handler/src/command_handler.rs:2461 — flow_server_command_handler::command_handler::collect_rage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 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.
  • flow_server_command_handler::command_handler::get_file_artifacts (cognitive 17) rust_port/crates/flow_server_command_handler/src/command_handler.rs:5554 — flow_server_command_handler::command_handler::get_file_artifacts has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_server_command_handler::command_handler::get_def (cognitive 16) rust_port/crates/flow_server_command_handler/src/command_handler.rs:2820 — flow_server_command_handler::command_handler::get_def has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (16 pts) (nesting depth added 10). 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 · flow_parser_utils_output · ×9
  • flow_parser_utils_output::js_layout_generator::expression (cognitive 29) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1536 — flow_parser_utils_output::js_layout_generator::expression has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 7 (13 pts), boolean chains 3 (nesting depth added 10). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_parser_utils_output::layout::print_node (cognitive 27) rust_port/crates/flow_parser_utils_output/src/layout.rs:595 — flow_parser_utils_output::layout::print_node has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts), match/switch 3 (5 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_parser_utils_output::js_layout_generator::type_object_property (cognitive 26) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6573 — flow_parser_utils_output::js_layout_generator::type_object_property has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 8 (12 pts), boolean chains 1 (nesting depth added 10). 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.
  • flow_parser_utils_output::ast_diff_printer::edits_of_changes_rec (cognitive 22) rust_port/crates/flow_parser_utils_output/src/ast_diff_printer.rs:242 — flow_parser_utils_output::ast_diff_printer::edits_of_changes_rec has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 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.
  • flow_parser_utils_output::js_layout_generator::statement (cognitive 22) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:1032 — flow_parser_utils_output::js_layout_generator::statement has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 6 (10 pts), boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_parser_utils_output::pretty_printer::print::print_node (cognitive 19) rust_port/crates/flow_parser_utils_output/src/pretty_printer.rs:120 — flow_parser_utils_output::pretty_printer::print::print_node has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts), loops 1 (2 pts) (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.
  • flow_parser_utils_output::js_layout_generator::arrow_function (cognitive 18) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2522 — flow_parser_utils_output::js_layout_generator::arrow_function has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (6 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.
  • flow_parser_utils_output::js_layout_generator::type_object (cognitive 18) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6468 — flow_parser_utils_output::js_layout_generator::type_object has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • flow_parser_utils_output::layout::fuse_with_space (cognitive 17) rust_port/crates/flow_parser_utils_output/src/layout.rs:379 — flow_parser_utils_output::layout::fuse_with_space has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (7 pts), boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 17 points belong to 2 function items inside it that branch (ugly_char, helper). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×9
  • Edited copy of a member (28 corresponding lines) rust_port/crates/flow_common_ty/src/ty.rs:2048 — rust_port/crates/flow_common_ty/src/ty.rs:2048-2075 | rust_port/crates/flow_common_ty/src/ty.rs:4478-4512 — 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) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:185 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:185-212 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:222-277 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3537 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3537-3564 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3573-3609 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5795 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5795-5822 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6254-6283 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1760 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1760-1787 | rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1799-1833 — 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) rust_port/crates/flow_heap/src/transaction.rs:1688 — rust_port/crates/flow_heap/src/transaction.rs:1688-1715 | rust_port/crates/flow_heap/src/transaction.rs:1720-1753 — 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) rust_port/crates/flow_typing/src/env_resolution.rs:1019 — rust_port/crates/flow_typing/src/env_resolution.rs:1019-1046 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5092-5120 — 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) rust_port/crates/flow_services_code_action/src/insert_type.rs:442 — rust_port/crates/flow_services_code_action/src/insert_type.rs:442-469 | rust_port/crates/flow_services_code_action/src/insert_type.rs:533-566 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3687 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3687-3714 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3922-3949 — 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 (23 corresponding lines) · ×9
  • Edited copy of a member (23 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:17591 — rust_port/crates/flow_parser/src/ast_visitor.rs:17591-17613 | rust_port/crates/flow_parser/src/ast_visitor.rs:17634-17656 — 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) rust_port/crates/flow_typing_utils/src/speculation_flow.rs:114 — rust_port/crates/flow_typing_utils/src/speculation_flow.rs:114-136 | rust_port/crates/flow_typing_utils/src/speculation_flow.rs:153-185 — 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) rust_port/crates/flow_command_utils/src/lib.rs:827 — rust_port/crates/flow_command_utils/src/lib.rs:827-850 | rust_port/crates/flow_command_utils/src/lib.rs:855-877 — 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) rust_port/crates/flow_common/src/files.rs:906 — rust_port/crates/flow_common/src/files.rs:906-928 | rust_port/crates/flow_common/src/files.rs:934-962 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9159 — rust_port/crates/flow_parser/src/ast_visitor.rs:9159-9181 | rust_port/crates/flow_parser/src/ast_visitor.rs:9238-9267 — 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) rust_port/crates/flow_common/src/reason.rs:785 — rust_port/crates/flow_common/src/reason.rs:785-807 | rust_port/crates/flow_common/src/reason.rs:809-834 — 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:547 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:547-569 | rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:366-388 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10957 — rust_port/crates/flow_parser/src/ast_visitor.rs:10957-10979 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6302-6324 — 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) rust_port/crates/flow_services_code_action/src/insert_type.rs:185 — rust_port/crates/flow_services_code_action/src/insert_type.rs:185-208 | rust_port/crates/flow_services_code_action/src/insert_type.rs:246-268 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×9
  • Duplicated block (21 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6467 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6467-6487 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11302-11322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6467` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11324` calls `pop_back` and `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6488` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (21 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:676 — rust_port/crates/flow_parser/src/estree_translator.rs:676-696 | rust_port/crates/flow_parser/src/estree_translator.rs:2939-2959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:387 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:387-407 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:431-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `&'ast expression::MatchExpression<Loc, Loc>` in one and `&'ast statement::MatchStatement<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (21 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3322 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3322-3342 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3373-3393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3322` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1537 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1537-1557 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1595-1615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1537` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1908 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1908-1928 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2019-2039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1908` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1762 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1762-1782 | rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1800-1820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1762` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1761` calls `unwrap_or` and `rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:1799` 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:772 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:772-792 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:971-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:772` 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2807 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2807-2827 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2832-2852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2807` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×9
  • Duplicated block (11 lines × 3) rust_port/crates/flow_cli/src/apply_code_action_command.rs:202 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:202-212 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:301-311 | rust_port/crates/flow_cli/src/autofix_command.rs:350-360 — before extracting anything, compare `rust_port/crates/flow_cli/src/apply_code_action_command.rs` and `rust_port/crates/flow_cli/src/autofix_command.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/apply_code_action_command.rs:202` 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 × 3) rust_port/crates/flow_common_ty/src/ty.rs:1158 — rust_port/crates/flow_common_ty/src/ty.rs:1158-1168 | rust_port/crates/flow_common_ty/src/ty.rs:1658-1668 | rust_port/crates/flow_common_ty/src/ty.rs:3238-3248 — 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 `rust_port/crates/flow_common_ty/src/ty.rs:1158` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:279 — rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:279-289 | rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:342-352 | rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:373-383 — 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, `rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:276` calls `to_owned` and `rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:340` 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5582 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5582-5592 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5601-5611 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5665-5675 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5582` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:224 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:224-234 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:242-252 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:283-293 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1771 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1771-1781 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1783-1793 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:1795-1805 — 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2149 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2149-2159 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2264-2274 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2293-2303 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2149` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4860 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4860-4870 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4894-4904 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4913-4923 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4860` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:14604 — rust_port/crates/flow_typing_statement/src/statement.rs:14604-14614 | rust_port/crates/flow_typing_statement/src/statement.rs:14792-14802 | rust_port/crates/flow_typing_statement/src/statement.rs:14820-14830 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:14604` 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, `rust_port/crates/flow_typing_statement/src/statement.rs:14803` calls `mk_reason`, `dupe` and `rust_port/crates/flow_typing_statement/src/statement.rs:14615` 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) · ×9
  • Duplicated block (6–7 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:1983 — rust_port/crates/flow_parser/src/estree_translator.rs:1983-1989 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5424-5429 — 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 `rust_port/crates/flow_parser/src/estree_translator.rs:1983` it does not close everything it opens, so those exact lines 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–7 lines × 2) rust_port/crates/flow_services_code_action/src/code_action_service.rs:681 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:681-687 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:720-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 `rust_port/crates/flow_services_code_action/src/code_action_service.rs:681` it does not close everything it opens, so those 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–7 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13487 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13487-13492 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13544-13550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13544` it begins part-way through the construct above it, so those exact lines 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–7 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2994 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2994-3000 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3102-3107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2994` 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–7 lines × 2) rust_port/crates/flow_typing_statement/src/class_sig.rs:1239 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1239-1245 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1586-1591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:1239` 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 (6–7 lines × 2) rust_port/crates/flow_typing_type/src/type_.rs:3851 — rust_port/crates/flow_typing_type/src/type_.rs:3851-3856 | rust_port/crates/flow_typing_type/src/type_.rs:4461-4467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:4461` 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 (6–7 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3193 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3193-3199 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3227-3232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3193` it does not close everything it opens, so those 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–7 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5373 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5373-5379 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5467-5472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5373` it does not close everything it opens, so those exact lines 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–7 lines × 2) rust_port/crates/flow_services_inference/src/merge_service.rs:274 — rust_port/crates/flow_services_inference/src/merge_service.rs:274-279 | rust_port/crates/flow_services_inference/src/merge_service.rs:576-582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_inference/src/merge_service.rs:576` 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.
D1 · Cyclomatic Complexity · DefFinder · ×8
  • DefFinder::statement_list (cyclomatic 96) rust_port/crates/flow_env_builder/src/name_def.rs:4827 — DefFinder::statement_list has cyclomatic complexity 96 (threshold 15). Of this number, 82 points are the body's own statements and 14 belong to 2 function items 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.
  • DefFinder::visit_assignment_expression (cyclomatic 26) rust_port/crates/flow_env_builder/src/name_def.rs:3166 — DefFinder::visit_assignment_expression has cyclomatic complexity 26 (threshold 15). 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, 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.
  • DefFinder::visit_expression (cyclomatic 23) rust_port/crates/flow_env_builder/src/name_def.rs:3910 — DefFinder::visit_expression 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.
  • DefFinder::visit_object_expression (cyclomatic 22) rust_port/crates/flow_env_builder/src/name_def.rs:4391 — DefFinder::visit_object_expression 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.
  • DefFinder::jsx_element (cyclomatic 22) rust_port/crates/flow_env_builder/src/name_def.rs:6891 — DefFinder::jsx_element has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
  • DefFinder::visit_function (cyclomatic 17) rust_port/crates/flow_env_builder/src/name_def.rs:2750 — DefFinder::visit_function 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: flow_env_builder::name_def::definition_reference_kind (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 function is counted neither in this dimension's figures nor in its score.
  • DefFinder::class_internal (cyclomatic 16) rust_port/crates/flow_env_builder/src/name_def.rs:2893 — DefFinder::class_internal 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: flow_env_builder::name_def::definition_reference_kind (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 function is counted neither in this dimension's figures nor in its score.
  • DefFinder::visit_call_expression (cyclomatic 16) rust_port/crates/flow_env_builder/src/name_def.rs:3443 — DefFinder::visit_call_expression 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: flow_env_builder::name_def::definition_reference_kind (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_typing_visitors · ×8
  • flow_typing_visitors::type_mapper::type_default (cyclomatic 56) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:363 — flow_typing_visitors::type_mapper::type_default 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.
  • flow_typing_visitors::type_mapper::destructor_default (cyclomatic 44) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1342 — flow_typing_visitors::type_mapper::destructor_default 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.
  • flow_typing_visitors::type_mapper::def_type_default (cyclomatic 33) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:826 — flow_typing_visitors::type_mapper::def_type_default 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.
  • flow_typing_visitors::type_visitor::type_default (cyclomatic 24) rust_port/crates/flow_typing_visitors/src/type_visitor.rs:302 — flow_typing_visitors::type_visitor::type_default 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.
  • flow_typing_visitors::type_mapper::predicate_default (cyclomatic 21) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1970 — flow_typing_visitors::type_mapper::predicate_default 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.
  • flow_typing_visitors::type_visitor::def_type_default (cyclomatic 19) rust_port/crates/flow_typing_visitors/src/type_visitor.rs:407 — flow_typing_visitors::type_visitor::def_type_default 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.
  • flow_typing_visitors::type_visitor::destructor_default (cyclomatic 17) rust_port/crates/flow_typing_visitors/src/type_visitor.rs:619 — flow_typing_visitors::type_visitor::destructor_default 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.
  • flow_typing_visitors::type_mapper::union_flatten::flatten_into (cyclomatic 16) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:108 — flow_typing_visitors::type_mapper::union_flatten::flatten_into 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 · flow_parser_wasm · ×8
  • flow_parser_wasm::position::compute_positions (cyclomatic 34) rust_port/crates/flow_parser_wasm/src/position.rs:71 — flow_parser_wasm::position::compute_positions 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.
  • flow_parser_wasm::hermesParse (cyclomatic 28) rust_port/crates/flow_parser_wasm/src/lib.rs:130 — flow_parser_wasm::hermesParse 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.
  • flow_parser_wasm::serializer::decode_template_raw (cyclomatic 28) rust_port/crates/flow_parser_wasm/src/serializer.rs:4763 — flow_parser_wasm::serializer::decode_template_raw 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.
  • flow_parser_wasm::has_flow_pragma (cyclomatic 23) rust_port/crates/flow_parser_wasm/src/lib.rs:579 — flow_parser_wasm::has_flow_pragma 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.
  • flow_parser_wasm::serializer::decode_escaped_raw_bytes (cyclomatic 23) rust_port/crates/flow_parser_wasm/src/serializer.rs:4596 — flow_parser_wasm::serializer::decode_escaped_raw_bytes 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.
  • flow_parser_wasm::bin::codegen::print_mechanical_deserializer (cyclomatic 18) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:242 — flow_parser_wasm::bin::codegen::print_mechanical_deserializer 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.
  • flow_parser_wasm::bin::codegen::generate_estree_predicates (cyclomatic 18) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:1363 — flow_parser_wasm::bin::codegen::generate_estree_predicates 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.
  • flow_parser_wasm::bin::codegen::generate_estree_visitor_keys (cyclomatic 17) rust_port/crates/flow_parser_wasm/src/bin/codegen.rs:850 — flow_parser_wasm::bin::codegen::generate_estree_visitor_keys 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 · flow_server_monitor · ×8
  • flow_server_monitor::flow_server_monitor_daemon::wait_loop (cognitive 34) rust_port/crates/flow_server_monitor/src/flow_server_monitor_daemon.rs:118 — flow_server_monitor::flow_server_monitor_daemon::wait_loop has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 3 (6 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.
  • flow_server_monitor::flow_server_monitor_server::keep_alive_loop::wait_for_server_to_die (cognitive 31) rust_port/crates/flow_server_monitor/src/flow_server_monitor_server.rs:1216 — flow_server_monitor::flow_server_monitor_server::keep_alive_loop::wait_for_server_to_die has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 6 (10 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.
  • flow_server_monitor::file_watcher::edenfs_file_watcher::edenfs_listen_loop::main (cognitive 27) rust_port/crates/flow_server_monitor/src/file_watcher.rs:1010 — flow_server_monitor::file_watcher::edenfs_file_watcher::edenfs_listen_loop::main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (8 pts), loops 2 (6 pts) (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.
  • flow_server_monitor::flow_server_monitor_server::server_instance::start (cognitive 22) rust_port/crates/flow_server_monitor/src/flow_server_monitor_server.rs:594 — flow_server_monitor::flow_server_monitor_server::server_instance::start has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (10 pts), if/else 7 (9 pts), loops 2 (3 pts) (nesting depth added 6). 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.
  • flow_server_monitor::socket_acceptor::perform_handshake_and_get_client_handshake (cognitive 22) rust_port/crates/flow_server_monitor/src/socket_acceptor.rs:336 — flow_server_monitor::socket_acceptor::perform_handshake_and_get_client_handshake has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 4 (6 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.
  • flow_server_monitor::flow_server_monitor_server::server_instance::handle_response (cognitive 18) rust_port/crates/flow_server_monitor/src/flow_server_monitor_server.rs:225 — flow_server_monitor::flow_server_monitor_server::server_instance::handle_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 4 (7 pts), loops 1 (2 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_server_monitor::flow_server_monitor::handle_waiting_start_command (cognitive 16) rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:106 — flow_server_monitor::flow_server_monitor::handle_waiting_start_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • flow_server_monitor::flow_server_monitor::internal_start (cognitive 16) rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:190 — flow_server_monitor::flow_server_monitor::internal_start has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 9 (10 pts), if/else 5, loops 1 (nesting depth added 1). 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.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: any_helpers.rs ↔ implicit_instantiation.rs rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:1 — `rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs` and `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs` change together 71% of the time (10 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 — 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 10 shared commits counted here, the most recent 3 are `f996aad2` [flow] Keep explicit `in out` type parameters invariant in TypeScript…; `fef04c51` [flow] Remove unused `BindT`; `d6e8d417` [flow] Move `ObjTestT` out of the constraint system — run `git show` on any of them.
  • Change coupling: lib.rs ↔ any_helpers.rs rust_port/crates/flow_typing_debug/src/lib.rs:1 — `rust_port/crates/flow_typing_debug/src/lib.rs` and `rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs` change together 71% of the time (10 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 — 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 10 shared commits counted here, the most recent 3 are `fef04c51` [flow] Remove unused `BindT`; `4453342c` [flow] Remove unused `FunProtoBindT`; `d6e8d417` [flow] Move `ObjTestT` out of the constraint system — run `git show` on any of them.
  • Change coupling: type_sig_options.rs ↔ lib.rs rust_port/crates/flow_type_sig/src/type_sig_options.rs:1 — `rust_port/crates/flow_type_sig/src/type_sig_options.rs` and `rust_port/crates/flow_typing_context/src/lib.rs` 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 `c5e6cbc8` [flow] Remove `experimental.ts_utility_syntax`; `254d2168` [flow] Flip default of `experimental.export_as_namespace_support` to …; `b9ff6ca0` [flow] Remove `experimental.declare_global_support` — run `git show` on any of them.
  • Change coupling: flow_js.js ↔ flow-services.js website/libs/flow_js.js:1 — `website/libs/flow_js.js` and `website/src/try-flow/flow-services.js` change together 62% of the time (8 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 — 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 `70ef3421` [flow][try-flow] Return null for empty flow.js type-at-pos; `be43f71b` [flow][website] Fix all Flow type errors; `12974121` [flow][website] Prepare for richer type-at-pos results — run `git show` on any of them.
  • Change coupling: misc.js ↔ flowlib_contents.rs lib/misc.js:1 — `lib/misc.js` and `rust_port/crates/flow_flowlib/src/flowlib_contents.rs` change together 54% of the time (15 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) 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 15 shared commits counted here, the most recent 3 are `e85d15f7` [flow] Use TypeScript's ESNext iterator library; `12ac3b5f` [flow] Use TypeScript's ES2015 iterable library; `63e8d795` [flow] Use TypeScript's ES2015 collection library — run `git show` on any of them.
  • Change coupling: misc.js ↔ tslib_contents.rs lib/misc.js:1 — `lib/misc.js` and `rust_port/crates/flow_flowlib/src/tslib_contents.rs` change together 50% of the time (14 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) 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 14 shared commits counted here, the most recent 3 are `e85d15f7` [flow] Use TypeScript's ESNext iterator library; `12ac3b5f` [flow] Use TypeScript's ES2015 iterable library; `63e8d795` [flow] Use TypeScript's ES2015 collection library — run `git show` on any of them.
  • Change coupling: convert_types.rs ↔ type_mapper.rs rust_port/crates/flow_typing_utils/src/convert_types.rs:1 — `rust_port/crates/flow_typing_utils/src/convert_types.rs` and `rust_port/crates/flow_typing_visitors/src/type_mapper.rs` change together 50% of the time (6 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 6 shared commits counted here, the most recent 3 are `0e4a67a8` [flow] Give a mapped type the strictness of the file that declares it; `d4d91a30` [flow] Normalize intersection annotations behind `experimental.normal…; `4453342c` [flow] Remove unused `FunProtoBindT` — run `git show` on any of them.
  • Change coupling: parse.rs ↔ type_service.rs rust_port/crates/flow_heap/src/parse.rs:1 — `rust_port/crates/flow_heap/src/parse.rs` and `rust_port/crates/flow_services_inference/src/type_service.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 5 shared commits counted here, the most recent 3 are `9b8ccaa9` [flow] Track TypeScript global augmentation contributors; `23416df6` [flow][refactor] Record a declaration kind on every `TypedParse`; `36bab5e9` [flow][oxidation] Use OCaml-style Rust heap entity commits — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×8
  • Edited copy of a member (33 corresponding lines) rust_port/crates/flow_parser/src/expression_parser.rs:2240 — rust_port/crates/flow_parser/src/expression_parser.rs:2240-2282 | rust_port/crates/flow_parser/src/flow_lexer.rs:254-291 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:969 — rust_port/crates/flow_typing_utils/src/type_filter.rs:969-1001 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1021-1053 — 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) rust_port/crates/flow_parser/src/flow_lexer.rs:802 — rust_port/crates/flow_parser/src/flow_lexer.rs:802-843 | rust_port/crates/flow_parser/src/flow_lexer.rs:2443-2475 — 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) rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:53 — rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:53-85 | rust_port/crates/flow_typing_flow_js/src/tvar_resolver.rs:152-193 — 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) rust_port/crates/flow_common_socket/src/socket.rs:408 — rust_port/crates/flow_common_socket/src/socket.rs:408-440 | rust_port/crates/flow_common_socket/src/socket.rs:444-476 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3539 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3539-3575 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3635-3667 — 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) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:167 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:167-200 | rust_port/crates/flow_server/src/server.rs:93-125 — 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) rust_port/crates/flow_typing_type/src/type_.rs:4833 — rust_port/crates/flow_typing_type/src/type_.rs:4833-4865 | rust_port/crates/flow_typing_type/src/type_.rs:5074-5108 — 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 copy of a member (31 corresponding lines) · ×8
  • Edited copy of a member (31 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:16795 — rust_port/crates/flow_parser/src/ast_visitor.rs:16795-16825 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2437-2467 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2151 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2151-2181 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2186-2216 — 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3598 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3598-3628 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3848-3880 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3924 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3924-3954 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4010-4045 — 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) rust_port/crates/flow_typing_type/src/type_.rs:4654 — rust_port/crates/flow_typing_type/src/type_.rs:4654-4684 | rust_port/crates/flow_typing_type/src/type_.rs:4891-4921 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15894 — rust_port/crates/flow_parser/src/ast_visitor.rs:15894-15926 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2043-2073 — 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) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:2516 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:2516-2546 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:2555-2592 — 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) rust_port/crates/flow_config/src/flowconfig.rs:824 — rust_port/crates/flow_config/src/flowconfig.rs:824-854 | rust_port/crates/flow_config/src/flowconfig.rs:1450-1486 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×8
  • Edited copies of one member (3 members, 13+ corresponding lines) rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1192 — rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1192-1204 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1357-1370 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1413-1425 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:404 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:404-416 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:427-440 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:448-460 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:526 — rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:526-538 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:747-759 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:767-779 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7476 — rust_port/crates/flow_parser/src/ast_visitor.rs:7476-7489 | rust_port/crates/flow_parser/src/ast_visitor.rs:11585-11597 | rust_port/crates/flow_parser/src/ast_visitor.rs:11978-11990 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11213 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11213-11229 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11248-11264 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:11384-11396 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:126 — rust_port/crates/flow_typing_flow_js/src/flow_js/helpers.rs:126-138 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:251-263 | rust_port/crates/flow_typing_utils/src/speculation_flow.rs:77-89 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8446 — rust_port/crates/flow_parser/src/ast_visitor.rs:8446-8458 | rust_port/crates/flow_parser/src/ast_visitor.rs:15010-15022 | rust_port/crates/flow_parser/src/ast_visitor.rs:15411-15425 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11827 — rust_port/crates/flow_parser/src/ast_visitor.rs:11827-11841 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1577-1589 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1640-1654 — 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 (25 lines × 2) · ×8
  • Duplicated block (25 lines × 2) rust_port/crates/flow_common_ty/src/ty.rs:2051 — rust_port/crates/flow_common_ty/src/ty.rs:2051-2075 | rust_port/crates/flow_common_ty/src/ty.rs:4488-4512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty.rs:2051` 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) rust_port/crates/flow_env_builder/src/name_def.rs:5500 — rust_port/crates/flow_env_builder/src/name_def.rs:5500-5524 | rust_port/crates/flow_env_builder/src/name_def.rs:5590-5614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder/src/name_def.rs:5500` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6160 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6160-6184 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10690-10714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6160` 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:61 — rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:61-85 | rust_port/crates/flow_parser_wasm/src/strip_flow.rs:98-122 — before extracting anything, compare `rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs` and `rust_port/crates/flow_parser_wasm/src/strip_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (25 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:4604 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4604-4628 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4771-4795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:4604` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:245 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:245-269 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:305-329 — both copies are in the same file, so extract the 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) rust_port/crates/flow_event_logger/src/lib.rs:1329 — rust_port/crates/flow_event_logger/src/lib.rs:1329-1353 | rust_port/crates/flow_event_logger/src/lib.rs:1391-1415 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3335 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3335-3359 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3372-3396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3335` 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 lines × 3) · ×8
  • Duplicated block (14 lines × 3) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7627 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7627-7640 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7664-7677 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7701-7714 — 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 `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7627` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746-2761 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2776-2789 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2820-2833 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746` 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 (14 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108-7125 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7666-7683 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9450-9463 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7108` 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 (14 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:10024 — rust_port/crates/flow_typing_statement/src/statement.rs:10024-10037 | rust_port/crates/flow_typing_statement/src/statement.rs:10107-10120 | rust_port/crates/flow_typing_statement/src/statement.rs:10181-10194 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:10024` 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1112 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1112-1125 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1336-1349 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1432-1445 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:1112` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1099 — rust_port/crates/flow_parser/src/flow_lexer.rs:1099-1112 | rust_port/crates/flow_parser/src/flow_lexer.rs:2497-2510 | rust_port/crates/flow_parser/src/flow_lexer.rs:2689-2702 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:6921 — rust_port/crates/flow_typing_statement/src/statement.rs:6921-6934 | rust_port/crates/flow_typing_statement/src/statement.rs:6948-6961 | rust_port/crates/flow_typing_statement/src/statement.rs:7004-7017 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:6921` it does not close everything it opens, so those 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 lines × 3) rust_port/crates/flow_parser/src/estree_translator.rs:828 — rust_port/crates/flow_parser/src/estree_translator.rs:828-841 | rust_port/crates/flow_parser/src/estree_translator.rs:867-880 | rust_port/crates/flow_parser/src/estree_translator.rs:1164-1178 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:828` 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 (13–14 lines × 2) · ×8
  • Duplicated block (13–14 lines × 2) rust_port/crates/flow_cli/src/check_contents_command.rs:59 — rust_port/crates/flow_cli/src/check_contents_command.rs:59-71 | rust_port/crates/flow_cli/src/status_command.rs:319-332 — 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. 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6130 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6130-6143 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6386-6398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6130` 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–14 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:3818 — rust_port/crates/flow_parser/src/estree_translator.rs:3818-3831 | rust_port/crates/flow_parser/src/estree_translator.rs:4218-4230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:3818` 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 `params` to `&ast::statement::component_params::Params<Loc, Loc>` in one and `&ast::function::Params<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13–14 lines × 2) rust_port/crates/flow_parser/src/main_parser.rs:226 — rust_port/crates/flow_parser/src/main_parser.rs:226-238 | rust_port/crates/flow_parser/src/object_parser.rs:2595-2608 — 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 (13–14 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:5256 — rust_port/crates/flow_parser/src/statement_parser.rs:5256-5268 | rust_port/crates/flow_parser/src/statement_parser.rs:5269-5282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:5256` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3575 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3575-3588 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3755-3767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3575` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:17351 — rust_port/crates/flow_typing_statement/src/statement.rs:17351-17364 | rust_port/crates/flow_typing_statement/src/statement.rs:18014-18026 — both copies are in the same file, so extract the 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 (13–14 lines × 2) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:406 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:406-418 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:876-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
R11 · Import Boundaries · Boundary violation [package · ×8
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/command/allCommands.js:14 — packages/flow-dev-tools/src/command/allCommands.js:14 imports packages/flow-dev-tools/src/new-test/new-testCommand.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/command/allCommands.js:17 — packages/flow-dev-tools/src/command/allCommands.js:17 imports packages/flow-dev-tools/src/test/testCommand.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/record/recordRunner.js:16 — packages/flow-dev-tools/src/record/recordRunner.js:16 imports packages/flow-dev-tools/src/test/builder.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/record/recordRunner.js:17 — packages/flow-dev-tools/src/record/recordRunner.js:17 imports packages/flow-dev-tools/src/test/findTests.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/record/recordRunner.js:19 — packages/flow-dev-tools/src/record/recordRunner.js:19 imports packages/flow-dev-tools/src/test/findTests.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] packages/flow-dev-tools/src/record/recordRunner.js:20 — packages/flow-dev-tools/src/record/recordRunner.js:20 imports packages/flow-dev-tools/src/test/RunQueue.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:third-party-deep-import] packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts:26 — packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts:26 imports vscode-languageclient/lib/common/utils/uuid, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageFeature.ts:11 — packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageFeature.ts:11 imports vscode-languageclient/lib/common/utils/uuid, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
D1 · Cyclomatic Complexity · flow_dev_tools · ×7
  • flow_dev_tools::comment::comment_mutator::expand_comment (cyclomatic 25) rust_port/crates/flow_dev_tools/src/comment/comment_mutator.rs:67 — flow_dev_tools::comment::comment_mutator::expand_comment 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.
  • flow_dev_tools::runtests::check_annotate_exports::normal_diff (cyclomatic 21) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:84 — flow_dev_tools::runtests::check_annotate_exports::normal_diff 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.
  • flow_dev_tools::runtests::check_annotate_exports::run_annotate_exports (cyclomatic 19) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:221 — flow_dev_tools::runtests::check_annotate_exports::run_annotate_exports 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.
  • flow_dev_tools::runtests::check_exec_file_promise::split_shell_args (cyclomatic 19) rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:51 — flow_dev_tools::runtests::check_exec_file_promise::split_shell_args 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.
  • flow_dev_tools::comment::comment_mutator::add_comment_to_text (cyclomatic 18) rust_port/crates/flow_dev_tools/src/comment/comment_mutator.rs:195 — flow_dev_tools::comment::comment_mutator::add_comment_to_text 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.
  • flow_dev_tools::runtests::check_website::render_snapshots (cyclomatic 16) rust_port/crates/flow_dev_tools/src/runtests/check_website.rs:160 — flow_dev_tools::runtests::check_website::render_snapshots 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.
  • flow_dev_tools::update_suppressions::update_suppressions::runner (cyclomatic 16) rust_port/crates/flow_dev_tools/src/update_suppressions/update_suppressions.rs:442 — flow_dev_tools::update_suppressions::update_suppressions::runner 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 · flow_typing_visitors · ×7
  • flow_typing_visitors::type_mapper::type_default (cognitive 81) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:363 — flow_typing_visitors::type_mapper::type_default has cognitive complexity 81 (threshold 15). Drivers by points: if/else 40 (62 pts), match/switch 5 (9 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 28). 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.
  • flow_typing_visitors::type_mapper::destructor_default (cognitive 62) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1342 — flow_typing_visitors::type_mapper::destructor_default has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (43 pts), match/switch 8 (15 pts), boolean chains 4 (nesting depth added 27). 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.
  • flow_typing_visitors::type_mapper::def_type_default (cognitive 49) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:826 — flow_typing_visitors::type_mapper::def_type_default has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (39 pts), match/switch 3 (6 pts), boolean chains 4 (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.
  • flow_typing_visitors::type_mapper::predicate_default (cognitive 26) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1970 — flow_typing_visitors::type_mapper::predicate_default has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, match/switch 3 (4 pts) (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.
  • flow_typing_visitors::type_mapper::arr_type_default (cognitive 19) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1815 — flow_typing_visitors::type_mapper::arr_type_default has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 pts), boolean chains 3 (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.
  • flow_typing_visitors::type_mapper::prop_default (cognitive 17) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2114 — flow_typing_visitors::type_mapper::prop_default has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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.
  • flow_typing_visitors::type_mapper::union_flatten (cognitive 16) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:94 — flow_typing_visitors::type_mapper::union_flatten has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 3 (5 pts), loops 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function item inside it that branches (flatten_into). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · flow_common · ×7
  • flow_common::files::make_next_files (cognitive 67) rust_port/crates/flow_common/src/files.rs:1032 — flow_common::files::make_next_files has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (50 pts), boolean chains 9, match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 36). Of this number, 62 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • flow_common::files::ordered_and_unordered_lib_paths (cognitive 42) rust_port/crates/flow_common/src/files.rs:674 — flow_common::files::ordered_and_unordered_lib_paths has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (33 pts), boolean chains 3, loops 1 (3 pts), match/switch 2 (3 pts) (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.
  • flow_common::reason::code_desc_of_expression (cognitive 37) rust_port/crates/flow_common/src/reason.rs:1292 — flow_common::reason::code_desc_of_expression has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 12 (23 pts), if/else 10 (14 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_common::js_number::ecma_string_of_float (cognitive 20) rust_port/crates/flow_common/src/js_number.rs:59 — flow_common::js_number::ecma_string_of_float has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (4 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.
  • flow_common::js_number::shortest_string_of_float (cognitive 19) rust_port/crates/flow_common/src/js_number.rs:144 — flow_common::js_number::shortest_string_of_float has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3 (5 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.
  • flow_common::path_matcher::fixup_path (cognitive 17) rust_port/crates/flow_common/src/path_matcher.rs:155 — flow_common::path_matcher::fixup_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2, match/switch 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.
  • flow_common::files::absolute_path (cognitive 16) rust_port/crates/flow_common/src/files.rs:1391 — flow_common::files::absolute_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 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 · Writer · ×7
  • Writer::expression (cognitive 55) rust_port/crates/flow_parser_utils_output/src/indented_printer/expressions.rs:15 — Writer::expression has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 6 (12 pts), loops 3 (7 pts) (nesting depth added 29). 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.
  • Writer::statement (cognitive 48) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:28 — Writer::statement has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 6 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 24). 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.
  • Writer::pattern (cognitive 37) rust_port/crates/flow_parser_utils_output/src/indented_printer/patterns.rs:14 — Writer::pattern has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 3 (7 pts), loops 2 (4 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.
  • Writer::import_declaration (cognitive 26) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:614 — Writer::import_declaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (3 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.
  • Writer::export_named (cognitive 25) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:700 — Writer::export_named has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (3 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.
  • Writer::class_element (cognitive 20) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:497 — Writer::class_element has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, match/switch 2 (3 pts) (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.
  • Writer::jsx_element (cognitive 17) rust_port/crates/flow_parser_utils_output/src/indented_printer/jsx.rs:61 — Writer::jsx_element has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 5 (7 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flow_typing_type · ×7
  • flow_typing_type::type_util::ground_subtype (cognitive 33) rust_port/crates/flow_typing_type/src/type_util.rs:2028 — flow_typing_type::type_util::ground_subtype has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 9, match/switch 2 (3 pts) (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.
  • flow_typing_type::type_::union_rep::disjoint_union_optimize (cognitive 31) rust_port/crates/flow_typing_type/src/type_.rs:9042 — flow_typing_type::type_::union_rep::disjoint_union_optimize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (7 pts), loops 6 (nesting depth added 12). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 5 function items inside it that branch (almost_unique_values, intersect_props, base_props_of, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_type::type_::union_rep::lookup_almost_disjoint_union (cognitive 22) rust_port/crates/flow_typing_type/src/type_.rs:9267 — flow_typing_type::type_::union_rep::lookup_almost_disjoint_union has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (9 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.
  • flow_typing_type::type_::property::map_t_with_polarity (cognitive 18) rust_port/crates/flow_typing_type/src/type_.rs:7564 — flow_typing_type::type_::property::map_t_with_polarity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, 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.
  • flow_typing_type::type_::property::map_t (cognitive 17) rust_port/crates/flow_typing_type/src/type_.rs:7359 — flow_typing_type::type_::property::map_t has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (flow_typing_type::type_::property::ident_map_t) 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.
  • flow_typing_type::type_::property::ident_map_t (cognitive 17) rust_port/crates/flow_typing_type/src/type_.rs:7427 — flow_typing_type::type_::property::ident_map_t has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (flow_typing_type::type_::property::map_t) 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.
  • flow_typing_type::type_::union_rep::enum_optimize (cognitive 16) rust_port/crates/flow_typing_type/src/type_.rs:8967 — flow_typing_type::type_::union_rep::enum_optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 6). Of this number, 8 points are the body's own statements and 8 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.
D3 · God Classes · TooManyFields · ×7
  • TooManyFields: Opts rust_port/crates/flow_config/src/flowconfig.rs:143 — TooManyFields — 124 stored fields. The bar is 30 stored fields; this is 94 over it, 4.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Options rust_port/crates/flow_common/src/options.rs:111 — TooManyFields — 110 stored fields beside 1 method. The bar is 30 stored fields; this is 80 over it, 3.67× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: T rust_port/crates/flow_lsp/src/lsp_mapper.rs:14 — TooManyFields — 103 stored fields. The bar is 30 stored fields; this is 73 over it, 3.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: FrozenMetadata rust_port/crates/flow_typing_context/src/lib.rs:173 — TooManyFields — 60 stored fields. The bar is 30 stored fields; this is 30 over it, 2.00× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ComponentT rust_port/crates/flow_typing_context/src/lib.rs:397 — TooManyFields — 52 stored fields. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: DaemonizeArgs rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:27 — TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: NameResolverState rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1075 — TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×7
  • Edited copy of a member (27 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:15766 — rust_port/crates/flow_parser/src/ast_visitor.rs:15766-15792 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1990-2016 — 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) rust_port/crates/flow_event_logger/src/lib.rs:884 — rust_port/crates/flow_event_logger/src/lib.rs:884-910 | rust_port/crates/flow_event_logger/src/lib.rs:912-938 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5447 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5447-5476 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5480-5506 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5424 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5424-5450 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5543-5578 — 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:706 — rust_port/crates/flow_common_ty/src/ty_printer.rs:706-733 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1343-1369 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10907 — rust_port/crates/flow_parser/src/ast_visitor.rs:10907-10933 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6224-6250 — 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) rust_port/crates/flow_parser/src/offset_utils.rs:159 — rust_port/crates/flow_parser/src/offset_utils.rs:159-185 | rust_port/crates/flow_parser/src/offset_utils.rs:233-262 — 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, 10+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 10+ corresponding lines) rust_port/crates/flow_typing_context/src/lib.rs:1349 — rust_port/crates/flow_typing_context/src/lib.rs:1349-1358 | rust_port/crates/flow_typing_context/src/lib.rs:1379-1391 | rust_port/crates/flow_typing_context/src/lib.rs:1393-1403 — 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) rust_port/crates/flow_cli/src/glean_schema.rs:612 — rust_port/crates/flow_cli/src/glean_schema.rs:612-622 | rust_port/crates/flow_cli/src/glean_schema.rs:898-907 | rust_port/crates/flow_cli/src/glean_schema.rs:951-966 — 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) rust_port/crates/flow_parser/src/parser_env.rs:1139 — rust_port/crates/flow_parser/src/parser_env.rs:1139-1148 | rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:45-87 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1011-1051 — 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) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:226 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:226-236 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:243-252 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:466-477 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3904 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3904-3917 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3959-3968 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4050-4059 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15693 — rust_port/crates/flow_parser/src/ast_visitor.rs:15693-15709 | rust_port/crates/flow_parser/src/ast_visitor.rs:15810-15819 | rust_port/crates/flow_parser/src/ast_visitor.rs:16197-16211 — 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) rust_port/crates/flow_typing_type/src/type_.rs:2112 — rust_port/crates/flow_typing_type/src/type_.rs:2112-2122 | rust_port/crates/flow_typing_type/src/type_.rs:2307-2317 | rust_port/crates/flow_typing_type/src/type_.rs:2684-2693 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 9+ corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:2258 — rust_port/crates/flow_typing_type/src/type_.rs:2258-2268 | rust_port/crates/flow_typing_type/src/type_.rs:2353-2362 | rust_port/crates/flow_typing_type/src/type_.rs:2727-2735 — 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) rust_port/crates/flow_typing/src/env_resolution.rs:512 — rust_port/crates/flow_typing/src/env_resolution.rs:512-520 | rust_port/crates/flow_typing_utils/src/abnormal.rs:64-72 | rust_port/crates/flow_typing_utils/src/abnormal.rs:129-137 — 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:553 — rust_port/crates/flow_analysis/src/ssa_builder.rs:553-562 | rust_port/crates/flow_analysis/src/ssa_builder.rs:564-572 | rust_port/crates/flow_analysis/src/ssa_builder.rs:574-582 — 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) rust_port/crates/flow_typing_type/src/type_.rs:2140 — rust_port/crates/flow_typing_type/src/type_.rs:2140-2148 | rust_port/crates/flow_typing_type/src/type_.rs:2239-2248 | rust_port/crates/flow_typing_type/src/type_.rs:2335-2343 — 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) rust_port/crates/flow_typing/src/typed_ast_finder.rs:1485 — rust_port/crates/flow_typing/src/typed_ast_finder.rs:1485-1493 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1774-1783 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:1814-1822 — 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) rust_port/crates/flow_typing_type/src/type_.rs:2489 — rust_port/crates/flow_typing_type/src/type_.rs:2489-2497 | rust_port/crates/flow_typing_type/src/type_.rs:2811-2819 | rust_port/crates/flow_typing_type/src/type_.rs:2882-2890 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:569 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:569-582 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5845-5853 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5858-5871 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×7
  • Edited copy of a member (6 corresponding lines) rust_port/crates/flow_heap/src/parsing_heaps.rs:91 — rust_port/crates/flow_heap/src/parsing_heaps.rs:91-102 | rust_port/crates/flow_heap/src/heap_state.rs:923-928 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2099 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2099-2104 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5677-5685 — 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) rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:283 — rust_port/crates/flow_typing_flow_common/src/concrete_type_eq.rs:283-291 | rust_port/crates/flow_typing_generics/src/lib.rs: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) rust_port/crates/flow_analysis/src/scope_builder.rs:1781 — rust_port/crates/flow_analysis/src/scope_builder.rs:1781-1786 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1195-1200 — 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) rust_port/crates/flow_common_utils/src/utils_js.rs:124 — rust_port/crates/flow_common_utils/src/utils_js.rs:124-129 | rust_port/crates/flow_monitor_rpc/src/server_status.rs:728-733 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1655 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1655-1661 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:33-38 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:2025 — rust_port/crates/flow_analysis/src/scope_builder.rs:2025-2030 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1915-1920 — 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×7
  • Duplicated block (19–20 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10113 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10113-10131 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10158-10177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10113` 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 (19–20 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:2680 — rust_port/crates/flow_parser/src/expression_parser.rs:2680-2699 | rust_port/crates/flow_parser/src/type_parser.rs:1050-1068 — before extracting anything, compare `rust_port/crates/flow_parser/src/expression_parser.rs` and `rust_port/crates/flow_parser/src/type_parser.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 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 `rust_port/crates/flow_parser/src/expression_parser.rs:2680` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3132 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3132-3151 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3162-3180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3132` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9680 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9680-9699 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9709-9727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (19–20 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:16408 — rust_port/crates/flow_typing_statement/src/statement.rs:16408-16426 | rust_port/crates/flow_typing_statement/src/statement.rs:19306-19325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:16408` it does not close everything it opens, so those exact lines 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–20 lines × 2) rust_port/crates/flow_typing_type/src/type_.rs:4702 — rust_port/crates/flow_typing_type/src/type_.rs:4702-4720 | rust_port/crates/flow_typing_type/src/type_.rs:4799-4818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:4702` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (19–20 lines × 2) rust_port/crates/flow_typing_type/src/type_.rs:4939 — rust_port/crates/flow_typing_type/src/type_.rs:4939-4957 | rust_port/crates/flow_typing_type/src/type_.rs:5038-5057 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:4939` it does not close everything it opens, so those 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–12 lines × 2) · ×7
  • Duplicated block (11–12 lines × 2) rust_port/crates/flow_cli/src/inlay_hint_command.rs:107 — rust_port/crates/flow_cli/src/inlay_hint_command.rs:107-118 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:268-278 — before extracting anything, compare `rust_port/crates/flow_cli/src/inlay_hint_command.rs` and `rust_port/crates/flow_cli/src/type_at_pos_command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 `rust_port/crates/flow_cli/src/inlay_hint_command.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) rust_port/crates/flow_parser/src/type_parser.rs:142 — rust_port/crates/flow_parser/src/type_parser.rs:142-152 | rust_port/crates/flow_parser/src/type_parser.rs:169-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 `rust_port/crates/flow_parser/src/type_parser.rs:142` it does not close everything it opens, so those 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, `rust_port/crates/flow_parser/src/type_parser.rs:140` calls `strict_error` and `rust_port/crates/flow_parser/src/type_parser.rs:168` 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) rust_port/crates/flow_services_inference/src/merge_service.rs:121 — rust_port/crates/flow_services_inference/src/merge_service.rs:121-131 | rust_port/crates/flow_services_inference/src/merge_service.rs:146-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 `rust_port/crates/flow_services_inference/src/merge_service.rs:121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1522 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1522-1533 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1597-1607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1522` 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–12 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1448 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1448-1459 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1476-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1448` it begins part-way through the construct above it, so those 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–12 lines × 2) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:450 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:450-460 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2997-3008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:450` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4994 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4994-5004 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5039-5050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4994` it does not close everything it opens, so those 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 × 4) · ×7
  • Duplicated block (9 lines × 4) rust_port/crates/flow_analysis/src/property_assignment.rs:568 — rust_port/crates/flow_analysis/src/property_assignment.rs:568-576 | rust_port/crates/flow_analysis/src/property_assignment.rs:618-626 | rust_port/crates/flow_analysis/src/ssa_builder.rs:829-838 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1736-1744 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:568` it does not close everything it opens, so those 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, `rust_port/crates/flow_analysis/src/property_assignment.rs:627` calls `Some` and `rust_port/crates/flow_analysis/src/property_assignment.rs:577` 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 × 4) rust_port/crates/flow_dot_js_wasm/src/lib.rs:821 — rust_port/crates/flow_dot_js_wasm/src/lib.rs:821-829 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1033-1041 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1149-1157 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1188-1196 — 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 before the matched lines, `rust_port/crates/flow_dot_js_wasm/src/lib.rs:819` calls `i32_arg` and `rust_port/crates/flow_dot_js_wasm/src/lib.rs:1032` 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 × 4) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1565 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1565-1573 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1579-1587 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1596-1604 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1635-1643 — 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1188 — rust_port/crates/flow_parser/src/flow_lexer.rs:1188-1196 | rust_port/crates/flow_parser/src/flow_lexer.rs:1216-1224 | rust_port/crates/flow_parser/src/flow_lexer.rs:1229-1237 | rust_port/crates/flow_parser/src/flow_lexer.rs:1257-1265 — 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 `rust_port/crates/flow_parser/src/flow_lexer.rs:1188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) rust_port/crates/flow_server_command_handler/src/command_handler.rs:7697 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:7697-7705 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7874-7882 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7951-7959 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7975-7983 — 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 `rust_port/crates/flow_server_command_handler/src/command_handler.rs:7697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:459 — rust_port/crates/flow_typing_flow_js/src/object_kit.rs:459-467 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1295-1303 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1811-1819 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1909-1917 — 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 `rust_port/crates/flow_typing_flow_js/src/object_kit.rs:459` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) rust_port/crates/flow_env_builder/src/name_def.rs:5120 — rust_port/crates/flow_env_builder/src/name_def.rs:5120-5128 | rust_port/crates/flow_env_builder/src/name_def.rs:5172-5180 | rust_port/crates/flow_env_builder/src/name_def.rs:5278-5286 | rust_port/crates/flow_env_builder/src/name_def.rs:5333-5341 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:5120` it begins part-way through the construct above it, so those exact 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) · ×7
  • Duplicated block (7 lines × 4) rust_port/crates/flow_analysis/src/property_assignment.rs:664 — rust_port/crates/flow_analysis/src/property_assignment.rs:664-670 | rust_port/crates/flow_analysis/src/property_assignment.rs:702-708 | rust_port/crates/flow_analysis/src/ssa_builder.rs:879-886 | rust_port/crates/flow_analysis/src/ssa_builder.rs:924-931 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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 × 4) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4586 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4586-4592 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4601-4607 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4615-4621 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4629-4635 — 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 `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4586` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4594` calls `dupe` and `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:4609` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:3116 — rust_port/crates/flow_typing_statement/src/statement.rs:3116-3122 | rust_port/crates/flow_typing_statement/src/statement.rs:3257-3263 | rust_port/crates/flow_typing_statement/src/statement.rs:3499-3505 | rust_port/crates/flow_typing_statement/src/statement.rs:3604-3610 — 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 before the matched lines, `rust_port/crates/flow_typing_statement/src/statement.rs:3115` calls `at`, `dupe` and `rust_port/crates/flow_typing_statement/src/statement.rs:3256` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:17544 — rust_port/crates/flow_typing_statement/src/statement.rs:17544-17550 | rust_port/crates/flow_typing_statement/src/statement.rs:17763-17769 | rust_port/crates/flow_typing_statement/src/statement.rs:18501-18507 | rust_port/crates/flow_typing_statement/src/statement.rs:18677-18683 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17544` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_statement/src/statement.rs:18676` calls `clone` and `rust_port/crates/flow_typing_statement/src/statement.rs:18500` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) rust_port/crates/flow_typing_type/src/type_.rs:4493 — rust_port/crates/flow_typing_type/src/type_.rs:4493-4499 | rust_port/crates/flow_typing_type/src/type_.rs:4502-4508 | rust_port/crates/flow_typing_type/src/type_.rs:4511-4517 | rust_port/crates/flow_typing_type/src/type_.rs:4520-4526 — 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 `rust_port/crates/flow_typing_type/src/type_.rs:4493` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:588 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:588-594 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:618-624 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:899-905 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:929-935 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:588` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:27 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:27-33 | rust_port/crates/flow_typing_statement/src/match_pattern.rs:68-74 | rust_port/crates/flow_typing_statement/src/statement.rs:153-159 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:108-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×7
  • Duplicated block (6 lines × 4) rust_port/crates/flow_cli/src/batch_coverage_command.rs:155 — rust_port/crates/flow_cli/src/batch_coverage_command.rs:155-160 | rust_port/crates/flow_cli/src/coverage_command.rs:375-380 | rust_port/crates/flow_cli/src/dump_types_command.rs:149-154 | rust_port/crates/flow_cli/src/find_module_command.rs:43-48 — before extracting anything, compare `rust_port/crates/flow_cli/src/coverage_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_cli/src/dump_types_command.rs:157` calls `get`, `optional`, `unwrap` and `rust_port/crates/flow_cli/src/batch_coverage_command.rs: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 (6 lines × 4) rust_port/crates/flow_parser/src/declaration_parser.rs:920 — rust_port/crates/flow_parser/src/declaration_parser.rs:920-925 | rust_port/crates/flow_parser/src/object_parser.rs:1091-1096 | rust_port/crates/flow_parser/src/object_parser.rs:1166-1171 | rust_port/crates/flow_parser/src/object_parser.rs:1860-1865 — 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 (6 lines × 4) rust_port/crates/flow_services_inference/src/merge_service.rs:245 — rust_port/crates/flow_services_inference/src/merge_service.rs:245-250 | rust_port/crates/flow_services_inference/src/merge_service.rs:328-333 | rust_port/crates/flow_services_inference/src/merge_service.rs:348-353 | rust_port/crates/flow_services_inference/src/merge_service.rs:368-373 — 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 `rust_port/crates/flow_services_inference/src/merge_service.rs:245` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:5344 — rust_port/crates/flow_typing_statement/src/statement.rs:5344-5349 | rust_port/crates/flow_typing_statement/src/statement.rs:5444-5449 | rust_port/crates/flow_typing_statement/src/statement.rs:5505-5510 | rust_port/crates/flow_typing_statement/src/statement.rs:5588-5593 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:5344` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:756 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:756-761 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:778-783 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:955-960 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:977-982 — 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 (6 lines × 4) rust_port/crates/flow_typing_utils/src/type_filter.rs:427 — rust_port/crates/flow_typing_utils/src/type_filter.rs:427-432 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1092-1097 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1186-1191 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1316-1321 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:19925 — rust_port/crates/flow_typing_statement/src/statement.rs:19925-19930 | rust_port/crates/flow_typing_statement/src/statement.rs:19991-19996 | rust_port/crates/flow_typing_statement/src/statement.rs:20404-20409 | rust_port/crates/flow_typing_statement/src/statement.rs:20472-20477 — 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 (5 lines × 4) · ×7
  • Duplicated block (5 lines × 4) rust_port/crates/flow_codemods/src/annotate_exports.rs:314 — rust_port/crates/flow_codemods/src/annotate_exports.rs:314-319 | rust_port/crates/flow_codemods/src/annotate_exports.rs:627-631 | rust_port/crates/flow_codemods/src/annotate_exports.rs:788-795 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:254-258 — before extracting anything, compare `rust_port/crates/flow_codemods/src/annotate_exports.rs` and `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs` 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. If that is what happened, the fix is to keep one copy and have the 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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:627` it begins part-way through the construct above it, so those 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 × 4) rust_port/crates/flow_parser_utils/src/enum_validate.rs:95 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:95-99 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:114-118 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:124-128 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:180-184 — 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 `rust_port/crates/flow_parser_utils/src/enum_validate.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872-1878 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1920-1924 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2286-2291 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2749-2753 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872` it does not close everything it opens, so those exact lines 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 × 4) rust_port/crates/flow_typing_statement/src/statement.rs:4346 — rust_port/crates/flow_typing_statement/src/statement.rs:4346-4350 | rust_port/crates/flow_typing_statement/src/statement.rs:7900-7904 | rust_port/crates/flow_typing_statement/src/statement.rs:8378-8382 | rust_port/crates/flow_typing_statement/src/statement.rs:8928-8932 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:4346` 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 (5 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:7928 — rust_port/crates/flow_typing_statement/src/statement.rs:7928-7932 | rust_port/crates/flow_typing_statement/src/statement.rs:7952-7956 | rust_port/crates/flow_typing_statement/src/statement.rs:8394-8398 | rust_port/crates/flow_typing_statement/src/statement.rs:8949-8953 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:7928` it begins part-way through the construct above it, so those exact lines 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 × 4) rust_port/crates/flow_typing_statement/src/type_annotation.rs:3130 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:3130-3134 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3181-3185 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:6051-6055 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:6074-6078 — 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 before the matched lines, `rust_port/crates/flow_typing_statement/src/type_annotation.rs:6071` calls `dupe` and `rust_port/crates/flow_typing_statement/src/type_annotation.rs:6049` 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 × 4) rust_port/crates/flow_typing_errors/src/error_message.rs:1684 — rust_port/crates/flow_typing_errors/src/error_message.rs:1684-1688 | rust_port/crates/flow_typing_type/src/type_.rs:1485-1489 | rust_port/crates/flow_typing_type/src/type_.rs:1524-1528 | rust_port/crates/flow_typing_type/src/type_.rs:1563-1567 — 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.
D1 · Cyclomatic Complexity · ErrorMessage · ×6
  • ErrorMessage::friendly_message_of_msg (cyclomatic 334) rust_port/crates/flow_typing_errors/src/error_message.rs:9925 — ErrorMessage::friendly_message_of_msg has cyclomatic complexity 334 (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.
  • ErrorMessage::map_loc_of_error_message (cyclomatic 325) rust_port/crates/flow_typing_errors/src/error_message.rs:4658 — ErrorMessage::map_loc_of_error_message has cyclomatic complexity 325 (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.
  • ErrorMessage::error_code_of_message (cyclomatic 250) rust_port/crates/flow_typing_errors/src/error_message.rs:13031 — ErrorMessage::error_code_of_message has cyclomatic complexity 250 (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.
  • ErrorMessage::convert_type_to_type_desc (cyclomatic 118) rust_port/crates/flow_typing_errors/src/error_message.rs:7021 — ErrorMessage::convert_type_to_type_desc has cyclomatic complexity 118 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (ErrorMessage::convert_type_to_type_desc::map_use_op) 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.
  • ErrorMessage::loc_of_msg (cyclomatic 73) rust_port/crates/flow_typing_errors/src/error_message.rs:8938 — ErrorMessage::loc_of_msg has cyclomatic complexity 73 (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.
  • ErrorMessage::convert_type_to_type_desc::map_use_op (cyclomatic 30) rust_port/crates/flow_typing_errors/src/error_message.rs:7029 — ErrorMessage::convert_type_to_type_desc::map_use_op 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 shape REPEATS in the file: one other method here (ErrorMessage::convert_type_to_type_desc) 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. This is NOT this file's highest cyclomatic complexity: flow_typing_errors::error_message::util_use_op_of_msg (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_services_code_action · ×6
  • flow_services_code_action::code_action_service::ast_transforms_of_error (cyclomatic 106) rust_port/crates/flow_services_code_action/src/code_action_service.rs:1106 — flow_services_code_action::code_action_service::ast_transforms_of_error has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_expression (cyclomatic 38) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:371 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_expression 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_statement (cyclomatic 33) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:203 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::collect_statement has cyclomatic complexity 33 (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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_statement (cyclomatic 29) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:736 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_statement 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.
  • flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_expression (cyclomatic 22) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:831 — flow_services_code_action::ast_extraction_utils::insertion_point_collectors::class_collector_visit_expression has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • flow_services_code_action::autofix_imports::update_import (cyclomatic 16) rust_port/crates/flow_services_code_action/src/autofix_imports.rs:317 — flow_services_code_action::autofix_imports::update_import 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 · flow_typing_ty_normalizer · ×6
  • flow_typing_ty_normalizer::normalizer::type_converter::type_ctor (cyclomatic 67) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1416 — flow_typing_ty_normalizer::normalizer::type_converter::type_ctor has cyclomatic complexity 67 (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.
  • flow_typing_ty_normalizer::normalizer::expand_members::type__ (cyclomatic 37) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5431 — flow_typing_ty_normalizer::normalizer::expand_members::type__ 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.
  • flow_typing_ty_normalizer::normalizer::element_converter::toplevel::singleton (cyclomatic 30) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4491 — flow_typing_ty_normalizer::normalizer::element_converter::toplevel::singleton 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.
  • flow_typing_ty_normalizer::normalizer::type_converter::type_app::singleton_poly (cyclomatic 23) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2710 — flow_typing_ty_normalizer::normalizer::type_converter::type_app::singleton_poly 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: flow_typing_ty_normalizer::normalizer::type_converter::type_destructor_unevaluated (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_ty_normalizer::normalizer::expand_literal_union::type__ (cyclomatic 22) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5921 — flow_typing_ty_normalizer::normalizer::expand_literal_union::type__ has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: flow_typing_ty_normalizer::normalizer::type_converter::type_destructor_unevaluated (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_typing_ty_normalizer::normalizer::type_converter::inline_interface (cyclomatic 18) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:2230 — flow_typing_ty_normalizer::normalizer::type_converter::inline_interface has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (has_implicit_receiver, extends, construct_props). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_typing_ty_normalizer::normalizer::type_converter::type_destructor_unevaluated (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_common_errors · ×6
  • flow_common_errors::error_utils::friendly::message_group_of_error::loop_ (cyclomatic 43) rust_port/crates/flow_common_errors/src/error_utils.rs:829 — flow_common_errors::error_utils::friendly::message_group_of_error::loop_ 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.
  • flow_common_errors::error_utils::compare_printable_error (cyclomatic 42) rust_port/crates/flow_common_errors/src/error_utils.rs:2056 — flow_common_errors::error_utils::compare_printable_error has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 7 function items inside it that branch (compare_friendly_message, order_of_kind, compare_lists, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_common_errors::error_utils::cli_output::print_code_frames_friendly_without_coalesced_references (cyclomatic 37) rust_port/crates/flow_common_errors/src/error_utils.rs:3838 — flow_common_errors::error_utils::cli_output::print_code_frames_friendly_without_coalesced_references 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.
  • flow_common_errors::error_utils::cli_output::print_message_friendly (cyclomatic 32) rust_port/crates/flow_common_errors/src/error_utils.rs:2978 — flow_common_errors::error_utils::cli_output::print_message_friendly has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (concat_words_into_lines, split_into_words, print_message_inline, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_common_errors::error_utils::cli_output::print_colorful_code_frames_friendly_with_coalesced_references (cyclomatic 23) rust_port/crates/flow_common_errors/src/error_utils.rs:3363 — flow_common_errors::error_utils::cli_output::print_colorful_code_frames_friendly_with_coalesced_references has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to one function item 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.
  • flow_common_errors::error_utils::cli_output::layout_references (cyclomatic 19) rust_port/crates/flow_common_errors/src/error_utils.rs:2723 — flow_common_errors::error_utils::cli_output::layout_references has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (add_tags, add_close_tag, update_colors). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Serializer · ×6
  • Serializer::serialize_match_pattern (cyclomatic 33) rust_port/crates/flow_parser_wasm/src/serializer.rs:1474 — Serializer::serialize_match_pattern 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.
  • Serializer::serialize_class_body_element (cyclomatic 30) rust_port/crates/flow_parser_wasm/src/serializer.rs:2398 — Serializer::serialize_class_body_element 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.
  • Serializer::serialize_type_object (cyclomatic 21) rust_port/crates/flow_parser_wasm/src/serializer.rs:3215 — Serializer::serialize_type_object 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.
  • Serializer::serialize_declare_export_declaration (cyclomatic 21) rust_port/crates/flow_parser_wasm/src/serializer.rs:3927 — Serializer::serialize_declare_export_declaration 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.
  • Serializer::serialize_enum_body (cyclomatic 17) rust_port/crates/flow_parser_wasm/src/serializer.rs:3776 — Serializer::serialize_enum_body 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.
  • Serializer::serialize_export_named_declaration (cyclomatic 16) rust_port/crates/flow_parser_wasm/src/serializer.rs:2977 — Serializer::serialize_export_named_declaration 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.
D2 · Cognitive Complexity · flow_typing_errors · ×6
  • flow_typing_errors::intermediate_error::to_printable_error (cognitive 569) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4398 — flow_typing_errors::intermediate_error::to_printable_error has cognitive complexity 569 (threshold 15). Drivers by points: if/else 159 (273 pts), match/switch 124 (231 pts), loops 21 (58 pts), boolean chains 7 (nesting depth added 258). Of this number, 547 points are the body's own statements and 22 belong to 6 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.
  • flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl (cognitive 158) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1545 — flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl has cognitive complexity 158 (threshold 15). Drivers by points: if/else 63 (123 pts), match/switch 10 (24 pts), boolean chains 11 (nesting depth added 74). To reduce it, split the body into named stages: move each independent 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 (flow_typing_errors::intermediate_error::make_intermediate_error) 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.
  • flow_typing_errors::intermediate_error::make_intermediate_error (cognitive 42) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1155 — flow_typing_errors::intermediate_error::make_intermediate_error has cognitive complexity 42 (threshold 15). Drivers by points: if/else 88 (158 pts), match/switch 37 (66 pts), boolean chains 19 (nesting depth added 99). To reduce it, split the body into named stages: move each independent 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 (flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl) 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.
  • flow_typing_errors::suppression_comments::should_suppress (cognitive 31) rust_port/crates/flow_typing_errors/src/suppression_comments.rs:231 — flow_typing_errors::suppression_comments::should_suppress has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 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.
  • flow_typing_errors::intermediate_error::post_process_errors (cognitive 25) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:585 — flow_typing_errors::intermediate_error::post_process_errors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 9, match/switch 3 (nesting depth added 4). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (dedupe_by_flip_loop, remove_unify_flip, dedupe_by_flip). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_typing_errors::intermediate_error::score_of_msg (cognitive 18) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:308 — flow_typing_errors::intermediate_error::score_of_msg has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 9 (15 pts), if/else 2 (3 pts) (nesting depth added 7). Of this number, 9 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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 · flow_env_builder · ×6
  • flow_env_builder::name_def::collect_declared_namespace_members::collect_one (cognitive 53) rust_port/crates/flow_env_builder/src/name_def.rs:1496 — flow_env_builder::name_def::collect_declared_namespace_members::collect_one has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 3 (8 pts), match/switch 2 (3 pts), boolean chains 2 (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.
  • flow_env_builder::name_def::expression_is_definitely_synthesizable::synthesizable (cognitive 46) rust_port/crates/flow_env_builder/src/name_def.rs:1204 — flow_env_builder::name_def::expression_is_definitely_synthesizable::synthesizable has cognitive complexity 46 (threshold 15). Drivers by points: if/else 6 (24 pts), match/switch 10 (20 pts), boolean chains 2 (nesting depth added 28). 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.
  • flow_env_builder::name_def::obj_properties_synthesizable (cognitive 33) rust_port/crates/flow_env_builder/src/name_def.rs:901 — flow_env_builder::name_def::obj_properties_synthesizable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 8 (16 pts), loops 4 (9 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. This shape REPEATS in the file: one other method here (flow_env_builder::name_def::obj_properties_synthesizable::synthesizable_expression) 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.
  • flow_env_builder::find_providers::join_envs (cognitive 25) rust_port/crates/flow_env_builder/src/find_providers.rs:477 — flow_env_builder::find_providers::join_envs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (join_entries, join_scopes). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_env_builder::name_def::obj_properties_synthesizable::synthesizable_expression (cognitive 20) rust_port/crates/flow_env_builder/src/name_def.rs:919 — flow_env_builder::name_def::obj_properties_synthesizable::synthesizable_expression has cognitive complexity 20 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (6 pts), match/switch 3 (6 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. This shape REPEATS in the file: one other method here (flow_env_builder::name_def::obj_properties_synthesizable) 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.
  • flow_env_builder::name_def_types::print::on_hint (cognitive 17) rust_port/crates/flow_env_builder/src/name_def_types.rs:506 — flow_env_builder::name_def_types::print::on_hint has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flow_parser_utils · ×6
  • flow_parser_utils::enum_validate::validate_implicit_type (cognitive 53) rust_port/crates/flow_parser_utils/src/enum_validate.rs:448 — flow_parser_utils::enum_validate::validate_implicit_type has cognitive complexity 53 (threshold 15). Drivers by points: match/switch 12 (30 pts), loops 5 (14 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 30). 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.
  • flow_parser_utils::flow_ast_differ::list_diff (cognitive 52) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:65 — flow_parser_utils::flow_ast_differ::list_diff has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 5 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 25). Of this number, 44 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • flow_parser_utils::enum_validate::validate_explicit_string (cognitive 22) rust_port/crates/flow_parser_utils/src/enum_validate.rs:353 — flow_parser_utils::enum_validate::validate_explicit_string has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 3 (7 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 12). 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.
  • flow_parser_utils::package_exports::resolve_matched_wildcard_path (cognitive 18) rust_port/crates/flow_parser_utils/src/package_exports.rs:106 — flow_parser_utils::package_exports::resolve_matched_wildcard_path has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 3, 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.
  • flow_parser_utils::export_condition_map::pick_target (cognitive 17) rust_port/crates/flow_parser_utils/src/export_condition_map.rs:80 — flow_parser_utils::export_condition_map::pick_target has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (6 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.
  • flow_parser_utils::enum_validate::compute_rep_for_explicit_type (cognitive 16) rust_port/crates/flow_parser_utils/src/enum_validate.rs:599 — flow_parser_utils::enum_validate::compute_rep_for_explicit_type has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 2 (3 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×6
  • Edited copy of a member (29 corresponding lines) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:40 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:40-74 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:700-728 — 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) rust_port/crates/flow_common_ty/src/ty.rs:1554 — rust_port/crates/flow_common_ty/src/ty.rs:1554-1589 | rust_port/crates/flow_common_ty/src/ty.rs:3148-3176 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1948 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1948-1992 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2066-2094 — 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) rust_port/crates/flow_type_sig/src/type_sig.rs:583 — rust_port/crates/flow_type_sig/src/type_sig.rs:583-611 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2982-3014 — 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) rust_port/crates/flow_hh_json/src/lib.rs:124 — rust_port/crates/flow_hh_json/src/lib.rs:124-158 | rust_port/crates/flow_hh_json/src/lib.rs:160-188 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:2763 — rust_port/crates/flow_parser/src/estree_translator.rs:2763-2791 | rust_port/crates/flow_parser/src/estree_translator.rs:2798-2831 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×6
  • Edited copy of a member (26 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:14622 — rust_port/crates/flow_parser/src/ast_visitor.rs:14622-14647 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1382-1407 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6505 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:6505-6530 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6788-6827 — 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) rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:597 — rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:597-624 | rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:629-654 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3453 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3453-3478 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5934-5961 — 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) rust_port/crates/flow_common/src/lock.rs:60 — rust_port/crates/flow_common/src/lock.rs:60-87 | rust_port/crates/flow_common/src/lock.rs:91-116 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:4060 — rust_port/crates/flow_parser/src/estree_translator.rs:4060-4088 | rust_port/crates/flow_parser/src/estree_translator.rs:5704-5729 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×6
  • Edited copy of a member (22 corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6465 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6465-6486 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6742-6765 — 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) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:429 — rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:429-450 | rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:483-508 — 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) rust_port/crates/flow_typing_flow_common/src/string_case_transform.rs:173 — rust_port/crates/flow_typing_flow_common/src/string_case_transform.rs:173-194 | rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:574-595 — 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) rust_port/crates/flow_typing_debug/src/lib.rs:4750 — rust_port/crates/flow_typing_debug/src/lib.rs:4750-4771 | rust_port/crates/flow_typing_debug/src/lib.rs:4779-4800 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15868 — rust_port/crates/flow_parser/src/ast_visitor.rs:15868-15889 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1248-1269 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1416 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1416-1440 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1448-1469 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 14+ corresponding lines) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:595 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:595-609 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:614-628 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:654-667 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:1796 — rust_port/crates/flow_parser/src/statement_parser.rs:1796-1809 | rust_port/crates/flow_parser/src/statement_parser.rs:1919-1932 | rust_port/crates/flow_parser/src/statement_parser.rs:2069-2087 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:1384 — rust_port/crates/flow_parser/src/statement_parser.rs:1384-1397 | rust_port/crates/flow_parser/src/statement_parser.rs:1580-1593 | rust_port/crates/flow_parser/src/statement_parser.rs:1653-1666 — 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) rust_port/crates/flow_server_env/src/workload_stream.rs:88 — rust_port/crates/flow_server_env/src/workload_stream.rs:88-101 | rust_port/crates/flow_server_env/src/workload_stream.rs:104-117 | rust_port/crates/flow_server_env/src/workload_stream.rs:120-133 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8407 — rust_port/crates/flow_parser/src/ast_visitor.rs:8407-8422 | rust_port/crates/flow_parser/src/ast_visitor.rs:10515-10528 | rust_port/crates/flow_parser/src/ast_visitor.rs:17875-17890 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:6061 — rust_port/crates/flow_parser/src/estree_translator.rs:6061-6074 | rust_port/crates/flow_parser/src/estree_translator.rs:6130-6143 | rust_port/crates/flow_parser/src/estree_translator.rs:6149-6164 — 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, 12+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 12+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6579 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6579-6599 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6617-6628 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6633-6644 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11929 — rust_port/crates/flow_parser/src/ast_visitor.rs:11929-11949 | rust_port/crates/flow_parser/src/ast_visitor.rs:12453-12464 | rust_port/crates/flow_parser/src/ast_visitor.rs:12487-12498 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:1403 — rust_port/crates/flow_parser/src/statement_parser.rs:1403-1416 | rust_port/crates/flow_parser/src/statement_parser.rs:1595-1606 | rust_port/crates/flow_parser/src/statement_parser.rs:1670-1682 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:722 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:722-734 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:736-748 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:811-822 — 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) rust_port/crates/flow_common_ty/src/ty_printer.rs:1577 — rust_port/crates/flow_common_ty/src/ty_printer.rs:1577-1588 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1596-1607 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1615-1626 — 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) rust_port/crates/flow_services_code_action/src/insert_type.rs:571 — rust_port/crates/flow_services_code_action/src/insert_type.rs:571-582 | rust_port/crates/flow_services_code_action/src/insert_type.rs:652-663 | rust_port/crates/flow_services_code_action/src/insert_type.rs:669-680 — 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 · Duplicated block (28 lines × 2) · ×6
  • Duplicated block (28 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2112 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2112-2139 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2509-2536 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2612 — rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2612-2639 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:2648-2675 — both copies are in the same file, so extract the 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 (28 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3602 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3602-3629 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5093-5120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3602` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/statement_parser.rs:3410 — rust_port/crates/flow_parser/src/statement_parser.rs:3410-3437 | rust_port/crates/flow_parser/src/statement_parser.rs:3542-3569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3410` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:47 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:47-74 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:701-728 — 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 `rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (28 lines × 2) rust_port/crates/flow_parser/src/flow_lexer.rs:2489 — rust_port/crates/flow_parser/src/flow_lexer.rs:2489-2516 | rust_port/crates/flow_parser/src/flow_lexer.rs:2681-2708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:2489` 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 (26 lines × 2) · ×6
  • Duplicated block (26 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8719 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8719-8744 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8749-8774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:8719` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:1789 — rust_port/crates/flow_parser/src/expression_parser.rs:1789-1814 | rust_port/crates/flow_parser/src/expression_parser.rs:1841-1866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/expression_parser.rs:1789` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:16228 — rust_port/crates/flow_typing_statement/src/statement.rs:16228-16253 | rust_port/crates/flow_typing_statement/src/statement.rs:19147-19172 — both copies are in the same file, so extract the 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) rust_port/crates/flow_typing_statement/src/statement.rs:18532 — rust_port/crates/flow_typing_statement/src/statement.rs:18532-18557 | rust_port/crates/flow_typing_statement/src/statement.rs:18709-18734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:18532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3549 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3549-3574 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3591-3616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3549` 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 (26 lines × 2) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2035 — rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2035-2060 | rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2074-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 `rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2035` it does not close everything it opens, so those 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–15 lines × 2) · ×6
  • Duplicated block (13–15 lines × 2) rust_port/crates/flow_codemods/src/annotate_exports.rs:619 — rust_port/crates/flow_codemods/src/annotate_exports.rs:619-631 | rust_port/crates/flow_codemods/src/annotate_exports.rs:781-795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_codemods/src/annotate_exports.rs: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. 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8926 — rust_port/crates/flow_parser/src/ast_visitor.rs:8926-8940 | rust_port/crates/flow_parser/src/ast_visitor.rs:9875-9887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/ast_visitor.rs:8926` it begins part-way through the construct above it, so those 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–15 lines × 2) rust_port/crates/flow_server_monitor/src/socket_acceptor.rs:162 — rust_port/crates/flow_server_monitor/src/socket_acceptor.rs:162-176 | rust_port/crates/flow_server_monitor/src/socket_acceptor.rs:297-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_monitor/src/socket_acceptor.rs:162` it begins part-way through the construct above it, so those exact lines 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–15 lines × 2) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:270 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:270-284 | rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs: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 `rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:270` 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–15 lines × 2) rust_port/crates/flow_typing_utils/src/type_env.rs:1132 — rust_port/crates/flow_typing_utils/src/type_env.rs:1132-1146 | rust_port/crates/flow_typing_utils/src/type_env.rs:1185-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_env.rs:1132` 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–15 lines × 2) rust_port/crates/flow_command_spec/src/lib.rs:556 — rust_port/crates/flow_command_spec/src/lib.rs:556-568 | rust_port/crates/flow_command_spec/src/lib.rs:574-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_command_spec/src/lib.rs:556` it does not close everything it opens, so those 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 × 4) · ×6
  • Duplicated block (11 lines × 4) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:773 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:773-783 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:914-924 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:998-1008 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:1108-1118 — 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 `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:773` 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 × 4) rust_port/crates/flow_env_builder/src/name_def.rs:5092 — rust_port/crates/flow_env_builder/src/name_def.rs:5092-5102 | rust_port/crates/flow_env_builder/src/name_def.rs:5140-5150 | rust_port/crates/flow_env_builder/src/name_def.rs:5192-5202 | rust_port/crates/flow_env_builder/src/name_def.rs:5382-5392 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:5092` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 4) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3025 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3025-3035 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3157-3167 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3216-3226 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3778-3788 — 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 `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3025` 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 `spread2` to `&ast::jsx::SpreadChild<Loc, Loc>` in one and `&expression::SpreadElement<Loc, Loc>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 4) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2687 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2687-2697 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2901-2911 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3039-3049 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3091-3101 — 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 (11 lines × 4) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1236 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1236-1246 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1254-1264 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1284-1294 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1302-1312 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1236` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2439 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2439-2449 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2486-2496 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2542-2552 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2675-2685 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2439` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2553` calls `object_like`, `Ok` and `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2450` 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.
D1 · Cyclomatic Complexity · flow_typing_errors · ×5
  • flow_typing_errors::intermediate_error::to_printable_error (cyclomatic 885) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4398 — flow_typing_errors::intermediate_error::to_printable_error has cyclomatic complexity 885 (threshold 15). Of this number, 840 points are the body's own statements and 45 belong to 6 function items inside it that branch. 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.
  • flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl (cyclomatic 130) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1545 — flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl has cyclomatic complexity 130 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (flow_typing_errors::intermediate_error::make_intermediate_error) 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.
  • flow_typing_errors::intermediate_error::make_intermediate_error (cyclomatic 56) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1155 — flow_typing_errors::intermediate_error::make_intermediate_error has cyclomatic complexity 56 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (flow_typing_errors::intermediate_error::make_intermediate_error::unwrap_use_ops::loop_impl) 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.
  • flow_typing_errors::intermediate_error::post_process_errors (cyclomatic 24) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:585 — flow_typing_errors::intermediate_error::post_process_errors has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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: flow_typing_errors::intermediate_error::annotation_inference_operation_description (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 function is counted neither in this dimension's figures nor in its score.
  • flow_typing_errors::intermediate_error::score_of_msg (cyclomatic 20) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:308 — flow_typing_errors::intermediate_error::score_of_msg has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (type_category, score_categories). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_typing_errors::intermediate_error::annotation_inference_operation_description (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 function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · Mapper · ×5
  • Mapper::statement_fork_point (cognitive 85) rust_port/crates/flow_services_code_action/src/autofix_type_to_value_import.rs:122 — Mapper::statement_fork_point has cognitive complexity 85 (threshold 15). Drivers by points: if/else 18 (48 pts), match/switch 10 (37 pts) (nesting depth added 57). 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.
  • Mapper::map_expression (cognitive 25) rust_port/crates/flow_services_code_action/src/autofix_new_to_record.rs:36 — Mapper::map_expression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 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.
  • Mapper::map_match_pattern (cognitive 21) rust_port/crates/flow_services_code_action/src/autofix_match_syntax.rs:263 — Mapper::map_match_pattern has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (4 pts) (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.
  • Mapper::map_expression (cognitive 21) rust_port/crates/flow_services_code_action/src/autofix_prop_typo.rs:39 — Mapper::map_expression has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 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.
  • Mapper::map_type_ (cognitive 16) rust_port/crates/flow_services_code_action/src/autofix_legacy_flow_syntax.rs:39 — Mapper::map_type_ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, 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 · flow_services_export · ×5
  • flow_services_export::fuzzy_path::score_match::do_fuzzy_score (cognitive 68) rust_port/crates/flow_services_export/src/fuzzy_path/score_match.rs:218 — flow_services_export::fuzzy_path::score_match::do_fuzzy_score has cognitive complexity 68 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 10, loops 4 (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.
  • flow_services_export::fuzzy_path::score_match::do_score (cognitive 39) rust_port/crates/flow_services_export/src/fuzzy_path/score_match.rs:78 — flow_services_export::fuzzy_path::score_match::do_score has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 7 (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.
  • flow_services_export::export_service::add_imports (cognitive 24) rust_port/crates/flow_services_export/src/export_service.rs:270 — flow_services_export::export_service::add_imports has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 1 (6 pts), loops 1 (nesting depth added 17). 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.
  • flow_services_export::export_search::take (cognitive 23) rust_port/crates/flow_services_export/src/export_search.rs:216 — flow_services_export::export_search::take has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), match/switch 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.
  • flow_services_export::export_service::entries_of_exports_helper (cognitive 20) rust_port/crates/flow_services_export/src/export_service.rs:108 — flow_services_export::export_service::entries_of_exports_helper has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (7 pts), loops 1 (nesting depth added 12). 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 · Searcher · ×5
  • Searcher::generic_type (cognitive 34) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:612 — Searcher::generic_type has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 1 (6 pts), match/switch 1 (5 pts), 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.
  • Searcher::export_named_declaration (cognitive 32) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:382 — Searcher::export_named_declaration has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (30 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.
  • Searcher::pattern (cognitive 24) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:850 — Searcher::pattern has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (9 pts), boolean chains 3, 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.
  • Searcher::pattern (cognitive 23) rust_port/crates/flow_services_references/src/property_find_refs.rs:175 — Searcher::pattern has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 3 (8 pts), loops 1 (2 pts), boolean chains 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.
  • Searcher::expression_inner (cognitive 22) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1273 — Searcher::expression_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×5
  • Edited copy of a member (41 corresponding lines) rust_port/crates/flow_type_sig/src/type_sig.rs:980 — rust_port/crates/flow_type_sig/src/type_sig.rs:980-1020 | rust_port/crates/flow_type_sig/src/type_sig.rs:1105-1154 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:1588 — rust_port/crates/flow_typing_statement/src/statement.rs:1588-1628 | rust_port/crates/flow_typing_statement/src/statement.rs:1635-1675 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:6381 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:6381-6430 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6439-6479 — 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) rust_port/crates/flow_event_logger/src/lib.rs:1328 — rust_port/crates/flow_event_logger/src/lib.rs:1328-1370 | rust_port/crates/flow_event_logger/src/lib.rs:1390-1430 — 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) rust_port/crates/flow_config/src/flowconfig.rs:495 — rust_port/crates/flow_config/src/flowconfig.rs:495-545 | rust_port/crates/flow_config/src/flowconfig.rs:547-587 — 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 copy of a member (39 corresponding lines) · ×5
  • Edited copy of a member (39 corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4033 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4033-4071 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4940-4996 — 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) rust_port/crates/flow_common_ty/src/ty_debug.rs:1771 — rust_port/crates/flow_common_ty/src/ty_debug.rs:1771-1853 | rust_port/crates/flow_common_ty/src/ty_printer.rs:1888-1926 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3966 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3966-4004 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:4019-4062 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13110 — rust_port/crates/flow_parser/src/ast_visitor.rs:13110-13148 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4727-4768 — 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6428 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6428-6466 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7726-7767 — 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, 21+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 21+ corresponding lines) rust_port/crates/flow_parser/src/statement_parser.rs:1077 — rust_port/crates/flow_parser/src/statement_parser.rs:1077-1097 | rust_port/crates/flow_parser/src/statement_parser.rs:1103-1124 | rust_port/crates/flow_parser/src/statement_parser.rs:1126-1146 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1524 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1524-1545 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1579-1600 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1640-1660 — 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) rust_port/crates/flow_cli/src/apply_code_action_command.rs:36 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:36-64 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:149-171 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:252-272 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4273 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4273-4297 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4374-4395 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5538-5558 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7673 — rust_port/crates/flow_parser/src/ast_visitor.rs:7673-7693 | rust_port/crates/flow_parser/src/ast_visitor.rs:7803-7827 | rust_port/crates/flow_parser/src/ast_visitor.rs:7902-7926 — 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, 18+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 18+ corresponding lines) rust_port/crates/flow_common_utils/src/list_utils.rs:49 — rust_port/crates/flow_common_utils/src/list_utils.rs:49-66 | rust_port/crates/flow_common_utils/src/list_utils.rs:73-90 | rust_port/crates/flow_common_utils/src/list_utils.rs:101-118 — 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:3194 — rust_port/crates/flow_parser_wasm/src/serializer.rs:3194-3213 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3636-3653 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3665-3684 — 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) rust_port/crates/flow_type_sig/src/type_sig_hash.rs:158 — rust_port/crates/flow_type_sig/src/type_sig_hash.rs:158-175 | rust_port/crates/flow_type_sig/src/type_sig_hash.rs:183-200 | rust_port/crates/flow_type_sig/src/type_sig_hash.rs:207-224 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1708 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1708-1725 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5244-5261 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5533-5550 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3370 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3370-3392 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4370-4392 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4554-4571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 11+ corresponding lines) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1258 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1258-1268 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12017-12027 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12772-12782 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10226 — rust_port/crates/flow_parser/src/ast_visitor.rs:10226-10236 | rust_port/crates/flow_parser/src/ast_visitor.rs:10317-10327 | rust_port/crates/flow_parser/src/ast_visitor.rs:10416-10426 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6099 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6099-6109 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6778-6788 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6925-6935 — 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:6306 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:6306-6316 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:6318-6329 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:6342-6353 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:839 — rust_port/crates/flow_typing_utils/src/type_filter.rs:839-849 | rust_port/crates/flow_typing_utils/src/type_filter.rs:898-908 | rust_port/crates/flow_typing_utils/src/type_filter.rs:957-967 — 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 · Duplicated block (27 lines × 2) · ×5
  • Duplicated block (27 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12131 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12131-12157 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12671-12697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12131` 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) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7643 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7643-7669 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7680-7706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7643` 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 (27 lines × 2) rust_port/crates/flow_typing/src/merge.rs:801 — rust_port/crates/flow_typing/src/merge.rs:801-827 | rust_port/crates/flow_typing/src/merge.rs:875-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing/src/merge.rs:801` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) rust_port/crates/flow_services_code_action/src/code_action_service.rs:751 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:751-777 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:798-824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/code_action_service.rs:751` 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:1116 — rust_port/crates/flow_analysis/src/ssa_builder.rs:1116-1142 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2057-2083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_analysis/src/ssa_builder.rs:1116` 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 (21–22 lines × 2) · ×5
  • Duplicated block (21–22 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6107 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6107-6128 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6362-6382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6107` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5344 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5344-5365 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5428-5448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21–22 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10025 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10025-10045 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10047-10068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10047` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_flow_js/src/react_kit.rs:469 — rust_port/crates/flow_typing_flow_js/src/react_kit.rs:469-489 | rust_port/crates/flow_typing_flow_js/src/react_kit.rs:510-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 `rust_port/crates/flow_typing_flow_js/src/react_kit.rs:469` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21–22 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:5785 — rust_port/crates/flow_typing_statement/src/statement.rs:5785-5805 | rust_port/crates/flow_typing_statement/src/statement.rs:5812-5833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:5785` 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 × 3) · ×5
  • Duplicated block (17 lines × 3) rust_port/crates/flow_cli/src/apply_code_action_command.rs:103 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:103-119 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:208-224 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:307-323 — 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, `rust_port/crates/flow_cli/src/apply_code_action_command.rs:102` calls `get`, `truthy`, `unwrap` and `rust_port/crates/flow_cli/src/apply_code_action_command.rs:207` 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 (17 lines × 3) rust_port/crates/flow_parser/src/statement_parser.rs:1081 — rust_port/crates/flow_parser/src/statement_parser.rs:1081-1097 | rust_port/crates/flow_parser/src/statement_parser.rs:1108-1124 | rust_port/crates/flow_parser/src/statement_parser.rs:1130-1146 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:1081` 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) rust_port/crates/flow_typing_statement/src/statement.rs:12481 — rust_port/crates/flow_typing_statement/src/statement.rs:12481-12497 | rust_port/crates/flow_typing_statement/src/statement.rs:12513-12529 | rust_port/crates/flow_typing_statement/src/statement.rs:12546-12562 — 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) rust_port/crates/flow_typing_statement/src/statement.rs:17496 — rust_port/crates/flow_typing_statement/src/statement.rs:17496-17512 | rust_port/crates/flow_typing_statement/src/statement.rs:17713-17729 | rust_port/crates/flow_typing_statement/src/statement.rs:17866-17882 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17496` 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3747 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3747-3763 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3784-3800 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3823-3839 — 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 `rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3747` 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–16 lines × 2) · ×5
  • Duplicated block (15–16 lines × 2) rust_port/crates/flow_analysis/src/property_assignment.rs:618 — rust_port/crates/flow_analysis/src/property_assignment.rs:618-632 | rust_port/crates/flow_analysis/src/ssa_builder.rs:829-844 — before extracting anything, compare `rust_port/crates/flow_analysis/src/property_assignment.rs` and `rust_port/crates/flow_analysis/src/ssa_builder.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 134 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–16 lines × 2) rust_port/crates/flow_heap/src/transaction.rs:1116 — rust_port/crates/flow_heap/src/transaction.rs:1116-1130 | rust_port/crates/flow_heap/src/transaction.rs:1192-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_heap/src/transaction.rs:1192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–16 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:1072 — rust_port/crates/flow_parser/src/object_parser.rs:1072-1086 | rust_port/crates/flow_parser/src/object_parser.rs:1149-1164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/object_parser.rs:1072` 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, `rust_port/crates/flow_parser/src/object_parser.rs:1087` calls `should_parse_types`, `error` and `rust_port/crates/flow_parser/src/object_parser.rs:1165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–16 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5034 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5034-5048 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5174-5189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5034` 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, `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5192` calls `dupe` and `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5051` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–16 lines × 2) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2665 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2665-2680 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2689-2703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2665` it begins part-way through the construct above it, so those 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 × 3) · ×5
  • Duplicated block (15 lines × 3) rust_port/crates/flow_env_builder/src/name_def.rs:4493 — rust_port/crates/flow_env_builder/src/name_def.rs:4493-4507 | rust_port/crates/flow_env_builder/src/name_def.rs:4509-4523 | rust_port/crates/flow_env_builder/src/name_def.rs:4525-4539 — 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 (15 lines × 3) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1526 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1526-1540 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1581-1595 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1641-1655 — 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 (15 lines × 3) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8525 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8525-8539 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8556-8570 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8592-8606 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:8525` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/func_sig.rs:705 — rust_port/crates/flow_typing_statement/src/func_sig.rs:705-719 | rust_port/crates/flow_typing_statement/src/func_sig.rs:732-746 | rust_port/crates/flow_typing_statement/src/func_sig.rs:759-773 — 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 `rust_port/crates/flow_typing_statement/src/func_sig.rs:705` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:3025 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:3025-3040 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3046-3060 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3065-3079 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:3025` it begins part-way through the construct above it, so those 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 lines × 3) · ×5
  • Duplicated block (12 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8085 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8085-8096 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8610-8621 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8957-8968 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8085` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8125 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8125-8136 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8521-8532 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8860-8871 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8125` it does not close everything it opens, so those 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 × 3) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6524 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6524-6535 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6542-6553 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6560-6571 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6524` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2569 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2569-2580 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2600-2611 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2923-2934 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2569` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:7927 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:7927-7940 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:7942-7953 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:7955-7969 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×5
  • Duplicated block (9–10 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1729 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1729-1738 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1757-1765 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1830-1838 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1729` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1756` calls `HooklikeT` and `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1829` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–10 lines × 3) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:610 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:610-619 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:758-766 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:874-882 — 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 `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:610` it begins part-way through the construct above it, so those exact lines 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 × 3) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:196 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:196-205 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6595-6603 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6662-6670 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 3) rust_port/crates/flow_parser/src/object_parser.rs:2093 — rust_port/crates/flow_parser/src/object_parser.rs:2093-2102 | rust_port/crates/flow_parser/src/object_parser.rs:2109-2118 | rust_port/crates/flow_parser/src/object_parser.rs:2119-2127 — 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 `rust_port/crates/flow_parser/src/object_parser.rs:2093` 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 (9–10 lines × 3) rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:143 — rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:143-152 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:165-174 | rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:186-194 — 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 `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:143` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:143` calls `clone` and `rust_port/crates/flow_services_code_action/src/convert_type_to_readonly_form.rs:186` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×5
  • Duplicated block (8 lines × 4) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:412 — rust_port/crates/flow_services_get_def/src/get_def_utils.rs:412-419 | rust_port/crates/flow_services_get_def/src/get_def_utils.rs:421-428 | rust_port/crates/flow_services_get_def/src/get_def_utils.rs:430-437 | rust_port/crates/flow_services_get_def/src/get_def_utils.rs:439-446 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 4) rust_port/crates/flow_typing_statement/src/func_sig.rs:683 — rust_port/crates/flow_typing_statement/src/func_sig.rs:683-690 | rust_port/crates/flow_typing_statement/src/func_sig.rs:706-713 | rust_port/crates/flow_typing_statement/src/func_sig.rs:733-740 | rust_port/crates/flow_typing_statement/src/func_sig.rs:760-767 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:1137 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1137-1144 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1237-1244 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1361-1368 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1457-1464 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:1137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1876 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1876-1883 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4861-4868 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4895-4902 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4914-4921 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1876` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1128 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1128-1135 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1155-1162 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1187-1194 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1232-1239 — 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, `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1163` calls `annot`, `in_implicit_instantiation` and `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1136` 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.
D1 · Cyclomatic Complexity · flow_common · ×4
  • flow_common::reason::code_desc_of_expression (cyclomatic 88) rust_port/crates/flow_common/src/reason.rs:1292 — flow_common::reason::code_desc_of_expression has cyclomatic complexity 88 (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.
  • flow_common::reason::code_desc_of_operation (cyclomatic 39) rust_port/crates/flow_common/src/reason.rs:1539 — flow_common::reason::code_desc_of_operation has cyclomatic complexity 39 (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: flow_common::reason::string_of_desc (cyclomatic 62) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_common::files::make_next_files (cyclomatic 28) rust_port/crates/flow_common/src/files.rs:1032 — flow_common::files::make_next_files has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_common::js_number::ecma_string_of_float (cyclomatic 16) rust_port/crates/flow_common/src/js_number.rs:59 — flow_common::js_number::ecma_string_of_float 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 · getTransforms · ×4
  • getTransforms::GenericTypeAnnotation (cyclomatic 81) REDACTED:2491 — getTransforms::GenericTypeAnnotation 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.
  • getTransforms::DeclareExportDeclaration (cyclomatic 30) REDACTED:1384 — getTransforms::DeclareExportDeclaration 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.
  • getTransforms::ObjectTypeAnnotation (cyclomatic 25) REDACTED:3802 — getTransforms::ObjectTypeAnnotation 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.
  • getTransforms::DeclareClass (cyclomatic 20) REDACTED:1150 — getTransforms::DeclareClass 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 · Writer · ×4
  • Writer::expression (cyclomatic 65) rust_port/crates/flow_parser_utils_output/src/indented_printer/expressions.rs:15 — Writer::expression has cyclomatic complexity 65 (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.
  • Writer::statement (cyclomatic 45) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:28 — Writer::statement has cyclomatic complexity 45 (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.
  • Writer::class_element (cyclomatic 20) rust_port/crates/flow_parser_utils_output/src/indented_printer/statements.rs:497 — Writer::class_element 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.
  • Writer::pattern (cyclomatic 18) rust_port/crates/flow_parser_utils_output/src/indented_printer/patterns.rs:14 — Writer::pattern 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 · flow_lsp_server · ×4
  • flow_lsp_server::flow_lsp::main_handle_initialized_unsafe (cyclomatic 62) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2793 — flow_lsp_server::flow_lsp::main_handle_initialized_unsafe has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • flow_lsp_server::flow_lsp::try_connect (cyclomatic 21) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2445 — flow_lsp_server::flow_lsp::try_connect 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.
  • flow_lsp_server::flow_lsp::main_handle_unsafe (cyclomatic 19) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3272 — flow_lsp_server::flow_lsp::main_handle_unsafe 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.
  • flow_lsp_server::flow_lsp::main_handle_error (cyclomatic 18) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3572 — flow_lsp_server::flow_lsp::main_handle_error 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 · flow_typing_type · ×4
  • flow_typing_type::type_util::mod_loc_of_virtual_use_op::mod_loc_of_root_use_op (cyclomatic 51) rust_port/crates/flow_typing_type/src/type_util.rs:1087 — flow_typing_type::type_util::mod_loc_of_virtual_use_op::mod_loc_of_root_use_op 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.
  • flow_typing_type::type_util::ground_subtype (cyclomatic 46) rust_port/crates/flow_typing_type/src/type_util.rs:2028 — flow_typing_type::type_util::ground_subtype 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.
  • flow_typing_type::type_util::is_mixed_subtype (cyclomatic 19) rust_port/crates/flow_typing_type/src/type_util.rs:1965 — flow_typing_type::type_util::is_mixed_subtype has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. 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: flow_typing_type::type_util::util_use_op_of_use_t (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 function is counted neither in this dimension's figures nor in its score.
  • flow_typing_type::type_::union_rep::disjoint_union_optimize (cyclomatic 17) rust_port/crates/flow_typing_type/src/type_.rs:9042 — flow_typing_type::type_::union_rep::disjoint_union_optimize has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (almost_unique_values, intersect_props, base_props_of, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: flow_typing_type::type_::string_of_use_ctor (cyclomatic 75) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_cli_support · ×4
  • flow_cli_support::glean_runner::source_of_exports (cyclomatic 23) rust_port/crates/flow_cli/src/glean_runner.rs:968 — flow_cli_support::glean_runner::source_of_exports has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (soes_of_packed, soes_of_packed_value, soes_of_packed_def, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • flow_cli_support::ast_command::main (cyclomatic 18) rust_port/crates/flow_cli/src/ast_command.rs:187 — flow_cli_support::ast_command::main 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.
  • flow_cli_support::ls_command::main_impl (cyclomatic 18) rust_port/crates/flow_cli/src/ls_command.rs:347 — flow_cli_support::ls_command::main_impl 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.
  • flow_cli_support::stop_command::main (cyclomatic 16) rust_port/crates/flow_cli/src/stop_command.rs:33 — flow_cli_support::stop_command::main 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 · flow_lsp_server · ×4
  • flow_lsp_server::flow_lsp::main_handle_initialized_unsafe (cognitive 98) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2793 — flow_lsp_server::flow_lsp::main_handle_initialized_unsafe has cognitive complexity 98 (threshold 15). Drivers by points: if/else 31 (70 pts), match/switch 11 (25 pts), loops 1 (3 pts) (nesting depth added 55). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_lsp_server::flow_lsp::try_connect (cognitive 29) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:2445 — flow_lsp_server::flow_lsp::try_connect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 4 (8 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.
  • flow_lsp_server::flow_lsp::main_handle_error (cognitive 22) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3572 — flow_lsp_server::flow_lsp::main_handle_error has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 4 (9 pts) (nesting depth added 12). 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.
  • flow_lsp_server::flow_lsp::main_handle_unsafe (cognitive 16) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3272 — flow_lsp_server::flow_lsp::main_handle_unsafe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (7 pts) (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 · ErrorMessage · ×4
  • ErrorMessage::friendly_message_of_msg (cognitive 81) rust_port/crates/flow_typing_errors/src/error_message.rs:9925 — ErrorMessage::friendly_message_of_msg has cognitive complexity 81 (threshold 15). Drivers by points: match/switch 23 (47 pts), if/else 18 (32 pts), boolean chains 2 (nesting depth added 38). 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.
  • ErrorMessage::map_loc_of_error_message (cognitive 40) rust_port/crates/flow_typing_errors/src/error_message.rs:4658 — ErrorMessage::map_loc_of_error_message has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 20 (40 pts) (nesting depth added 20). 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.
  • ErrorMessage::convert_type_to_type_desc (cognitive 26) rust_port/crates/flow_typing_errors/src/error_message.rs:7021 — ErrorMessage::convert_type_to_type_desc has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 14 (26 pts) (nesting depth added 12). Of this number, 13 points are the body's own statements and 13 belong to 3 function items inside it that branch. 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.
  • ErrorMessage::error_code_of_message (cognitive 20) rust_port/crates/flow_typing_errors/src/error_message.rs:13031 — ErrorMessage::error_code_of_message has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 2 (3 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · getTransforms · ×4
  • getTransforms::ObjectTypeAnnotation (cognitive 47) REDACTED:3802 — getTransforms::ObjectTypeAnnotation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 5 (8 pts), ternaries 2 (5 pts), boolean chains 3, other 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.
  • getTransforms::DeclareExportDeclaration (cognitive 40) REDACTED:1384 — getTransforms::DeclareExportDeclaration has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 2 (7 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.
  • getTransforms::GenericTypeAnnotation (cognitive 37) REDACTED:2491 — getTransforms::GenericTypeAnnotation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, match/switch 2 (3 pts), other 3, 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.
  • getTransforms::DeclareClass (cognitive 22) REDACTED:1150 — getTransforms::DeclareClass has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 4 (6 pts), other 5, match/switch 2 (4 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 · flow_services_autocomplete · ×4
  • flow_services_autocomplete::autofix_imports::update_import (cognitive 28) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:247 — flow_services_autocomplete::autofix_imports::update_import has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (6 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_autocomplete::autocomplete_service_js::autocomplete_member (cognitive 25) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:2161 — flow_services_autocomplete::autocomplete_service_js::autocomplete_member has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 5 (10 pts), boolean chains 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.
  • flow_services_autocomplete::autocomplete_service_js::local_value_identifiers::is_record_type (cognitive 20) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:727 — flow_services_autocomplete::autocomplete_service_js::local_value_identifiers::is_record_type has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (20 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_autocomplete::autocomplete_service_js::autocomplete_id (cognitive 20) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1237 — flow_services_autocomplete::autocomplete_service_js::autocomplete_id has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (3 pts), loops 1 (2 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, 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3063 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3063-3097 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3102-3136 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3141-3187 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3202-3248 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6174-6220 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:3839 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:3839-3969 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3979-4022 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:5348-5480 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:5566-5628 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6543-6598 — 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) rust_port/crates/flow_services_inference/src/type_service.rs:1487 — rust_port/crates/flow_services_inference/src/type_service.rs:1487-1766 | rust_port/crates/flow_services_inference/src/type_service.rs:2191-2369 | rust_port/crates/flow_services_inference/src/type_service.rs:2770-2973 | rust_port/crates/flow_services_inference/src/type_service.rs:3156-3354 | rust_port/crates/flow_services_inference/src/type_service.rs:3981-4170 — 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) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1016 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1016-1037 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2438-2483 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2485-2520 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2541-2599 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2674-2707 — 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 (71 corresponding lines) · ×4
  • Edited copy of a member (71 corresponding lines) rust_port/crates/flow_services_inference/src/merge_service.rs:997 — rust_port/crates/flow_services_inference/src/merge_service.rs:997-1081 | rust_port/crates/flow_services_inference/src/merge_service.rs:1094-1164 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (71 corresponding lines) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7835 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:7835-7905 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11673-11751 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (71 corresponding lines) rust_port/crates/flow_typing_statement/src/statement.rs:22055 — rust_port/crates/flow_typing_statement/src/statement.rs:22055-22125 | rust_port/crates/flow_typing_statement/src/statement.rs:22132-22210 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (71 corresponding lines) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1080 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1080-1150 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1212-1285 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (35 corresponding lines) · ×4
  • Edited copy of a member (35 corresponding lines) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4993 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4993-5027 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5038-5075 — 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) rust_port/crates/flow_parser/src/type_parser.rs:295 — rust_port/crates/flow_parser/src/type_parser.rs:295-329 | rust_port/crates/flow_parser/src/type_parser.rs:357-392 — 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) rust_port/crates/flow_common_errors/src/error_utils.rs:4649 — rust_port/crates/flow_common_errors/src/error_utils.rs:4649-4690 | rust_port/crates/flow_hh_json/src/lib.rs:34-68 — 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) rust_port/crates/flow_parser/src/estree_translator.rs:2976 — rust_port/crates/flow_parser/src/estree_translator.rs:2976-3010 | rust_port/crates/flow_parser/src/estree_translator.rs:4019-4053 — 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 · Edited copy of a member (34 corresponding lines) · ×4
  • Edited copy of a member (34 corresponding lines) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3326 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3326-3359 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3363-3396 — 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) rust_port/crates/flow_server_command_handler/src/command_handler.rs:8159 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:8159-8210 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:8218-8251 — 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) rust_port/crates/flow_typing_type/src/type_.rs:4731 — rust_port/crates/flow_typing_type/src/type_.rs:4731-4764 | rust_port/crates/flow_typing_type/src/type_.rs:4970-5003 — 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) rust_port/crates/flow_services_code_action/src/insert_type.rs:988 — rust_port/crates/flow_services_code_action/src/insert_type.rs:988-1021 | rust_port/crates/flow_services_code_action/src/insert_type.rs:1122-1156 — 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, 22+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 22+ corresponding lines) rust_port/crates/flow_cli/src/foreground_check_commands.rs:375 — rust_port/crates/flow_cli/src/foreground_check_commands.rs:375-398 | rust_port/crates/flow_cli/src/server_command.rs:14-35 | rust_port/crates/flow_cli/src/start_command.rs:16-44 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1997 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1997-2018 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6043-6065 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6115-6136 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1215 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1215-1239 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4131-4157 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6086-6107 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:15385 — rust_port/crates/flow_parser/src/ast_visitor.rs:15385-15406 | rust_port/crates/flow_parser/src/ast_visitor.rs:18116-18137 | rust_port/crates/flow_parser/src/ast_visitor.rs:18161-18184 — 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 (3 members, 23+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 23+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:8207 — rust_port/crates/flow_parser/src/ast_visitor.rs:8207-8238 | rust_port/crates/flow_parser/src/ast_visitor.rs:8686-8708 | rust_port/crates/flow_parser/src/ast_visitor.rs:15257-15283 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13566 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13566-13594 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13674-13702 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13711-13733 — 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) rust_port/crates/flow_services_code_action/src/code_action_service.rs:3403 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:3403-3432 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:3450-3472 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:3493-3518 — 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) rust_port/crates/flow_cli/src/codemod_command.rs:436 — rust_port/crates/flow_cli/src/codemod_command.rs:436-463 | rust_port/crates/flow_cli/src/codemod_command.rs:549-571 | rust_port/crates/flow_cli/src/codemod_command.rs:706-733 — 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, 19+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 19+ corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3975 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3975-4003 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4066-4094 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4165-4183 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9843 — rust_port/crates/flow_parser/src/ast_visitor.rs:9843-9866 | rust_port/crates/flow_parser/src/ast_visitor.rs:13758-13782 | rust_port/crates/flow_parser/src/ast_visitor.rs:18352-18370 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7542 — rust_port/crates/flow_parser/src/ast_visitor.rs:7542-7560 | rust_port/crates/flow_parser/src/ast_visitor.rs:7752-7770 | rust_port/crates/flow_parser/src/ast_visitor.rs:7989-8007 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2273 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2273-2293 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2295-2313 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2315-2334 — 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 (3 members, 15+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 15+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:11603 — rust_port/crates/flow_parser/src/ast_visitor.rs:11603-11617 | rust_port/crates/flow_parser/src/ast_visitor.rs:11996-12010 | rust_port/crates/flow_parser/src/ast_visitor.rs:17840-17856 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1029 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1029-1043 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3995-4009 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5511-5528 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1902 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1902-1919 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1952-1969 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2183-2197 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:9462 — rust_port/crates/flow_parser/src/ast_visitor.rs:9462-9478 | rust_port/crates/flow_parser/src/ast_visitor.rs:14990-15004 | rust_port/crates/flow_parser/src/ast_visitor.rs:16514-16528 — 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 copies of one member (5 members, 15+ corresponding lines) · ×4
  • Edited copies of one member (5 members, 15+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:10189 — rust_port/crates/flow_parser/src/ast_visitor.rs:10189-10206 | rust_port/crates/flow_parser/src/ast_visitor.rs:10278-10297 | rust_port/crates/flow_parser/src/ast_visitor.rs:13733-13752 | rust_port/crates/flow_parser/src/ast_visitor.rs:18647-18661 | rust_port/crates/flow_parser/src/ast_visitor.rs:18684-18698 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:942 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:942-956 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2713-2727 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2732-2746 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4851-4865 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5961-5975 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:6986 — rust_port/crates/flow_parser/src/ast_visitor.rs:6986-7002 | rust_port/crates/flow_parser/src/ast_visitor.rs:7025-7041 | rust_port/crates/flow_parser/src/ast_visitor.rs:8464-8481 | rust_port/crates/flow_parser/src/ast_visitor.rs:9403-9417 | rust_port/crates/flow_parser/src/ast_visitor.rs:15028-15044 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8258 — rust_port/crates/flow_parser/src/ast_visitor.rs:8258-8273 | rust_port/crates/flow_parser/src/ast_visitor.rs:8758-8773 | rust_port/crates/flow_parser/src/ast_visitor.rs:15825-15840 | rust_port/crates/flow_parser/src/ast_visitor.rs:15981-15995 | rust_port/crates/flow_parser/src/ast_visitor.rs:18243-18258 — 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 (4 members, 14+ corresponding lines) · ×4
  • Edited copies of one member (4 members, 14+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:92 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:92-105 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:865-878 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2639-2653 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6649-6662 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:10866 — rust_port/crates/flow_parser/src/ast_visitor.rs:10866-10879 | rust_port/crates/flow_parser/src/ast_visitor.rs:18054-18067 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2472-2486 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6368-6382 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:17518 — rust_port/crates/flow_parser/src/ast_visitor.rs:17518-17531 | rust_port/crates/flow_parser/src/ast_visitor.rs:17694-17707 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4460-4474 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4583-4597 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:13620 — rust_port/crates/flow_parser/src/ast_visitor.rs:13620-13633 | rust_port/crates/flow_parser/src/ast_visitor.rs:15122-15139 | rust_port/crates/flow_parser/src/ast_visitor.rs:15364-15380 | rust_port/crates/flow_parser/src/ast_visitor.rs:18142-18156 — 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 · Duplicated block (35 lines × 2) · ×4
  • Duplicated block (35 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:2274 — rust_port/crates/flow_parser/src/object_parser.rs:2274-2308 | rust_port/crates/flow_parser/src/object_parser.rs:2314-2348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/object_parser.rs:2274` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_services_inference/src/merge_service.rs:998 — rust_port/crates/flow_services_inference/src/merge_service.rs:998-1032 | rust_port/crates/flow_services_inference/src/merge_service.rs:1095-1129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_inference/src/merge_service.rs:998` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4085 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:4085-4119 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4243-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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:4085` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4997 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:4997-5031 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:5078-5112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:4997` 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 (30 lines × 2) · ×4
  • Duplicated block (30 lines × 2) rust_port/crates/flow_env_builder/src/find_providers.rs:1629 — rust_port/crates/flow_env_builder/src/find_providers.rs:1629-1658 | rust_port/crates/flow_env_builder/src/find_providers.rs:1664-1693 — both copies are in the same file, so extract the 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 (30 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3569 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3569-3598 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3620-3649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3569` 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 (30 lines × 2) rust_port/crates/flow_common_ty/src/ty_utils.rs:647 — rust_port/crates/flow_common_ty/src/ty_utils.rs:647-676 | rust_port/crates/flow_common_ty/src/ty_utils.rs:699-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_utils.rs:647` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_parser/src/estree_translator.rs:2980 — rust_port/crates/flow_parser/src/estree_translator.rs:2980-3009 | rust_port/crates/flow_parser/src/estree_translator.rs:4023-4052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:2980` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×4
  • Duplicated block (28–29 lines × 2) rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3716 — rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3716-3743 | rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3747-3775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_lsp_server/src/flow_lsp.rs:3747` 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 (28–29 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3739 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3739-3766 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3809-3837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3739` it begins part-way through the construct above it, so those exact lines 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–29 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3533 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3533-3561 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3566-3593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3533` it begins part-way through the construct above it, so those exact lines 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–29 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3985 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3985-4012 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4020-4048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4020` it begins part-way through the construct above it, so those 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–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4448 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4448-4465 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4499-4517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4448` 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) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:915 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:915-932 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:965-983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:915` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:6753 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:6753-6771 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:6777-6794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:6753` 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:2431 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2431-2449 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3905-3922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:2431` 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–18 lines × 2) · ×4
  • Duplicated block (17–18 lines × 2) rust_port/crates/flow_codemods/src/annotate_exports.rs:814 — rust_port/crates/flow_codemods/src/annotate_exports.rs:814-831 | rust_port/crates/flow_codemods/src/annotate_exports.rs:858-874 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_codemods/src/annotate_exports.rs:814` 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) rust_port/crates/flow_typing/src/env_resolution.rs:2625 — rust_port/crates/flow_typing/src/env_resolution.rs:2625-2641 | rust_port/crates/flow_typing/src/env_resolution.rs:2648-2665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing/src/env_resolution.rs:2625` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7879 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:7879-7895 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:7997-8014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:7879` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2283 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2283-2300 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:2336-2352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/annotation_inference.rs: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.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×4
  • Duplicated block (16–18 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:265 — rust_port/crates/flow_parser/src/object_parser.rs:265-282 | rust_port/crates/flow_parser/src/object_parser.rs:323-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/object_parser.rs:265` 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–18 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:3266 — rust_port/crates/flow_parser/src/statement_parser.rs:3266-3281 | rust_port/crates/flow_parser/src/statement_parser.rs:3515-3532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:3266` 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) rust_port/crates/flow_parser/src/type_parser.rs:3853 — rust_port/crates/flow_parser/src/type_parser.rs:3853-3870 | rust_port/crates/flow_parser/src/type_parser.rs:3926-3941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/type_parser.rs:3853` it does not close everything it opens, so those 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–18 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:1767 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:1767-1784 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:1901-1916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:1767` it does not close everything it opens, so those 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 × 3) · ×4
  • Duplicated block (13 lines × 3) rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:149 — rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:149-161 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2240-2252 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2408-2420 — 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 (13 lines × 3) rust_port/crates/flow_dot_js_wasm/src/lib.rs:817 — rust_port/crates/flow_dot_js_wasm/src/lib.rs:817-829 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1145-1157 | rust_port/crates/flow_dot_js_wasm/src/lib.rs:1184-1196 — 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) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890-9902 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9911-9923 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10117-10129 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9890` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:5462 — rust_port/crates/flow_typing_statement/src/statement.rs:5462-5474 | rust_port/crates/flow_typing_statement/src/statement.rs:5534-5546 | rust_port/crates/flow_typing_statement/src/statement.rs:5617-5629 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:5462` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_statement/src/statement.rs:5547` calls `extract_getter_type` and `rust_port/crates/flow_typing_statement/src/statement.rs:5475` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×4
  • Duplicated block (12 lines × 4) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7282 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7282-7293 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7350-7361 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7413-7424 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7448-7459 — 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 (12 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:9976 — rust_port/crates/flow_typing_statement/src/statement.rs:9976-9987 | rust_port/crates/flow_typing_statement/src/statement.rs:10398-10409 | rust_port/crates/flow_typing_statement/src/statement.rs:10569-10580 | rust_port/crates/flow_typing_statement/src/statement.rs:10734-10745 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:9976` 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 × 4) rust_port/crates/flow_typing_statement/src/type_annotation.rs:8229 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:8229-8240 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8323-8334 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8415-8426 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8492-8503 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:8229` 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) rust_port/crates/flow_parser/src/estree_translator.rs:3469 — rust_port/crates/flow_parser/src/estree_translator.rs:3469-3480 | rust_port/crates/flow_parser/src/estree_translator.rs:3504-3515 | rust_port/crates/flow_parser/src/estree_translator.rs:3544-3555 | rust_port/crates/flow_parser/src/estree_translator.rs:5448-5460 — 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 `rust_port/crates/flow_parser/src/estree_translator.rs:3469` 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 × 5) · ×4
  • Duplicated block (10 lines × 5) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3078 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3078-3087 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3115-3124 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3162-3171 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3223-3232 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6193-6202 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3125` calls `as_ref`, `variance`, `transpose` and `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3088` 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 × 5) rust_port/crates/flow_typing_debug/src/lib.rs:2164 — rust_port/crates/flow_typing_debug/src/lib.rs:2164-2173 | rust_port/crates/flow_typing_debug/src/lib.rs:2181-2190 | rust_port/crates/flow_typing_debug/src/lib.rs:2198-2207 | rust_port/crates/flow_typing_debug/src/lib.rs:2215-2224 | rust_port/crates/flow_typing_debug/src/lib.rs:4193-4202 — 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 `rust_port/crates/flow_typing_debug/src/lib.rs:2164` 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 × 5) rust_port/crates/flow_typing_statement/src/type_annotation.rs:1464 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:1464-1473 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4087-4096 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4108-4117 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4245-4254 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4266-4275 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:1464` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_statement/src/type_annotation.rs:1463` calls `mk_eval_id`, `dupe` and `rust_port/crates/flow_typing_statement/src/type_annotation.rs:4107` 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 × 5) rust_port/crates/flow_typing_utils/src/type_filter.rs:798 — rust_port/crates/flow_typing_utils/src/type_filter.rs:798-807 | rust_port/crates/flow_typing_utils/src/type_filter.rs:884-893 | rust_port/crates/flow_typing_utils/src/type_filter.rs:943-952 | rust_port/crates/flow_typing_utils/src/type_filter.rs:989-998 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1041-1050 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
S1 · Web-Security Posture · Weak hash algorithm · ×4
  • Weak hash algorithm rust_port/crates/flow_common_socket/src/socket.rs:136 — 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+ (`sha2::Sha256::digest(…)`) 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 rust_port/crates/flow_common_socket/src/socket.rs:232 — 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+ (`sha2::Sha256::digest(…)`) 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 rust_port/crates/flow_server_files/src/server_files_js.rs:43 — 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+ (`sha2::Sha256::digest(…)`) 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 rust_port/crates/flow_server_files/src/server_files_js.rs:52 — 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+ (`sha2::Sha256::digest(…)`) 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.
D1 · Cyclomatic Complexity · flow_typing_debug · ×3
  • flow_typing_debug::dump_error_message (cyclomatic 378) rust_port/crates/flow_typing_debug/src/lib.rs:1966 — flow_typing_debug::dump_error_message has cyclomatic complexity 378 (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.
  • flow_typing_debug::dump_use_t_ (cyclomatic 112) rust_port/crates/flow_typing_debug/src/lib.rs:923 — flow_typing_debug::dump_use_t_ has cyclomatic complexity 112 (threshold 15). Of this number, 110 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • flow_typing_debug::dump_t_ (cyclomatic 87) rust_port/crates/flow_typing_debug/src/lib.rs:431 — flow_typing_debug::dump_t_ has cyclomatic complexity 87 (threshold 15). Of this number, 75 points are the body's own statements and 12 belong to 3 function items inside it that branch. 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 · flow_env_builder_resolver · ×3
  • flow_env_builder_resolver::name_def_ordering::depends (cyclomatic 116) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1442 — flow_env_builder_resolver::name_def_ordering::depends has cyclomatic complexity 116 (threshold 15). Of this number, 26 points are the body's own statements and 90 belong to 23 function items inside it that branch. 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.
  • flow_env_builder_resolver::name_def_ordering::build_ordering (cyclomatic 30) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4102 — flow_env_builder_resolver::name_def_ordering::build_ordering has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to 3 function items 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.
  • flow_env_builder_resolver::name_def_ordering::annotation_locs (cyclomatic 20) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3865 — flow_env_builder_resolver::name_def_ordering::annotation_locs has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (bind_loop). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · flow_common_ty · ×3
  • flow_common_ty::ty_printer::type_impl (cyclomatic 50) rust_port/crates/flow_common_ty/src/ty_printer.rs:298 — flow_common_ty::ty_printer::type_impl has cyclomatic complexity 50 (threshold 15). Of this number, 45 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
  • flow_common_ty::ty_debug::dump_t (cyclomatic 45) rust_port/crates/flow_common_ty/src/ty_debug.rs:568 — flow_common_ty::ty_debug::dump_t has cyclomatic complexity 45 (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.
  • flow_common_ty::ty_debug::dump_decl (cyclomatic 17) rust_port/crates/flow_common_ty/src/ty_debug.rs:753 — flow_common_ty::ty_debug::dump_decl 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. This is NOT this file's highest cyclomatic complexity: flow_common_ty::ty_debug::string_of_ctor_t (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_parser_utils · ×3
  • flow_parser_utils::enum_validate::validate_implicit_type (cyclomatic 26) rust_port/crates/flow_parser_utils/src/enum_validate.rs:448 — flow_parser_utils::enum_validate::validate_implicit_type 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.
  • flow_parser_utils::flow_ast_differ::list_diff (cyclomatic 24) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:65 — flow_parser_utils::flow_ast_differ::list_diff has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function items 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. This is NOT this file's highest cyclomatic complexity: flow_parser_utils::flow_ast_differ::statement (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 function is counted neither in this dimension's figures nor in its score.
  • flow_parser_utils::flow_ast_differ::match_pattern (cyclomatic 21) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6203 — flow_parser_utils::flow_ast_differ::match_pattern 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: flow_parser_utils::flow_ast_differ::statement (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_services_autocomplete · ×3
  • flow_services_autocomplete::autocomplete_service_js::autocomplete_get_results (cyclomatic 26) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:3054 — flow_services_autocomplete::autocomplete_service_js::autocomplete_get_results 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.
  • flow_services_autocomplete::autocomplete_service_js::autocomplete_unqualified_type (cyclomatic 16) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1875 — flow_services_autocomplete::autocomplete_service_js::autocomplete_unqualified_type 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. This is NOT this file's highest cyclomatic complexity: flow_services_autocomplete::autocomplete_service_js::string_of_autocomplete_type (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 function is counted neither in this dimension's figures nor in its score.
  • flow_services_autocomplete::autofix_imports::update_import (cyclomatic 16) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:247 — flow_services_autocomplete::autofix_imports::update_import 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.
D10 · Test Quality · No assertions · ×3
  • No assertions: (unnamed test) tests/closure/callback_writes.js:4 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: first tests/closure/callback_writes.js:9 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: second tests/closure/callback_writes.js:17 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D2 · Cognitive Complexity · flow_typing_debug · ×3
  • flow_typing_debug::dump_error_message (cognitive 153) rust_port/crates/flow_typing_debug/src/lib.rs:1966 — flow_typing_debug::dump_error_message has cognitive complexity 153 (threshold 15). Drivers by points: match/switch 87 (153 pts) (nesting depth added 66). Of this number, 151 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
  • flow_typing_debug::dump_use_t_ (cognitive 59) rust_port/crates/flow_typing_debug/src/lib.rs:923 — flow_typing_debug::dump_use_t_ has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 37 (51 pts), if/else 5 (6 pts), boolean chains 1, loops 1 (nesting depth added 15). Of this number, 56 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
  • flow_typing_debug::dump_t_ (cognitive 54) rust_port/crates/flow_typing_debug/src/lib.rs:431 — flow_typing_debug::dump_t_ has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 20 (46 pts), if/else 7, boolean chains 1 (nesting depth added 26). Of this number, 47 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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 · flow_env_builder_resolver · ×3
  • flow_env_builder_resolver::name_def_ordering::build_ordering (cognitive 112) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:4102 — flow_env_builder_resolver::name_def_ordering::build_ordering has cognitive complexity 112 (threshold 15). Drivers by points: if/else 18 (56 pts), loops 13 (43 pts), match/switch 3 (12 pts), boolean chains 1 (nesting depth added 77). Of this number, 77 points are the body's own statements and 35 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • flow_env_builder_resolver::name_def_ordering::annotation_locs::bind_loop (cognitive 26) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3875 — flow_env_builder_resolver::name_def_ordering::annotation_locs::bind_loop has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 4 (9 pts), loops 1 (2 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_env_builder_resolver::name_def_ordering::depends::depends_of_hint (cognitive 20) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1707 — flow_env_builder_resolver::name_def_ordering::depends::depends_of_hint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (6 pts), match/switch 3 (6 pts) (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 · flow_parsing · ×3
  • flow_parsing::docblock_parser::extract_docblock::parse_attributes (cognitive 96) rust_port/crates/flow_parsing/src/docblock_parser.rs:70 — flow_parsing::docblock_parser::extract_docblock::parse_attributes has cognitive complexity 96 (threshold 15). Drivers by points: if/else 34 (87 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (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.
  • flow_parsing::parsing_service::reducer (cognitive 20) rust_port/crates/flow_parsing/src/parsing_service.rs:502 — flow_parsing::parsing_service::reducer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (4 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.
  • flow_parsing::parsing_service::do_parse (cognitive 19) rust_port/crates/flow_parsing/src/parsing_service.rs:294 — flow_parsing::parsing_service::do_parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (5 pts) (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 · flow_services_get_def · ×3
  • flow_services_get_def::get_def_utils::def_info_of_typecheck_results (cognitive 45) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:924 — flow_services_get_def::get_def_utils::def_info_of_typecheck_results has cognitive complexity 45 (threshold 15). Drivers by points: match/switch 9 (30 pts), loops 2 (9 pts), if/else 4 (6 pts) (nesting depth added 30). Of this number, 38 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
  • flow_services_get_def::get_def_js::get_def::loop_fn (cognitive 43) rust_port/crates/flow_services_get_def/src/get_def_js.rs:224 — flow_services_get_def::get_def_js::get_def::loop_fn has cognitive complexity 43 (threshold 15). Drivers by points: match/switch 9 (27 pts), if/else 3 (10 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 28). 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.
  • flow_services_get_def::get_def_utils::extract_def_loc_resolved (cognitive 22) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:831 — flow_services_get_def::get_def_utils::extract_def_loc_resolved has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 4 (10 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flow_command_utils · ×3
  • flow_command_utils::connect_and_make_request_inner::wait_for_response (cognitive 42) rust_port/crates/flow_command_utils/src/lib.rs:2967 — flow_command_utils::connect_and_make_request_inner::wait_for_response has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 3 (8 pts), boolean chains 4, 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.
  • flow_command_utils::file_options (cognitive 16) rust_port/crates/flow_command_utils/src/lib.rs:995 — flow_command_utils::file_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), boolean chains 1, 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.
  • flow_command_utils::make_options (cognitive 16) rust_port/crates/flow_command_utils/src/lib.rs:2095 — flow_command_utils::make_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, match/switch 3 (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 · flow_config · ×3
  • flow_config::flowconfig::parse_rollouts (cognitive 34) rust_port/crates/flow_config/src/flowconfig.rs:3122 — flow_config::flowconfig::parse_rollouts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (4 pts), match/switch 1 (3 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.
  • flow_config::flowconfig::filter_sections_by_rollout (cognitive 18) rust_port/crates/flow_config/src/flowconfig.rs:3290 — flow_config::flowconfig::filter_sections_by_rollout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 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.
  • flow_config::flowconfig::write (cognitive 16) rust_port/crates/flow_config/src/flowconfig.rs:3471 — flow_config::flowconfig::write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 4, match/switch 2 (4 pts) (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (write_options, write_ignores, section_if_nonempty, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · flow_common_ty · ×3
  • flow_common_ty::ty_printer::type_impl (cognitive 30) rust_port/crates/flow_common_ty/src/ty_printer.rs:298 — flow_common_ty::ty_printer::type_impl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (10 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 14). Of this number, 24 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
  • flow_common_ty::ty_debug::dump_t (cognitive 29) rust_port/crates/flow_common_ty/src/ty_debug.rs:568 — flow_common_ty::ty_debug::dump_t has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 7 (14 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.
  • flow_common_ty::ty_debug::dump_decl (cognitive 17) rust_port/crates/flow_common_ty/src/ty_debug.rs:753 — flow_common_ty::ty_debug::dump_decl has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 3 (5 pts) (nesting depth added 7). 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 · AnnotateExportsMapper · ×3
  • AnnotateExportsMapper::map_class_element (cognitive 28) rust_port/crates/flow_codemods/src/annotate_exports.rs:766 — AnnotateExportsMapper::map_class_element has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 4 (9 pts), loops 1 (4 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • AnnotateExportsMapper::map_function_return_annotation (cognitive 24) rust_port/crates/flow_codemods/src/annotate_exports.rs:605 — AnnotateExportsMapper::map_function_return_annotation has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 2 (5 pts), loops 1 (4 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • AnnotateExportsMapper::map_expression (cognitive 17) rust_port/crates/flow_codemods/src/annotate_exports.rs:489 — AnnotateExportsMapper::map_expression has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 2 (4 pts), loops 1 (3 pts) (nesting depth added 10). 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 · flow_server_env · ×3
  • flow_server_env::server_monitor_listener_state::recheck_fetch (cognitive 27) rust_port/crates/flow_server_env/src/server_monitor_listener_state.rs:466 — flow_server_env::server_monitor_listener_state::recheck_fetch has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 4 (10 pts), boolean chains 3, loops 1 (nesting depth added 14). 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.
  • flow_server_env::flow_lsp_conversions::flow_completion_item_to_lsp (cognitive 17) rust_port/crates/flow_server_env/src/flow_lsp_conversions.rs:115 — flow_server_env::flow_lsp_conversions::flow_completion_item_to_lsp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (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.
  • flow_server_env::server_monitor_listener_state::update (cognitive 17) rust_port/crates/flow_server_env/src/server_monitor_listener_state.rs:388 — flow_server_env::server_monitor_listener_state::update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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 · ProcessRequestSearcher · ×3
  • ProcessRequestSearcher::jsx_element (cognitive 19) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:900 — ProcessRequestSearcher::jsx_element has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 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.
  • ProcessRequestSearcher::import_declaration (cognitive 19) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1211 — ProcessRequestSearcher::import_declaration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (5 pts), loops 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.
  • ProcessRequestSearcher::record (cognitive 19) rust_port/crates/flow_services_autocomplete/src/autocomplete_js.rs:1318 — ProcessRequestSearcher::record has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (7 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.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (6 members, 50+ identical tokens) rust_port/crates/flow_cli/src/agent_helper_command.rs:245 — rust_port/crates/flow_cli/src/agent_helper_command.rs:245-330 | rust_port/crates/flow_cli/src/autofix_command.rs:166-254 | rust_port/crates/flow_cli/src/autofix_command.rs:338-398 | rust_port/crates/flow_cli/src/autofix_command.rs:507-574 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:92-175 | rust_port/crates/flow_cli/src/type_of_name_command.rs:159-268 — 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) rust_port/crates/flow_cli/src/autofix_command.rs:24 — rust_port/crates/flow_cli/src/autofix_command.rs:24-61 | rust_port/crates/flow_cli/src/autofix_command.rs:264-287 | rust_port/crates/flow_cli/src/autofix_command.rs:408-437 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:19-63 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:19-75 | rust_port/crates/flow_cli/src/type_of_name_command.rs:13-57 — 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) rust_port/crates/flow_cli/src/lib.rs:364 — rust_port/crates/flow_cli/src/lib.rs:364-407 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4213-4245 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4271-4293 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4617-4663 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:8059-8097 | rust_port/crates/flow_server_utils/src/file_content.rs:140-164 — 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 (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) rust_port/crates/flow_common_utils/src/graph.rs:482 — rust_port/crates/flow_common_utils/src/graph.rs:482-523 | rust_port/crates/flow_common_utils/src/graph.rs:559-600 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:636 — rust_port/crates/flow_typing_utils/src/type_filter.rs:636-694 | rust_port/crates/flow_typing_utils/src/type_filter.rs:723-764 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1417 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1417-1458 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:1463-1505 — 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 (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:386 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:386-424 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:430-465 — 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) rust_port/crates/flow_analysis/src/ssa_builder.rs:1106 — rust_port/crates/flow_analysis/src/ssa_builder.rs:1106-1142 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2048-2083 — 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) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3902 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:3902-3945 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4008-4043 — 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 (38 corresponding lines) · ×3
  • Edited copy of a member (38 corresponding lines) rust_port/crates/flow_env_builder/src/name_def.rs:173 — rust_port/crates/flow_env_builder/src/name_def.rs:173-224 | rust_port/crates/flow_env_builder/src/pattern_helper.rs:115-152 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2973 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2973-3017 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3021-3058 — 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) rust_port/crates/flow_typing_type/src/type_.rs:4688 — rust_port/crates/flow_typing_type/src/type_.rs:4688-4725 | rust_port/crates/flow_typing_type/src/type_.rs:4925-4964 — 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 (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1615 — rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1615-1651 | rust_port/crates/flow_typing_visitors/src/type_mapper.rs:1734-1774 — 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) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3634 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3634-3670 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3900-3940 — 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) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12121 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12121-12157 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:12658-12697 — 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 copies of one member (3 members, 29+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 29+ corresponding lines) rust_port/crates/flow_services_code_action/src/code_action_service.rs:709 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:709-737 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:746-777 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:787-824 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7434 — rust_port/crates/flow_parser/src/ast_visitor.rs:7434-7471 | rust_port/crates/flow_parser/src/ast_visitor.rs:9872-9901 | rust_port/crates/flow_parser/src/ast_visitor.rs:16941-16969 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8536 — rust_port/crates/flow_parser/src/ast_visitor.rs:8536-8564 | rust_port/crates/flow_parser/src/ast_visitor.rs:16906-16935 | rust_port/crates/flow_typing/src/typed_ast_finder.rs:752-780 — 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 (3 members, 17+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 17+ corresponding lines) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:876 — rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:876-892 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:928-949 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1400-1416 — 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) rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1208 — rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1208-1224 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1374-1393 | rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1429-1445 — 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) rust_port/crates/flow_parser/src/ast_utils.rs:428 — rust_port/crates/flow_parser/src/ast_utils.rs:428-444 | rust_port/crates/flow_parser/src/ast_utils.rs:448-464 | rust_port/crates/flow_parser/src/ast_utils.rs:553-569 — 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, 20+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 20+ corresponding lines) rust_port/crates/flow_common_ty/src/ty.rs:1157 — rust_port/crates/flow_common_ty/src/ty.rs:1157-1176 | rust_port/crates/flow_common_ty/src/ty.rs:1657-1683 | rust_port/crates/flow_common_ty/src/ty.rs:3237-3258 — 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) rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:565 — rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:565-584 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:589-610 | rust_port/crates/flow_services_get_def/src/get_def_process_location.rs:680-699 — 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) rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:612 — rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:612-631 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:796-815 | rust_port/crates/flow_typing_flow_js/src/flow_js/constraint_helpers.rs:832-851 — 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 · Edited copies of one member (3 members, 24+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 24+ corresponding lines) rust_port/crates/flow_parser_utils/src/enum_validate.rs:303 — rust_port/crates/flow_parser_utils/src/enum_validate.rs:303-326 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:328-351 | rust_port/crates/flow_parser_utils/src/enum_validate.rs:423-446 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3541 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3541-3573 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3848-3874 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5554-5577 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:38 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:38-61 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1730-1756 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5266-5292 — 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 (6 members, 15+ corresponding lines) · ×3
  • Edited copies of one member (6 members, 15+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1073 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1073-1087 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2909-2923 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3270-3284 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5382-5396 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5757-5771 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5776-5790 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4254 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4254-4271 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4640-4659 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4920-4934 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5225-5239 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5719-5733 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5738-5752 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:587 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:587-601 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:900-914 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:961-977 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:982-998 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1113-1130 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1687-1703 — 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 (4 members, 15+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 15+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:11000 — rust_port/crates/flow_parser/src/ast_visitor.rs:11000-11016 | rust_port/crates/flow_parser/src/ast_visitor.rs:11310-11324 | rust_port/crates/flow_parser/src/ast_visitor.rs:14281-14299 | rust_port/crates/flow_parser/src/ast_visitor.rs:15623-15637 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:7099 — rust_port/crates/flow_parser/src/ast_visitor.rs:7099-7113 | rust_port/crates/flow_parser/src/ast_visitor.rs:16365-16381 | rust_port/crates/flow_parser/src/ast_visitor.rs:16534-16551 | rust_port/crates/flow_parser/src/ast_visitor.rs:18197-18213 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4444 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4444-4458 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:4926-4940 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5170-5184 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6488-6505 — 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 copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) rust_port/crates/flow_analysis/src/scope_builder.rs:1953 — rust_port/crates/flow_analysis/src/scope_builder.rs:1953-1960 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1535-1542 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10424-10433 — 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) rust_port/crates/flow_aloc/src/lib.rs:230 — rust_port/crates/flow_aloc/src/lib.rs:230-237 | rust_port/crates/flow_parser/src/file_key.rs:353-360 | rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:59-67 — 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6415 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6415-6429 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6628-6637 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:6646-6653 — 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 (38 lines × 2) · ×3
  • Duplicated block (38 lines × 2) rust_port/crates/flow_cli/src/foreground_check_commands.rs:270 — rust_port/crates/flow_cli/src/foreground_check_commands.rs:270-307 | rust_port/crates/flow_cli/src/foreground_check_commands.rs:486-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/foreground_check_commands.rs:270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (38 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:3328 — rust_port/crates/flow_parser/src/estree_translator.rs:3328-3365 | rust_port/crates/flow_parser/src/estree_translator.rs:3412-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.
  • Duplicated block (38 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9028 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9028-9065 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9109-9146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9028` 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 × 2) · ×3
  • Duplicated block (31 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:2243 — rust_port/crates/flow_parser/src/expression_parser.rs:2243-2273 | rust_port/crates/flow_parser/src/flow_lexer.rs:258-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (31 lines × 2) rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:50 — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:50-80 | rust_port/crates/flow_services_inference/src/type_service.rs:2481-2511 — before extracting anything, compare `rust_port/crates/flow_server_rechecker/src/recheck_updates.rs` and `rust_port/crates/flow_services_inference/src/type_service.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) rust_port/crates/flow_type_sig/src/type_sig.rs:984 — rust_port/crates/flow_type_sig/src/type_sig.rs:984-1014 | rust_port/crates/flow_type_sig/src/type_sig.rs:1114-1144 — both copies are in the same file, so extract the 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 (24–25 lines × 2) · ×3
  • Duplicated block (24–25 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:2537 — rust_port/crates/flow_parser/src/expression_parser.rs:2537-2561 | rust_port/crates/flow_parser/src/statement_parser.rs:881-904 — 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 (24–25 lines × 2) rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1799 — rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1799-1822 | rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1896-1920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/slice_utils.rs:1799` 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 (24–25 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:5347 — rust_port/crates/flow_typing_statement/src/statement.rs:5347-5370 | rust_port/crates/flow_typing_statement/src/statement.rs:5447-5471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:5347` 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 (23–24 lines × 2) · ×3
  • Duplicated block (23–24 lines × 2) rust_port/crates/flow_cli/src/glean_runner.rs:572 — rust_port/crates/flow_cli/src/glean_runner.rs:572-594 | rust_port/crates/flow_cli/src/glean_runner.rs:600-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_cli/src/glean_runner.rs:572` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:3412 — rust_port/crates/flow_parser_wasm/src/serializer.rs:3412-3434 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3522-3545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:3412` 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) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2079 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2079-2102 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2486-2508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2079` it begins part-way through the construct above it, so those 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–20 lines × 2) · ×3
  • Duplicated block (18–20 lines × 2) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:806 — rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:806-823 | rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:836-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 `rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:806` 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–20 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1494 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1494-1513 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1588-1605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1494` 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–20 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3265 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3265-3284 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3288-3305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3265` it begins part-way through the construct above it, so those 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–19 lines × 3) · ×3
  • Duplicated block (18–19 lines × 3) rust_port/crates/flow_analysis/src/property_assignment.rs:538 — rust_port/crates/flow_analysis/src/property_assignment.rs:538-556 | rust_port/crates/flow_analysis/src/property_assignment.rs:664-681 | rust_port/crates/flow_analysis/src/property_assignment.rs:702-719 — 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 `rust_port/crates/flow_analysis/src/property_assignment.rs:538` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_analysis/src/property_assignment.rs:663` calls `for_in_statement_lhs` and `rust_port/crates/flow_analysis/src/property_assignment.rs:537` 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) rust_port/crates/flow_config/src/flowconfig.rs:505 — rust_port/crates/flow_config/src/flowconfig.rs:505-523 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4642-4659 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4825-4842 — 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 `rust_port/crates/flow_config/src/flowconfig.rs:505` it does not close everything it opens, so those 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, `rust_port/crates/flow_parser_wasm/src/serializer.rs:4659` calls `push` and `rust_port/crates/flow_config/src/flowconfig.rs:523` 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–19 lines × 3) rust_port/crates/flow_server_command_handler/src/command_handler.rs:1265 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:1265-1282 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2319-2337 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3901-3919 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×3
  • Duplicated block (18 lines × 4) rust_port/crates/flow_typing_errors/src/error_message.rs:10024 — rust_port/crates/flow_typing_errors/src/error_message.rs:10024-10041 | rust_port/crates/flow_typing_errors/src/error_message.rs:10044-10061 | rust_port/crates/flow_typing_errors/src/error_message.rs:10064-10081 | rust_port/crates/flow_typing_errors/src/error_message.rs:10084-10101 — 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 `rust_port/crates/flow_typing_errors/src/error_message.rs:10024` 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 × 4) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3371 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3371-3388 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4003-4020 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9179-9196 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10043-10060 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3371` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 4) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4542 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4542-4559 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4564-4581 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5694-5711 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5716-5733 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4542` it begins part-way through the construct above it, so those 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 × 3) · ×3
  • Duplicated block (16 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:1975 — rust_port/crates/flow_typing_statement/src/statement.rs:1975-1990 | rust_port/crates/flow_typing_statement/src/statement.rs:2000-2015 | rust_port/crates/flow_typing_statement/src/statement.rs:2023-2038 — 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 (16 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:7249 — rust_port/crates/flow_typing_statement/src/statement.rs:7249-7264 | rust_port/crates/flow_typing_statement/src/statement.rs:7280-7295 | rust_port/crates/flow_typing_statement/src/statement.rs:7304-7319 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:7249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1461 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1461-1476 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1478-1493 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1495-1510 — 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 (14–16 lines × 2) · ×3
  • Duplicated block (14–16 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1826 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1826-1839 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1850-1865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1826` it does not close everything it opens, so those 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–16 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746-2761 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2776-2789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2746` 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 (14–16 lines × 2) rust_port/crates/flow_typing_statement/src/switch_to_match.rs:303 — rust_port/crates/flow_typing_statement/src/switch_to_match.rs:303-318 | rust_port/crates/flow_typing_statement/src/switch_to_match.rs:325-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/switch_to_match.rs:303` it does not close everything it opens, so those 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) · ×3
  • Duplicated block (14–15 lines × 3) rust_port/crates/flow_parser/src/statement_parser.rs:3201 — rust_port/crates/flow_parser/src/statement_parser.rs:3201-3214 | rust_port/crates/flow_parser/src/statement_parser.rs:3231-3244 | rust_port/crates/flow_parser/src/statement_parser.rs:3481-3495 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:3201` 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 (14–15 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2128 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2128-2141 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2185-2199 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3284-3297 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs: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. 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 × 3) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1397 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:1397-1410 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5446-5460 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5931-5945 — 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 `rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:5446` it does not close everything it opens, so those 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 lines × 4) · ×3
  • Duplicated block (14 lines × 4) rust_port/crates/flow_server_command_handler/src/command_handler.rs:3857 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:3857-3870 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3988-4001 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:5373-5386 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:6557-6570 — 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) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3901 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3901-3914 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3948-3961 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4002-4015 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4069-4082 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3901` 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, `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3899` calls `dupe` and `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4067` 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 × 4) rust_port/crates/flow_typing_statement/src/type_annotation.rs:3006 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:3006-3020 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3027-3041 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3048-3061 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:3067-3080 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:3006` 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–14 lines × 2) · ×3
  • Duplicated block (12–14 lines × 2) rust_port/crates/flow_parser/src/expression_parser.rs:2703 — rust_port/crates/flow_parser/src/expression_parser.rs:2703-2716 | rust_port/crates/flow_parser/src/type_parser.rs:1072-1083 — before extracting anything, compare `rust_port/crates/flow_parser/src/expression_parser.rs` and `rust_port/crates/flow_parser/src/type_parser.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 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 `rust_port/crates/flow_parser/src/expression_parser.rs:2703` 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–14 lines × 2) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:238 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:238-251 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:385-396 — both copies are in the same file, so extract the 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–14 lines × 2) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:492 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:492-503 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:683-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:492` it begins part-way through the construct above it, so those 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 lines × 4) · ×3
  • Duplicated block (13 lines × 4) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2251 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2251-2263 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2368-2380 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2397-2409 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2479-2491 — 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 `rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2251` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12548 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12548-12560 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12591-12603 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12640-12652 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12683-12695 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:12548` 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 × 4) rust_port/crates/flow_typing_utils/src/type_filter.rs:1108 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1108-1120 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1202-1214 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1332-1344 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1428-1440 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:1108` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_utils/src/type_filter.rs:1216` calls `unchanged_result` and `rust_port/crates/flow_typing_utils/src/type_filter.rs:1121` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×3
  • Duplicated block (12–13 lines × 3) rust_port/crates/flow_parser/src/statement_parser.rs:3741 — rust_port/crates/flow_parser/src/statement_parser.rs:3741-3752 | rust_port/crates/flow_parser/src/statement_parser.rs:3755-3767 | rust_port/crates/flow_parser/src/statement_parser.rs:3776-3788 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:3755` it begins part-way through the construct above it, so those 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–13 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8373 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8373-8385 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8687-8698 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9089-9100 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8373` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/statement.rs:4373 — rust_port/crates/flow_typing_statement/src/statement.rs:4373-4384 | rust_port/crates/flow_typing_statement/src/statement.rs:4490-4502 | rust_port/crates/flow_typing_statement/src/statement.rs:7909-7921 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:4373` it does not close everything it opens, so those 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–11 lines × 3) · ×3
  • Duplicated block (10–11 lines × 3) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1645 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1645-1655 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:704-713 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:719-728 — 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 `rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1645` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 3) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:811 — rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:811-820 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:829-838 | rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:858-868 — 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 `rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:811` 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–11 lines × 3) rust_port/crates/flow_typing_statement/src/component_params.rs:222 — rust_port/crates/flow_typing_statement/src/component_params.rs:222-232 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:1115-1124 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:1175-1184 — 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 `rust_port/crates/flow_typing_statement/src/component_params.rs:222` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_statement/src/component_params.rs:221` calls `generate_id` and `rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:1174` 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 (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2765 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2765-2774 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2783-2792 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2804-2813 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2847-2856 — 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 `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2765` it begins part-way through the construct above it, so those exact lines 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) rust_port/crates/flow_parser/src/flow_lexer.rs:1101 — rust_port/crates/flow_parser/src/flow_lexer.rs:1101-1110 | rust_port/crates/flow_parser/src/flow_lexer.rs:1948-1957 | rust_port/crates/flow_parser/src/flow_lexer.rs:2499-2508 | rust_port/crates/flow_parser/src/flow_lexer.rs:2691-2700 — 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:9089 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:9089-9098 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:9126-9135 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:9174-9183 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:9192-9201 — 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 (9–10 lines × 4) · ×3
  • Duplicated block (9–10 lines × 4) rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:238 — rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:238-247 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:385-393 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:660-668 | rust_port/crates/flow_services_code_action/src/ast_extraction_utils.rs:673-681 — 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 `collector` to `&mut FunctionMethodCollector<'_>` in one and `&mut ClassCollector<'_>` 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–10 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:1698 — rust_port/crates/flow_typing_statement/src/statement.rs:1698-1707 | rust_port/crates/flow_typing_statement/src/statement.rs:1718-1727 | rust_port/crates/flow_typing_statement/src/statement.rs:2179-2188 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:735-743 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:1698` it begins part-way through the construct above it, so those exact lines 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 × 4) rust_port/crates/flow_typing_statement/src/statement.rs:17472 — rust_port/crates/flow_typing_statement/src/statement.rs:17472-17481 | rust_port/crates/flow_typing_statement/src/statement.rs:17638-17647 | rust_port/crates/flow_typing_statement/src/statement.rs:17699-17707 | rust_port/crates/flow_typing_statement/src/statement.rs:17842-17851 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17472` it begins part-way through the construct above it, so those exact 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 (5–7 lines × 2) · ×3
  • Duplicated block (5–7 lines × 2) rust_port/crates/flow_parser/src/flow_lexer.rs:1205 — rust_port/crates/flow_parser/src/flow_lexer.rs:1205-1211 | rust_port/crates/flow_parser/src/flow_lexer.rs:1275-1279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/flow_lexer.rs:1205` 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 (5–7 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:4355 — rust_port/crates/flow_parser/src/statement_parser.rs:4355-4359 | rust_port/crates/flow_parser/src/statement_parser.rs:4411-4417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:4355` it does not close everything it opens, so those 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–7 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:3645 — rust_port/crates/flow_parser_wasm/src/serializer.rs:3645-3649 | rust_port/crates/flow_parser_wasm/src/serializer.rs:3673-3679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:3645` 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 (5 lines × 6) · ×3
  • Duplicated block (5 lines × 6) rust_port/crates/flow_parser/src/match_pattern_parser.rs:930 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:930-934 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:938-942 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:960-964 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:984-988 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:992-996 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:1000-1004 — 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.
  • Duplicated block (5 lines × 6) rust_port/crates/flow_typing_statement/src/statement.rs:5958 — rust_port/crates/flow_typing_statement/src/statement.rs:5958-5962 | rust_port/crates/flow_typing_statement/src/statement.rs:7050-7054 | rust_port/crates/flow_typing_statement/src/statement.rs:7323-7328 | rust_port/crates/flow_typing_statement/src/statement.rs:7752-7756 | rust_port/crates/flow_typing_statement/src/statement.rs:11013-11017 | rust_port/crates/flow_typing_statement/src/statement.rs:11539-11543 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:5958` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 6) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4546 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4546-4550 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4568-4572 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5610-5614 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5698-5702 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5720-5724 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5856-5860 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4546` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×3
  • Duplicated block (5 lines × 5) rust_port/crates/flow_typing_statement/src/func_sig.rs:683 — rust_port/crates/flow_typing_statement/src/func_sig.rs:683-687 | rust_port/crates/flow_typing_statement/src/func_sig.rs:705-710 | rust_port/crates/flow_typing_statement/src/func_sig.rs:732-737 | rust_port/crates/flow_typing_statement/src/func_sig.rs:759-764 | rust_port/crates/flow_typing_statement/src/func_sig.rs:807-811 — 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 `rust_port/crates/flow_typing_statement/src/func_sig.rs:683` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 5) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2336 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2336-2340 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2371-2375 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2566-2570 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2631-2635 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2656-2660 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2336` it begins part-way through the construct above it, so those exact lines 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 × 5) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11310 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11310-11314 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11319-11323 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11328-11332 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11337-11341 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11346-11352 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11346` 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.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×3
  • Duplicated block (27 lines × 2 locations) evals/evals/01_error_fixing/error_020_ts_access_modifiers/ideal/main.js:12 — evals/evals/01_error_fixing/error_020_ts_access_modifiers/ideal/main.js:12 · evals/evals/01_error_fixing/error_020_ts_access_modifiers/input/main.js:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (27 lines × 2 locations) evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/ideal/main.js:13 — evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/ideal/main.js:13 · evals/evals/04_ts_to_flow/empty_bottom_type_exhaustiveness/input/source.ts:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (27 lines × 2 locations) evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/ideal/main.js:22 — evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/ideal/main.js:22 · evals/evals/04_ts_to_flow/utility_type_mappings_comprehensive/input/source.ts:12 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
D1 · Cyclomatic Complexity · flow_lsp · ×2
  • flow_lsp::lsp_mapper::default_mapper (cyclomatic 99) rust_port/crates/flow_lsp/src/lsp_mapper.rs:156 — flow_lsp::lsp_mapper::default_mapper has cyclomatic complexity 99 (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.
  • flow_lsp::lsp_fmt::parse_lsp_request (cyclomatic 36) rust_port/crates/flow_lsp/src/lsp_fmt.rs:985 — flow_lsp::lsp_fmt::parse_lsp_request 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: flow_lsp::lsp_fmt::result_name_to_string (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_server_command_handler · ×2
  • flow_server_command_handler::command_handler::get_persistent_handler (cyclomatic 42) rust_port/crates/flow_server_command_handler/src/command_handler.rs:7244 — flow_server_command_handler::command_handler::get_persistent_handler has cyclomatic complexity 42 (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.
  • flow_server_command_handler::command_handler::handle_ephemeral_command_for_standalone (cyclomatic 29) rust_port/crates/flow_server_command_handler/src/command_handler.rs:3567 — flow_server_command_handler::command_handler::handle_ephemeral_command_for_standalone 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 · flow_services_export · ×2
  • flow_services_export::fuzzy_path::score_match::do_fuzzy_score (cyclomatic 35) rust_port/crates/flow_services_export/src/fuzzy_path/score_match.rs:218 — flow_services_export::fuzzy_path::score_match::do_fuzzy_score 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.
  • flow_services_export::fuzzy_path::score_match::do_score (cyclomatic 24) rust_port/crates/flow_services_export/src/fuzzy_path/score_match.rs:78 — flow_services_export::fuzzy_path::score_match::do_score 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 · TypeNormalizationHardcodedFixesMapper · ×2
  • TypeNormalizationHardcodedFixesMapper::on_union (cyclomatic 32) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1418 — TypeNormalizationHardcodedFixesMapper::on_union has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • TypeNormalizationHardcodedFixesMapper::on_t (cyclomatic 16) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1653 — TypeNormalizationHardcodedFixesMapper::on_t 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: StylizeTyMapper::on_union (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TyIterTy · ×2
  • TyIterTy::default_on_t (cyclomatic 31) rust_port/crates/flow_common_ty/src/ty.rs:1199 — TyIterTy::default_on_t 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. This is NOT this file's highest cyclomatic complexity: Ty::map_locs (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 function is counted neither in this dimension's figures nor in its score.
  • TyIterTy::default_on_decl (cyclomatic 26) rust_port/crates/flow_common_ty/src/ty.rs:1331 — TyIterTy::default_on_decl 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. This shape REPEATS in the file: one other method here (TyReduceTy::on_decl) 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. This is NOT this file's highest cyclomatic complexity: Ty::map_locs (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_parsing · ×2
  • flow_parsing::docblock_parser::extract_docblock::parse_attributes (cyclomatic 31) rust_port/crates/flow_parsing/src/docblock_parser.rs:70 — flow_parsing::docblock_parser::extract_docblock::parse_attributes 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.
  • flow_parsing::parsing_service::reducer (cyclomatic 19) rust_port/crates/flow_parsing/src/parsing_service.rs:502 — flow_parsing::parsing_service::reducer 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 · TyReduceTy · ×2
  • TyReduceTy::on_t (cyclomatic 30) rust_port/crates/flow_common_ty/src/ty.rs:2828 — TyReduceTy::on_t 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: Ty::map_locs (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 function is counted neither in this dimension's figures nor in its score.
  • TyReduceTy::on_decl (cyclomatic 26) rust_port/crates/flow_common_ty/src/ty.rs:2938 — TyReduceTy::on_decl 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. This shape REPEATS in the file: one other method here (TyIterTy::default_on_decl) 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. This is NOT this file's highest cyclomatic complexity: Ty::map_locs (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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · flow_services_inference · ×2
  • flow_services_inference::merge_service::sig_hash (cyclomatic 26) rust_port/crates/flow_services_inference/src/merge_service.rs:89 — flow_services_inference::merge_service::sig_hash 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.
  • flow_services_inference::type_service::check_files::check_files (cyclomatic 21) rust_port/crates/flow_services_inference/src/type_service.rs:934 — flow_services_inference::type_service::check_files::check_files 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 · flow_services_get_def · ×2
  • flow_services_get_def::get_def_js::get_def::loop_fn (cyclomatic 25) rust_port/crates/flow_services_get_def/src/get_def_js.rs:224 — flow_services_get_def::get_def_js::get_def::loop_fn 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.
  • flow_services_get_def::get_def_utils::def_info_of_typecheck_results (cyclomatic 20) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:924 — flow_services_get_def::get_def_utils::def_info_of_typecheck_results has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function item inside it that branches. 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 · flow_command_utils · ×2
  • flow_command_utils::connect_and_make_request_inner::wait_for_response (cyclomatic 20) rust_port/crates/flow_command_utils/src/lib.rs:2967 — flow_command_utils::connect_and_make_request_inner::wait_for_response 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.
  • flow_command_utils::make_options (cyclomatic 16) rust_port/crates/flow_command_utils/src/lib.rs:2095 — flow_command_utils::make_options 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 · flow_server_monitor · ×2
  • flow_server_monitor::flow_server_monitor_server::server_instance::start (cyclomatic 19) rust_port/crates/flow_server_monitor/src/flow_server_monitor_server.rs:594 — flow_server_monitor::flow_server_monitor_server::server_instance::start 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: flow_server_monitor::flow_server_monitor_server::server_instance::error_type_of_code (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • flow_server_monitor::flow_server_monitor::internal_start (cyclomatic 16) rust_port/crates/flow_server_monitor/src/flow_server_monitor.rs:190 — flow_server_monitor::flow_server_monitor::internal_start 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.
D2 · Cognitive Complexity · Substituter · ×2
  • Substituter::type_ (cognitive 87) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:640 — Substituter::type_ has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (51 pts), match/switch 9 (25 pts), boolean chains 8, loops 1 (3 pts) (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.
  • Substituter::destructor (cognitive 26) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1034 — Substituter::destructor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 4 (7 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FindProviders · ×2
  • FindProviders::expression (cognitive 49) rust_port/crates/flow_env_builder/src/find_providers.rs:2116 — FindProviders::expression has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (47 pts), boolean chains 1, match/switch 1 (nesting depth added 36). 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.
  • FindProviders::add_provider (cognitive 19) rust_port/crates/flow_env_builder/src/find_providers.rs:1766 — FindProviders::add_provider has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 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 · TyIterTy · ×2
  • TyIterTy::default_on_decl (cognitive 45) rust_port/crates/flow_common_ty/src/ty.rs:1331 — TyIterTy::default_on_decl has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 8 (22 pts), match/switch 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (TyReduceTy::on_decl) 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.
  • TyIterTy::default_on_t (cognitive 18) rust_port/crates/flow_common_ty/src/ty.rs:1199 — TyIterTy::default_on_t has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (6 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 · TyReduceTy · ×2
  • TyReduceTy::on_decl (cognitive 45) rust_port/crates/flow_common_ty/src/ty.rs:2938 — TyReduceTy::on_decl has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 8 (22 pts), match/switch 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (TyIterTy::default_on_decl) 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.
  • TyReduceTy::on_t (cognitive 16) rust_port/crates/flow_common_ty/src/ty.rs:2828 — TyReduceTy::on_t has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 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 · ImportExportVisitor · ×2
  • ImportExportVisitor::export_named_declaration (cognitive 44) rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:675 — ImportExportVisitor::export_named_declaration has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 5 (18 pts), loops 2 (5 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.
  • ImportExportVisitor::variable_declarator (cognitive 21) rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:496 — ImportExportVisitor::variable_declarator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (4 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.
D2 · Cognitive Complexity · ObjectExpressionAcc · ×2
  • ObjectExpressionAcc::add_computed (cognitive 38) rust_port/crates/flow_typing_statement/src/statement.rs:354 — ObjectExpressionAcc::add_computed has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 5 (12 pts), boolean chains 3 (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.
  • ObjectExpressionAcc::mk_object_from_spread_acc (cognitive 20) rust_port/crates/flow_typing_statement/src/statement.rs:585 — ObjectExpressionAcc::mk_object_from_spread_acc has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 4 (6 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MatchLowerer · ×2
  • MatchLowerer::analyze_pattern (cognitive 36) rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:388 — MatchLowerer::analyze_pattern has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 5 (9 pts), loops 2 (4 pts), boolean chains 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.
  • MatchLowerer::lower_match_expression (cognitive 17) rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:990 — MatchLowerer::lower_match_expression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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 · flow_services_references · ×2
  • flow_services_references::local_import_ref_searcher::search (cognitive 36) rust_port/crates/flow_services_references/src/local_import_ref_searcher.rs:34 — flow_services_references::local_import_ref_searcher::search has cognitive complexity 36 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 4 (11 pts), match/switch 3 (7 pts) (nesting depth added 23). Of this number, 29 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • flow_services_references::property_find_refs::get_loc_of_def_info (cognitive 18) rust_port/crates/flow_services_references/src/property_find_refs.rs:272 — flow_services_references::property_find_refs::get_loc_of_def_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 4 (7 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 · ComponentLowerer · ×2
  • ComponentLowerer::map_statement_list_inner (cognitive 27) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:702 — ComponentLowerer::map_statement_list_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (2 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.
  • ComponentLowerer::component_params (cognitive 19) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:267 — ComponentLowerer::component_params has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1 (3 pts), 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 · flow_analysis · ×2
  • flow_analysis::scope_builder::lambda (cognitive 24) rust_port/crates/flow_analysis/src/scope_builder.rs:777 — flow_analysis::scope_builder::lambda has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (9 pts), loops 3 (8 pts), if/else 6 (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.
  • flow_analysis::property_assignment::eval_property_assignment (cognitive 18) rust_port/crates/flow_analysis/src/property_assignment.rs:947 — flow_analysis::property_assignment::eval_property_assignment has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (6 pts), match/switch 4 (6 pts), if/else 4 (5 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 · GraphOverlay · ×2
  • GraphOverlay::update_from_map (cognitive 23) rust_port/crates/flow_common_utils/src/graph.rs:390 — GraphOverlay::update_from_map has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 6 (10 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.
  • GraphOverlay::fold (cognitive 17) rust_port/crates/flow_common_utils/src/graph.rs:479 — GraphOverlay::fold has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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. This shape REPEATS in the file: one other method here (OverlayGraph::to_backward_map) 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 · flow_common_utils · ×2
  • flow_common_utils::utils_js::typo_suggestion::typo_suggestions::distance (cognitive 20) rust_port/crates/flow_common_utils/src/utils_js.rs:33 — flow_common_utils::utils_js::typo_suggestion::typo_suggestions::distance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (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.
  • flow_common_utils::utils_jsx::trim_jsx_text (cognitive 17) rust_port/crates/flow_common_utils/src/utils_jsx.rs:20 — flow_common_utils::utils_jsx::trim_jsx_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (4 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 · AnnotateOptionalPropertiesMapper · ×2
  • AnnotateOptionalPropertiesMapper::get_props_for_obj (cognitive 18) rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:356 — AnnotateOptionalPropertiesMapper::get_props_for_obj has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (13 pts), loops 2 (3 pts), if/else 2 (nesting depth added 7). Of this number, 9 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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.
  • AnnotateOptionalPropertiesMapper::variable_declarator (cognitive 16) rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:484 — AnnotateOptionalPropertiesMapper::variable_declarator has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (3 pts) (nesting depth added 10). 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 · MatcherBase · ×2
  • MatcherBase::add_candidates_bulk (cognitive 18) rust_port/crates/flow_services_export/src/fuzzy_path/matcher_base.rs:309 — MatcherBase::add_candidates_bulk has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 3, boolean chains 1 (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.
  • MatcherBase::find_matches (cognitive 16) rust_port/crates/flow_services_export/src/fuzzy_path/matcher_base.rs:190 — MatcherBase::find_matches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 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 · CommittedHeap · ×2
  • CommittedHeap::mark_slice (cognitive 16) rust_port/crates/flow_heap/src/transaction.rs:304 — CommittedHeap::mark_slice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 2 (6 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.
  • CommittedHeap::collect_slice_with_force (cognitive 16) rust_port/crates/flow_heap/src/transaction.rs:462 — CommittedHeap::collect_slice_with_force has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 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 · flow_services_type_info · ×2
  • flow_services_type_info::signature_help::find_signatures (cognitive 16) rust_port/crates/flow_services_type_info/src/signature_help.rs:735 — flow_services_type_info::signature_help::find_signatures has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 2 (3 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • flow_services_type_info::type_info_service::type_at_pos (cognitive 16) rust_port/crates/flow_services_type_info/src/type_info_service.rs:93 — flow_services_type_info::type_info_service::type_at_pos has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 2 (6 pts), match/switch 2 (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 · flow_watchman · ×2
  • flow_watchman::with_retry (cognitive 16) rust_port/crates/flow_watchman/src/lib.rs:992 — flow_watchman::with_retry has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 2 (5 pts), loops 1 (nesting depth added 10). 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.
  • flow_watchman::get_changes (cognitive 16) rust_port/crates/flow_watchman/src/lib.rs:1390 — flow_watchman::get_changes has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 1 (4 pts), loops 1 (nesting depth added 10). 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (9 members, 50+ identical tokens) rust_port/crates/flow_cli/src/codemod_command.rs:809 — rust_port/crates/flow_cli/src/codemod_command.rs:809-900 | rust_port/crates/flow_cli/src/codemod_command.rs:920-980 | rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:137-274 | rust_port/crates/flow_codemods/src/utils/codemod_annotator.rs:462-493 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:1251-1297 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2224-2294 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2303-2383 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2392-2459 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3839-3969 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:387 — rust_port/crates/flow_typing_utils/src/type_filter.rs:387-522 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1075-1131 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1133-1170 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1172-1228 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1230-1270 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1302-1355 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1357-1394 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1396-1451 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1453-1490 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:246 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:246-444 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:545-552 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:560-567 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:575-582 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:590-597 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:605-612 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:620-627 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:635-642 — 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) rust_port/crates/flow_typing/src/env_resolution.rs:502 — rust_port/crates/flow_typing/src/env_resolution.rs:502-510 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1934-1942 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1461-1469 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1474-1482 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1527-1535 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:319-443 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1484-1816 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1410-1418 — 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 (94 corresponding lines) · ×2
  • Edited copy of a member (94 corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:15510 — rust_port/crates/flow_parser/src/ast_visitor.rs:15510-15603 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1789-1882 — 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.
  • Edited copy of a member (94 corresponding lines) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1031 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1031-1124 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1131-1224 — 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 copy of a member (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) rust_port/crates/flow_env_builder/src/name_def.rs:6269 — rust_port/crates/flow_env_builder/src/name_def.rs:6269-6314 | rust_port/crates/flow_env_builder/src/name_def.rs:6320-6364 — 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) rust_port/crates/flow_analysis/src/property_assignment.rs:756 — rust_port/crates/flow_analysis/src/property_assignment.rs:756-800 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1951-2000 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×2
  • Edited copy of a member (50 corresponding lines) rust_port/crates/flow_common/src/reason.rs:1718 — rust_port/crates/flow_common/src/reason.rs:1718-1767 | rust_port/crates/flow_common/src/reason.rs:1805-1858 — 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) rust_port/crates/flow_server_env/src/server_env.rs:480 — rust_port/crates/flow_server_env/src/server_env.rs:480-543 | rust_port/crates/flow_server_env/src/server_env.rs:551-600 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (72 corresponding lines) · ×2
  • Edited copy of a member (72 corresponding lines) rust_port/crates/flow_common/src/js_number.rs:59 — rust_port/crates/flow_common/src/js_number.rs:59-130 | rust_port/crates/flow_common/src/js_number.rs:144-233 — 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) rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1239 — rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1239-1338 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1340-1411 — 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 (47 corresponding lines) · ×2
  • Edited copy of a member (47 corresponding lines) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:907 — rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:907-976 | rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:993-1039 — 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) rust_port/crates/flow_parser/src/statement_parser.rs:224 — rust_port/crates/flow_parser/src/statement_parser.rs:224-275 | rust_port/crates/flow_parser/src/statement_parser.rs:277-323 — 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 (46 corresponding lines) · ×2
  • Edited copy of a member (46 corresponding lines) rust_port/crates/flow_cli/src/codemod_command.rs:311 — rust_port/crates/flow_cli/src/codemod_command.rs:311-356 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:662-707 — 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) rust_port/crates/flow_typing_utils/src/type_filter.rs:851 — rust_port/crates/flow_typing_utils/src/type_filter.rs:851-896 | rust_port/crates/flow_typing_utils/src/type_filter.rs:910-955 — 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 (54 corresponding lines) · ×2
  • Edited copy of a member (54 corresponding lines) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:514 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:514-567 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:592-652 — 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) rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:227 — rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:227-280 | rust_port/crates/flow_services_code_action/src/refactor_match_discriminant.rs:287-340 — 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 (48 corresponding lines) · ×2
  • Edited copy of a member (48 corresponding lines) rust_port/crates/flow_common/src/files.rs:1391 — rust_port/crates/flow_common/src/files.rs:1391-1438 | rust_port/crates/flow_parser/src/file_key.rs:114-173 — 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) rust_port/crates/flow_parser/src/parser_env.rs:2328 — rust_port/crates/flow_parser/src/parser_env.rs:2328-2375 | rust_port/crates/flow_parser/src/parser_env.rs:2377-2426 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×2
  • Edited copy of a member (40 corresponding lines) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10089 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10089-10135 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10141-10180 — 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) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6070 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6070-6109 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:6141-6180 — 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 (62 corresponding lines) · ×2
  • Edited copy of a member (62 corresponding lines) rust_port/crates/flow_parser/src/estree_translator.rs:3561 — rust_port/crates/flow_parser/src/estree_translator.rs:3561-3622 | rust_port/crates/flow_parser/src/estree_translator.rs:3687-3755 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (62 corresponding lines) rust_port/crates/flow_parser/src/expression_parser.rs:67 — rust_port/crates/flow_parser/src/expression_parser.rs:67-128 | rust_port/crates/flow_parser/src/expression_parser.rs:393-454 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 18+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:8278 — rust_port/crates/flow_parser/src/ast_visitor.rs:8278-8299 | rust_port/crates/flow_parser/src/ast_visitor.rs:8778-8799 | rust_port/crates/flow_parser/src/ast_visitor.rs:15846-15863 | rust_port/crates/flow_parser/src/ast_visitor.rs:16000-16017 — 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) rust_port/crates/flow_cli/src/cycle_command.rs:11 — rust_port/crates/flow_cli/src/cycle_command.rs:11-33 | rust_port/crates/flow_cli/src/graph_command.rs:19-49 | rust_port/crates/flow_cli/src/query_command.rs:13-30 | rust_port/crates/flow_cli/src/save_state_command.rs:15-42 — 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 (4 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 19+ corresponding lines) rust_port/crates/flow_analysis/src/scope_builder.rs:247 — rust_port/crates/flow_analysis/src/scope_builder.rs:247-265 | rust_port/crates/flow_analysis/src/scope_builder.rs:273-292 | rust_port/crates/flow_analysis/src/scope_builder.rs:300-319 | rust_port/crates/flow_analysis/src/scope_builder.rs:326-344 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:11460 — rust_port/crates/flow_parser/src/ast_visitor.rs:11460-11478 | rust_port/crates/flow_parser/src/ast_visitor.rs:11501-11519 | rust_port/crates/flow_parser/src/ast_visitor.rs:12236-12254 | rust_port/crates/flow_parser/src/ast_visitor.rs:12276-12294 — 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 (4 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 16+ corresponding lines) rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1700 — rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1700-1715 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1729-1748 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1801-1816 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1837-1852 — 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8819 — rust_port/crates/flow_parser/src/ast_visitor.rs:8819-8834 | rust_port/crates/flow_parser/src/ast_visitor.rs:12175-12190 | rust_port/crates/flow_parser/src/ast_visitor.rs:12370-12385 | rust_port/crates/flow_parser/src/ast_visitor.rs:18609-18624 — 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, 11+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 11+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:9626 — rust_port/crates/flow_parser/src/ast_visitor.rs:9626-9636 | rust_port/crates/flow_parser/src/ast_visitor.rs:9655-9665 | rust_port/crates/flow_parser/src/ast_visitor.rs:9684-9694 | rust_port/crates/flow_parser/src/ast_visitor.rs:9713-9723 — 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) rust_port/crates/flow_env_builder/src/name_def.rs:3022 — rust_port/crates/flow_env_builder/src/name_def.rs:3022-3037 | rust_port/crates/flow_env_builder/src/name_def.rs:6199-6209 | rust_port/crates/flow_env_builder/src/name_def.rs:6431-6444 | rust_port/crates/flow_env_builder/src/name_def.rs:6450-6463 — 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 (4 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 8+ corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5629 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5629-5636 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5641-5648 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5653-5660 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5665-5672 — 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) rust_port/crates/flow_parser_utils/src/ast_builder.rs:1324 — rust_port/crates/flow_parser_utils/src/ast_builder.rs:1324-1332 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:2098-2105 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:2112-2119 | rust_port/crates/flow_parser_utils/src/ast_builder.rs:2378-2386 — 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 (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2023 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2023-2041 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3688-3703 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3708-3726 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4334 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4334-4350 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4517-4533 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6328-6343 — 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 · Edited copies of one member (4 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 10+ corresponding lines) rust_port/crates/flow_parser/src/parser_env.rs:1681 — rust_port/crates/flow_parser/src/parser_env.rs:1681-1690 | rust_port/crates/flow_parser/src/parser_env.rs:1833-1844 | rust_port/crates/flow_parser/src/parser_env.rs:2273-2284 | rust_port/crates/flow_parser/src/parser_env.rs:2315-2326 — 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) rust_port/crates/flow_typing_type/src/type_.rs:2171 — rust_port/crates/flow_typing_type/src/type_.rs:2171-2181 | rust_port/crates/flow_typing_type/src/type_.rs:2272-2283 | rust_port/crates/flow_typing_type/src/type_.rs:2366-2376 | rust_port/crates/flow_typing_type/src/type_.rs:2739-2748 — 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 (5 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 9+ corresponding lines) rust_port/crates/flow_heap_serialization/src/lib.rs:48 — rust_port/crates/flow_heap_serialization/src/lib.rs:48-56 | rust_port/crates/flow_heap_serialization/src/lib.rs:64-72 | rust_port/crates/flow_heap_serialization/src/lib.rs:94-102 | rust_port/crates/flow_heap_serialization/src/lib.rs:110-118 | rust_port/crates/flow_heap_serialization/src/lib.rs:160-168 — 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) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6434 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6434-6442 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6520-6528 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6533-6548 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6553-6561 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6566-6574 — 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 (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:108 — rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:108-114 | rust_port/crates/flow_typing_type/src/type_.rs:1444-1450 | rust_port/crates/flow_typing_type/src/type_.rs:3064-3071 — 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) rust_port/crates/flow_typing_statement/src/react_rules.rs:2288 — rust_port/crates/flow_typing_statement/src/react_rules.rs:2288-2295 | rust_port/crates/flow_typing_statement/src/react_rules.rs:2301-2308 | rust_port/crates/flow_typing_statement/src/react_rules.rs:2334-2340 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) rust_port/crates/flow_typing/src/ty_normalizer_flow.rs:165 — rust_port/crates/flow_typing/src/ty_normalizer_flow.rs:165-169 | rust_port/crates/flow_typing_ty_normalizer/src/no_flow.rs:120-128 — 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) rust_port/crates/flow_analysis/src/scope_builder.rs:2252 — rust_port/crates/flow_analysis/src/scope_builder.rs:2252-2257 | rust_port/crates/flow_analysis/src/ssa_builder.rs:2117-2121 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×2
  • Duplicated block (53 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:3564 — rust_port/crates/flow_parser/src/estree_translator.rs:3564-3616 | rust_port/crates/flow_parser/src/estree_translator.rs:3697-3749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/estree_translator.rs:3564` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (53 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1072 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1072-1124 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1172-1224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1072` 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 (49–50 lines × 2) · ×2
  • Duplicated block (49–50 lines × 2) rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:422 — rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:422-470 | rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:524-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 `rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:422` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (49–50 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:17133 — rust_port/crates/flow_typing_statement/src/statement.rs:17133-17181 | rust_port/crates/flow_typing_statement/src/statement.rs:17198-17247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:17133` it does not close everything it opens, so those 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 (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) rust_port/crates/flow_parser/src/ast.rs:3674 — rust_port/crates/flow_parser/src/ast.rs:3674-3722 | rust_port/crates/flow_parser/src/ast.rs:3725-3773 — both copies are in the same file, so extract the 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 (49 lines × 2) rust_port/crates/flow_typing_type/src/type_.rs:7377 — rust_port/crates/flow_typing_type/src/type_.rs:7377-7425 | rust_port/crates/flow_typing_type/src/type_.rs:7582-7630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_type/src/type_.rs:7377` 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 (31–32 lines × 2) · ×2
  • Duplicated block (31–32 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1015 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1015-1045 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1069-1100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:1015` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31–32 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:435 — rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:435-466 | rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:607-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs:435` it begins part-way through the construct above it, so those 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 × 2) · ×2
  • Duplicated block (29 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4294 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4294-4322 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4376-4404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4294` it does not close everything it opens, so those exact lines 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) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4730 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:4730-4758 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4878-4906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:4730` it does not close everything it opens, so those 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–27 lines × 2) · ×2
  • Duplicated block (26–27 lines × 2) rust_port/crates/flow_cli/src/codemod_command.rs:330 — rust_port/crates/flow_cli/src/codemod_command.rs:330-356 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:682-707 — before extracting anything, compare `rust_port/crates/flow_cli/src/codemod_command.rs` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs` as WHOLE FILES: this scan already matched 3 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 `rust_port/crates/flow_cli/src/codemod_command.rs:330` 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 (26–27 lines × 2) rust_port/crates/flow_typing_utils/src/exhaustive.rs:2516 — rust_port/crates/flow_typing_utils/src/exhaustive.rs:2516-2542 | rust_port/crates/flow_typing_utils/src/exhaustive.rs:2576-2601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/exhaustive.rs:2516` it begins part-way through the construct above it, so those 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) · ×2
  • Duplicated block (25–27 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7864 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7864-7888 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7894-7920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7864` it begins part-way through the construct above it, so those exact lines 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–27 lines × 2) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4584 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4584-4608 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4616-4642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4584` it does not close everything it opens, so those 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 (23 lines × 3) · ×2
  • Duplicated block (23 lines × 3) rust_port/crates/flow_env_builder/src/name_def.rs:5076 — rust_port/crates/flow_env_builder/src/name_def.rs:5076-5098 | rust_port/crates/flow_env_builder/src/name_def.rs:5124-5146 | rust_port/crates/flow_env_builder/src/name_def.rs:5176-5198 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:5076` it does not close everything it opens, so those exact lines 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 × 3) rust_port/crates/flow_env_builder/src/name_def.rs:5238 — rust_port/crates/flow_env_builder/src/name_def.rs:5238-5260 | rust_port/crates/flow_env_builder/src/name_def.rs:5289-5311 | rust_port/crates/flow_env_builder/src/name_def.rs:5344-5366 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:5238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×2
  • Duplicated block (20–21 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:11355 — rust_port/crates/flow_typing_statement/src/statement.rs:11355-11374 | rust_port/crates/flow_typing_statement/src/statement.rs:11444-11463 | rust_port/crates/flow_typing_statement/src/statement.rs:11486-11506 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:11486` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_statement/src/statement.rs:11444` calls `expression_inner` and `rust_port/crates/flow_typing_statement/src/statement.rs:11486` 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 (20–21 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:11560 — rust_port/crates/flow_typing_statement/src/statement.rs:11560-11579 | rust_port/crates/flow_typing_statement/src/statement.rs:11599-11618 | rust_port/crates/flow_typing_statement/src/statement.rs:11641-11661 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_typing_statement/src/statement.rs:11640` calls `add_condition`, `clone` and `rust_port/crates/flow_typing_statement/src/statement.rs:11559` 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 (20 lines × 3) · ×2
  • Duplicated block (20 lines × 3) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:193 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:193-212 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:243-262 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:283-302 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:193` 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, `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:242` calls `clone` and `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:192` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20 lines × 3) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5006 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5006-5025 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5054-5073 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5776-5795 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5006` it begins part-way through the construct above it, so those 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 (17–20 lines × 2) · ×2
  • Duplicated block (17–20 lines × 2) rust_port/crates/flow_typing/src/ty_members.rs:261 — rust_port/crates/flow_typing/src/ty_members.rs:261-277 | rust_port/crates/flow_typing/src/ty_members.rs:290-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing/src/ty_members.rs:261` 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 (17–20 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:19003 — rust_port/crates/flow_typing_statement/src/statement.rs:19003-19022 | rust_port/crates/flow_typing_statement/src/statement.rs:19061-19077 — both copies are in the same file, so extract the 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) · ×2
  • Duplicated block (16–19 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3902 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3902-3920 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3937-3952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3902` it begins part-way through the construct above it, so those 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–19 lines × 2) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:752 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:752-770 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:954-969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:752` it begins part-way through the construct above it, so those 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 × 3) · ×2
  • Duplicated block (18 lines × 3) rust_port/crates/flow_parser/src/token.rs:38 — rust_port/crates/flow_parser/src/token.rs:38-55 | rust_port/crates/flow_parser/src/token.rs:60-77 | rust_port/crates/flow_parser/src/token.rs:82-99 — 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 (18 lines × 3) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1229 — rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1229-1246 | rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1274-1291 | rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1319-1336 — 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 (13–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:644 — rust_port/crates/flow_typing_statement/src/statement.rs:644-656 | rust_port/crates/flow_typing_statement/src/statement.rs:683-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:644` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_statement/src/statement.rs:643` calls `into_iter` and `rust_port/crates/flow_typing_statement/src/statement.rs:682` 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–16 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6759 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6759-6771 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6773-6788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6759` it begins part-way through the construct above it, so those 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 × 3) · ×2
  • Duplicated block (13–14 lines × 3) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:822 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:822-835 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:958-970 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:1032-1044 — 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 `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:822` 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, `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:1046` calls `extend` and `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:836` 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–14 lines × 3) rust_port/crates/flow_typing_statement/src/type_annotation.rs:4697 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:4697-4709 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:5001-5014 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:5082-5095 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:4697` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 7) · ×2
  • Duplicated block (12–13 lines × 7) rust_port/crates/flow_parser/src/statement_parser.rs:3881 — rust_port/crates/flow_parser/src/statement_parser.rs:3881-3893 | rust_port/crates/flow_parser/src/statement_parser.rs:3905-3917 | rust_port/crates/flow_parser/src/statement_parser.rs:3929-3941 | rust_port/crates/flow_parser/src/statement_parser.rs:3959-3970 | rust_port/crates/flow_parser/src/statement_parser.rs:3984-3995 | rust_port/crates/flow_parser/src/statement_parser.rs:4007-4019 | rust_port/crates/flow_parser/src/statement_parser.rs:4031-4043 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:3881` it begins part-way through the construct above it, so those 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–13 lines × 7) rust_port/crates/flow_typing_statement/src/statement.rs:17145 — rust_port/crates/flow_typing_statement/src/statement.rs:17145-17157 | rust_port/crates/flow_typing_statement/src/statement.rs:17210-17222 | rust_port/crates/flow_typing_statement/src/statement.rs:17298-17310 | rust_port/crates/flow_typing_statement/src/statement.rs:17462-17473 | rust_port/crates/flow_typing_statement/src/statement.rs:17628-17639 | rust_port/crates/flow_typing_statement/src/statement.rs:17832-17843 | rust_port/crates/flow_typing_statement/src/statement.rs:18073-18085 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17145` it does not close everything it opens, so those 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–12 lines × 3) · ×2
  • Duplicated block (11–12 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1973 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1973-1984 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2072-2083 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:11200-11210 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1973` 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–12 lines × 3) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5815 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5815-5826 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6074-6084 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6141-6152 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5815` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886-9897 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9907-9918 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10026-10037 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10048-10059 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:10146-10156 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:9886` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 5) rust_port/crates/flow_typing_utils/src/type_env.rs:1471 — rust_port/crates/flow_typing_utils/src/type_env.rs:1471-1481 | rust_port/crates/flow_typing_utils/src/type_env.rs:1485-1495 | rust_port/crates/flow_typing_utils/src/type_env.rs:1499-1509 | rust_port/crates/flow_typing_utils/src/type_env.rs:1513-1524 | rust_port/crates/flow_typing_utils/src/type_env.rs:1530-1540 — 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 `rust_port/crates/flow_typing_utils/src/type_env.rs:1513` it does not close everything it opens, so those 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 (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) rust_port/crates/flow_analysis/src/ssa_builder.rs:828 — rust_port/crates/flow_analysis/src/ssa_builder.rs:828-836 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1675-1685 — both copies are in the same file, so extract the 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–11 lines × 2) rust_port/crates/flow_parser/src/estree_translator.rs:6441 — rust_port/crates/flow_parser/src/estree_translator.rs:6441-6449 | rust_port/crates/flow_parser_wasm/src/serializer.rs:941-951 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×2
  • Duplicated block (10 lines × 6) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7869 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:7869-7878 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:7958-7969 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8229-8238 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8323-8332 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8415-8424 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8492-8501 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:7869` 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 × 6) rust_port/crates/flow_typing_statement/src/statement.rs:9974 — rust_port/crates/flow_typing_statement/src/statement.rs:9974-9983 | rust_port/crates/flow_typing_statement/src/statement.rs:10070-10079 | rust_port/crates/flow_typing_statement/src/statement.rs:10146-10155 | rust_port/crates/flow_typing_statement/src/statement.rs:10396-10405 | rust_port/crates/flow_typing_statement/src/statement.rs:10567-10576 | rust_port/crates/flow_typing_statement/src/statement.rs:10732-10741 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:9974` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×2
  • Duplicated block (8–10 lines × 4) rust_port/crates/flow_cli/src/autocomplete_command.rs:165 — rust_port/crates/flow_cli/src/autocomplete_command.rs:165-172 | rust_port/crates/flow_cli/src/batch_coverage_command.rs:160-169 | rust_port/crates/flow_cli/src/coverage_command.rs:380-387 | rust_port/crates/flow_cli/src/find_module_command.rs:48-57 — 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 `rust_port/crates/flow_cli/src/batch_coverage_command.rs: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. 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–10 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:4221 — rust_port/crates/flow_typing_statement/src/statement.rs:4221-4229 | rust_port/crates/flow_typing_statement/src/statement.rs:5980-5987 | rust_port/crates/flow_typing_statement/src/statement.rs:12800-12809 | rust_port/crates/flow_typing_statement/src/statement.rs:21092-21099 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:4221` it begins part-way through the construct above it, so those 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–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) rust_port/crates/flow_services_code_action/src/code_action_service.rs:212 — rust_port/crates/flow_services_code_action/src/code_action_service.rs:212-221 | rust_port/crates/flow_services_code_action/src/code_action_service.rs:2414-2421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/code_action_service.rs:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–10 lines × 2) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3099 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3099-3108 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3116-3123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3099` it does not close everything it opens, so those 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 (7–10 lines × 2) · ×2
  • Duplicated block (7–10 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6178 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6178-6187 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6201-6207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6178` it begins part-way through the construct above it, so those exact lines 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–10 lines × 2) rust_port/crates/flow_typing_statement/src/class_sig.rs:1327 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1327-1333 | rust_port/crates/flow_typing_statement/src/class_sig.rs:2654-2663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:1327` it does not close everything it opens, so those 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 × 6) · ×2
  • Duplicated block (9 lines × 6) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2283 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2283-2291 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3360-3368 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3979-3987 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4624-4632 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5031-5039 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5042-5050 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2283` it begins part-way through the construct above it, so those exact lines 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 × 6) rust_port/crates/flow_typing_debug/src/lib.rs:2166 — rust_port/crates/flow_typing_debug/src/lib.rs:2166-2174 | rust_port/crates/flow_typing_debug/src/lib.rs:2183-2191 | rust_port/crates/flow_typing_debug/src/lib.rs:2200-2208 | rust_port/crates/flow_typing_debug/src/lib.rs:2217-2225 | rust_port/crates/flow_typing_debug/src/lib.rs:3256-3264 | rust_port/crates/flow_typing_debug/src/lib.rs:4195-4203 — 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 `rust_port/crates/flow_typing_debug/src/lib.rs:2166` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) rust_port/crates/flow_common/src/reason.rs:1752 — rust_port/crates/flow_common/src/reason.rs:1752-1758 | rust_port/crates/flow_common/src/reason.rs:1840-1848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common/src/reason.rs:1752` it does not close everything it opens, so those 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–9 lines × 2) rust_port/crates/flow_parser/src/match_pattern_parser.rs:170 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:170-176 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:522-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/match_pattern_parser.rs:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×2
  • Duplicated block (4–9 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1730 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1730-1733 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:1991-1999 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:2006-2014 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (4–9 lines × 3) rust_port/crates/flow_services_inference/src/check_service.rs:629 — rust_port/crates/flow_services_inference/src/check_service.rs:629-632 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:189-197 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6449-6457 — 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 `rust_port/crates/flow_services_inference/src/check_service.rs:629` 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 (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) rust_port/crates/flow_type_sig/src/type_sig_pack.rs:943 — rust_port/crates/flow_type_sig/src/type_sig_pack.rs:943-950 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:985-992 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1021-1028 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1087-1094 | rust_port/crates/flow_type_sig/src/type_sig_pack.rs:1160-1167 — 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.
  • Duplicated block (8 lines × 5) rust_port/crates/flow_command_utils/src/lib.rs:2394 — rust_port/crates/flow_command_utils/src/lib.rs:2394-2401 | rust_port/crates/flow_command_utils/src/lib.rs:2403-2410 | rust_port/crates/flow_command_utils/src/lib.rs:2412-2419 | rust_port/crates/flow_command_utils/src/lib.rs:2421-2429 | rust_port/crates/flow_command_utils/src/lib.rs:2430-2437 — 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 `rust_port/crates/flow_command_utils/src/lib.rs:2394` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_command_utils/src/lib.rs:2394` calls `expand_project_root_token` and `rust_port/crates/flow_command_utils/src/lib.rs:2430` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×2
  • Duplicated block (7 lines × 6) rust_port/crates/flow_cli/src/autofix_command.rs:36 — rust_port/crates/flow_cli/src/autofix_command.rs:36-42 | rust_port/crates/flow_cli/src/autofix_command.rs:274-280 | rust_port/crates/flow_cli/src/autofix_command.rs:418-424 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:31-37 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:31-37 | rust_port/crates/flow_cli/src/type_of_name_command.rs:26-32 — before extracting anything, compare `rust_port/crates/flow_cli/src/autofix_command.rs` and `rust_port/crates/flow_cli/src/inlay_hint_command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 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 `rust_port/crates/flow_cli/src/autofix_command.rs: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.
  • Duplicated block (7 lines × 6) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2430 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2430-2437 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2677-2684 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2700-2706 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2824-2831 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2908-2914 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2938-2944 — 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 `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×2
  • Duplicated block (6–7 lines × 3) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2339 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2339-2345 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5357-5362 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:6986-6991 — 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, `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5355` calls `type_args` and `rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:2337` 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–7 lines × 3) rust_port/crates/flow_typing/src/env_resolution.rs:3410 — rust_port/crates/flow_typing/src/env_resolution.rs:3410-3416 | rust_port/crates/flow_typing/src/env_resolution.rs:3432-3437 | rust_port/crates/flow_typing/src/env_resolution.rs:3453-3458 — 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 `rust_port/crates/flow_typing/src/env_resolution.rs:3410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×2
  • Duplicated block (4–7 lines × 3) rust_port/crates/flow_parser/src/match_pattern_parser.rs:119 — rust_port/crates/flow_parser/src/match_pattern_parser.rs:119-125 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:133-139 | rust_port/crates/flow_parser/src/match_pattern_parser.rs:221-224 — 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 `rust_port/crates/flow_parser/src/match_pattern_parser.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `rust_port/crates/flow_parser/src/match_pattern_parser.rs:132` calls `loc`, `dupe`, `token` and `rust_port/crates/flow_parser/src/match_pattern_parser.rs:221` 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 (4–7 lines × 3) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3254 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3254-3257 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3328-3334 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3365-3371 — 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 `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:3254` it does not close everything it opens, so those 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–5 lines × 3) · ×2
  • Duplicated block (3–5 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:385 — rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:385-389 | rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:1537-1541 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1412-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/eval_helpers.rs:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (3–5 lines × 3) rust_port/crates/flow_services_inference/src/check_service.rs:674 — rust_port/crates/flow_services_inference/src/check_service.rs:674-676 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:220-224 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6484-6488 — 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 `rust_port/crates/flow_services_inference/src/check_service.rs:674` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:220` calls `loc`, `dupe` and `rust_port/crates/flow_services_inference/src/check_service.rs:674` 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.
R10 · Code Duplication · Duplicated block (42 lines × 2 locations) · ×2
  • Duplicated block (42 lines × 2 locations) evals/evals/01_error_fixing/error_022_implements_object_type/ideal/main.js:16 — evals/evals/01_error_fixing/error_022_implements_object_type/ideal/main.js:16 · evals/evals/01_error_fixing/error_022_implements_object_type/input/main.js:16 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (42 lines × 2 locations) evals/evals/04_ts_to_flow/unknown_top_type_narrowing/ideal/main.js:10 — evals/evals/04_ts_to_flow/unknown_top_type_narrowing/ideal/main.js:10 · evals/evals/04_ts_to_flow/unknown_top_type_narrowing/input/source.ts:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (35 lines × 2 locations) · ×2
  • Duplicated block (35 lines × 2 locations) evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:14 — evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:14 · evals/evals/01_error_fixing/error_019_class_nominal_typing/input/main.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (35 lines × 2 locations) packages/flow-typed/jest.js:669 — packages/flow-typed/jest.js:669 · packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:1094 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (32 matched lines × 2 locations) evals/evals/02_unique_features/match_017_unreachable_patterns/ideal/main.js:10 — evals/evals/02_unique_features/match_017_unreachable_patterns/ideal/main.js:10 · evals/evals/02_unique_features/match_017_unreachable_patterns/input/main.js:10 — the two spans are one implementation copied and then locally edited — 163 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (32 matched lines × 2 locations) evals/evals/04_ts_to_flow/class_private_members/ideal/main.js:20 — evals/evals/04_ts_to_flow/class_private_members/ideal/main.js:20 · evals/evals/04_ts_to_flow/class_private_members/input/source.ts:6 — the two spans are one implementation copied and then locally edited — 269 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (28 lines × 2 locations) · ×2
  • Duplicated block (28 lines × 2 locations) evals/evals/02_unique_features/match_022_instance_superclass/ideal/main.js:10 — evals/evals/02_unique_features/match_022_instance_superclass/ideal/main.js:10 · evals/evals/02_unique_features/match_022_instance_superclass/input/main.js:10 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2 locations) packages/flow-dev-tools/flow-typed/node.js:2656 — packages/flow-dev-tools/flow-typed/node.js:2656 · packages/flow-dev-tools/flow-typed/node.js:2693 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×2
  • Length read from the parsed input is spent without ever being bounded rust_port/crates/flow_server_env/src/server_socket_rpc.rs:1724 — `len` is read from the bytes being parsed at line 1723 (`u32::from_be_bytes`), then used to size a `vec![…; n]` at line 1724 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` 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 rust_port/crates/flow_monitor_rpc/src/monitor_rpc.rs:132 — `len` is read from the bytes being parsed at line 131 (`u32::from_be_bytes`), then used to size a `vec![…; n]` at line 132 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
D1 · Cyclomatic Complexity · flowDefToTSDef.getTransforms (cyclomatic 320) · ×1
  • flowDefToTSDef.getTransforms (cyclomatic 320) REDACTED:222 — flowDefToTSDef.getTransforms has cyclomatic complexity 320 (threshold 15). Of this number, 240 points are the body's own statements and 80 belong to 21 function items 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 · TSDefToFlowDef.getTransforms (cyclomatic 225) · ×1
  • TSDefToFlowDef.getTransforms (cyclomatic 225) REDACTED:84 — TSDefToFlowDef.getTransforms has cyclomatic complexity 225 (threshold 15). Of this number, 214 points are the body's own statements and 11 belong to 5 function items inside it that branch. 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 · ParseError · ×1
  • ParseError::fmt (cyclomatic 193) rust_port/crates/flow_parser/src/parse_error.rs:305 — ParseError::fmt has cyclomatic complexity 193 (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 · TokenKind · ×1
  • TokenKind::to_value (cyclomatic 155) rust_port/crates/flow_parser/src/token.rs:457 — TokenKind::to_value has cyclomatic complexity 155 (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 · UseTInner · ×1
  • UseTInner::eq (cyclomatic 77) rust_port/crates/flow_typing_type/src/type_.rs:3388 — UseTInner::eq has cyclomatic complexity 77 (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 · Annot · ×1
  • Annot::iter (cyclomatic 72) rust_port/crates/flow_type_sig/src/type_sig.rs:2536 — Annot::iter has cyclomatic complexity 72 (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 · run_swebench.main (cyclomatic 58) · ×1
  • run_swebench.main (cyclomatic 58) evals/run_swebench.py:649 — run_swebench.main has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripFlowTypes.transformProgram (cyclomatic 49) · ×1
  • StripFlowTypes.transformProgram (cyclomatic 49) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:28 — StripFlowTypes.transformProgram has cyclomatic complexity 49 (threshold 15). Of this number, 47 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · transformProgram · ×1
  • transformProgram::transform (cyclomatic 47) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:33 — transformProgram::transform 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 · Substituter · ×1
  • Substituter::type_ (cyclomatic 46) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:640 — Substituter::type_ 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 · RemoveNode.getRemovalParent (cyclomatic 46) · ×1
  • RemoveNode.getRemovalParent (cyclomatic 46) packages/flow-transform/src/transform/mutations/RemoveNode.js:84 — RemoveNode.getRemovalParent has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 90, 100, 270). 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 · eliminateAbstractComponent.eliminateAbstractComponent (cyclomatic 43) · ×1
  • eliminateAbstractComponent.eliminateAbstractComponent (cyclomatic 43) packages/flow-upgrade/src/codemods/eliminateAbstractComponent.js:19 — eliminateAbstractComponent.eliminateAbstractComponent has cyclomatic complexity 43 (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 · WholeAstVisitor · ×1
  • WholeAstVisitor::visit_function_with_id (cyclomatic 33) rust_port/crates/flow_typing_statement/src/react_rules.rs:1444 — WholeAstVisitor::visit_function_with_id 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 · run_swebench.run_eval (cyclomatic 33) · ×1
  • run_swebench.run_eval (cyclomatic 33) evals/run_swebench.py:482 — run_swebench.run_eval 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 · compile_swebench.generate_grading_script (cyclomatic 32) · ×1
  • compile_swebench.generate_grading_script (cyclomatic 32) evals/compile_swebench.py:152 — compile_swebench.generate_grading_script 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 · convertClassMember (cyclomatic 32) · ×1
  • convertClassMember (cyclomatic 32) packages/flow-api-translator/src/flowToFlowDef.js:1499 — convertClassMember has cyclomatic complexity 32 (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 · Def · ×1
  • Def::iter (cyclomatic 30) rust_port/crates/flow_type_sig/src/type_sig.rs:1490 — Def::iter has cyclomatic complexity 30 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: Annot::map (cyclomatic 63) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FlowParser.parse (cyclomatic 30) · ×1
  • FlowParser.parse (cyclomatic 30) packages/flow-parser/oxidized-src/FlowParser.js:176 — FlowParser.parse has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · comments.attach (cyclomatic 30) · ×1
  • comments.attach (cyclomatic 30) packages/flow-transform/src/transform/comments/prettier/main/comments.js:161 — comments.attach 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 · flow_print_signal · ×1
  • flow_print_signal::string_of_signal (cyclomatic 29) rust_port/crates/flow_print_signal/src/lib.rs:9 — flow_print_signal::string_of_signal 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 · MatchLowerer · ×1
  • MatchLowerer::analyze_pattern (cyclomatic 27) rust_port/crates/flow_parser_wasm/src/babel_adapter/match_lowering.rs:388 — MatchLowerer::analyze_pattern 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 · Value · ×1
  • Value::iter (cyclomatic 27) rust_port/crates/flow_type_sig/src/type_sig.rs:1954 — Value::iter 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: Annot::map (cyclomatic 63) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FlowParser.detectSourceType (cyclomatic 27) · ×1
  • FlowParser.detectSourceType (cyclomatic 27) packages/flow-parser/oxidized-src/FlowParser.js:396 — FlowParser.detectSourceType has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · getTransformContext (cyclomatic 25) · ×1
  • getTransformContext (cyclomatic 25) packages/flow-transform/src/transform/TransformContext.js:331 — getTransformContext has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 belong to 30 function literals inside it that branch. 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 · DetailedDiagnostics.validateRendered (cyclomatic 23) · ×1
  • DetailedDiagnostics.validateRendered (cyclomatic 23) packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts:63 — DetailedDiagnostics.validateRendered 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 · mutateESTreeASTForPrettier.mutate (cyclomatic 23) · ×1
  • mutateESTreeASTForPrettier.mutate (cyclomatic 23) packages/flow-parser/oxidized-src/utils/mutateESTreeASTForPrettier.js:52 — mutateESTreeASTForPrettier.mutate 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 · flow_commands_connect · ×1
  • flow_commands_connect::command_connect::connect_rec (cyclomatic 22) rust_port/crates/flow_commands_connect/src/command_connect.rs:189 — flow_commands_connect::command_connect::connect_rec 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 · Mapper · ×1
  • Mapper::statement_fork_point (cyclomatic 22) rust_port/crates/flow_services_code_action/src/autofix_type_to_value_import.rs:122 — Mapper::statement_fork_point 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 · recordRunner.runner (cyclomatic 22) · ×1
  • recordRunner.runner (cyclomatic 22) packages/flow-dev-tools/src/record/recordRunner.js:109 — recordRunner.runner has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransformMatchSyntax.analyzePattern (cyclomatic 22) · ×1
  • TransformMatchSyntax.analyzePattern (cyclomatic 22) packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:287 — TransformMatchSyntax.analyzePattern has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Lexer · ×1
  • Lexer::token (cyclomatic 21) rust_port/crates/flow_common_semver/src/semver_lexer.rs:58 — Lexer::token 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 · use-indexed-access-type.report (cyclomatic 21) · ×1
  • use-indexed-access-type.report (cyclomatic 21) packages/eslint-plugin-fb-flow/rules/use-indexed-access-type.js:31 — use-indexed-access-type.report has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · comments.handleClassComments (cyclomatic 21) · ×1
  • comments.handleClassComments (cyclomatic 21) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:381 — comments.handleClassComments 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 · convertExport (cyclomatic 21) · ×1
  • convertExport (cyclomatic 21) packages/flow-api-translator/src/flowToFlowDef.js:501 — convertExport 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 · transform.VariableDeclarator (cyclomatic 21) · ×1
  • transform.VariableDeclarator (cyclomatic 21) packages/flow-upgrade/src/codemods/collapseObjectInitialization.js:156 — transform.VariableDeclarator has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to 3 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 · LintSettings · ×1
  • LintSettings::of_lines (cyclomatic 20) rust_port/crates/flow_lint_settings/src/lint_settings.rs:161 — LintSettings::of_lines has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 function items 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 · compile_swebench.main (cyclomatic 20) · ×1
  • compile_swebench.main (cyclomatic 20) evals/compile_swebench.py:594 — compile_swebench.main 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 · comments.getSortedChildNodes (cyclomatic 20) · ×1
  • comments.getSortedChildNodes (cyclomatic 20) packages/flow-transform/src/transform/comments/prettier/main/comments.js:22 — comments.getSortedChildNodes has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. 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 · comments.handleLastFunctionArgComments (cyclomatic 20) · ×1
  • comments.handleLastFunctionArgComments (cyclomatic 20) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:546 — comments.handleLastFunctionArgComments has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · convertExportDeclaration (cyclomatic 20) · ×1
  • convertExportDeclaration (cyclomatic 20) packages/flow-api-translator/src/flowToFlowDef.js:903 — convertExportDeclaration 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 · getStatementParent (cyclomatic 20) · ×1
  • getStatementParent (cyclomatic 20) packages/flow-transform/src/transform/mutations/utils/getStatementParent.js:36 — getStatementParent has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 68, assertValidStatementLocation, getAssertedIndex). 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 · flow_server_env · ×1
  • flow_server_env::flow_lsp_conversions::diagnostics_of_flow_errors::error_to_lsp (cyclomatic 19) rust_port/crates/flow_server_env/src/flow_lsp_conversions.rs:333 — flow_server_env::flow_lsp_conversions::diagnostics_of_flow_errors::error_to_lsp 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 · ImportExportVisitor · ×1
  • ImportExportVisitor::export_named_declaration (cyclomatic 19) rust_port/crates/flow_typing_utils/src/strict_es6_import_export.rs:675 — ImportExportVisitor::export_named_declaration 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 · TransformMatchSyntax.mapMatchStatement (cyclomatic 19) · ×1
  • TransformMatchSyntax.mapMatchStatement (cyclomatic 19) packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:878 — TransformMatchSyntax.mapMatchStatement has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 899, 891). 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 · getTransforms.EnumImpl (cyclomatic 19) · ×1
  • getTransforms.EnumImpl (cyclomatic 19) REDACTED:399 — getTransforms.EnumImpl 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 · ImportInformationExtractor · ×1
  • ImportInformationExtractor::import_declaration (cyclomatic 18) rust_port/crates/flow_services_code_action/src/document_paste.rs:134 — ImportInformationExtractor::import_declaration 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 · Searcher · ×1
  • Searcher::export_named_declaration (cyclomatic 18) rust_port/crates/flow_services_get_def/src/get_def_utils.rs:382 — Searcher::export_named_declaration 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 · flowDefToTSDef.getTransforms.EnumImpl (cyclomatic 18) · ×1
  • flowDefToTSDef.getTransforms.EnumImpl (cyclomatic 18) REDACTED:399 — flowDefToTSDef.getTransforms.EnumImpl 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: flowDefToTSDef.getTransforms.translateType (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 · flow_common_utils · ×1
  • flow_common_utils::utils_js::typo_suggestion (cyclomatic 17) rust_port/crates/flow_common_utils/src/utils_js.rs:28 — flow_common_utils::utils_js::typo_suggestion has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function items inside it that branch (typo_suggestions::distance, typo_suggestions::fold_results, typo_suggestions). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · flow_services_module · ×1
  • flow_services_module::commit_modules (cyclomatic 17) rust_port/crates/flow_services_module/src/lib.rs:1876 — flow_services_module::commit_modules has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (commit_haste, commit_file). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · OptUseT · ×1
  • OptUseT::eq (cyclomatic 17) rust_port/crates/flow_typing_type/src/type_.rs:4279 — OptUseT::eq 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. This is NOT this file's highest cyclomatic complexity: flow_typing_type::type_::string_of_use_ctor (cyclomatic 75) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ScopeBase.isStrictScope (cyclomatic 17) · ×1
  • ScopeBase.isStrictScope (cyclomatic 17) packages/flow-eslint/src/scope-manager/scope/ScopeBase.js:52 — ScopeBase.isStrictScope has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatusBarWidget.render (cyclomatic 17) · ×1
  • StatusBarWidget.render (cyclomatic 17) packages/flow-for-vscode/src/FlowLanguageClient/StatusBarWidget.ts:79 — StatusBarWidget.render 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 · runnable-wasm.flowToRunnableJSWithSourceMap (cyclomatic 17) · ×1
  • runnable-wasm.flowToRunnableJSWithSourceMap (cyclomatic 17) packages/flow-remove-types/runnable-wasm.js:33 — runnable-wasm.flowToRunnableJSWithSourceMap 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 · AnnotateExportsMapper · ×1
  • AnnotateExportsMapper::map_class_element (cyclomatic 16) rust_port/crates/flow_codemods/src/annotate_exports.rs:766 — AnnotateExportsMapper::map_class_element 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 · ComponentLowerer · ×1
  • ComponentLowerer::map_statement_list_inner (cyclomatic 16) rust_port/crates/flow_parser_wasm/src/babel_adapter/component_lowering.rs:702 — ComponentLowerer::map_statement_list_inner 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 · CoverageFolder · ×1
  • CoverageFolder::statement (cyclomatic 16) rust_port/crates/flow_services_coverage/src/lib.rs:372 — CoverageFolder::statement 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 · ObjectExpressionAcc · ×1
  • ObjectExpressionAcc::add_computed (cyclomatic 16) rust_port/crates/flow_typing_statement/src/statement.rs:354 — ObjectExpressionAcc::add_computed 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 · index.flowRemoveTypes (cyclomatic 16) · ×1
  • index.flowRemoveTypes (cyclomatic 16) packages/flow-remove-types/index.js:43 — index.flowRemoveTypes 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 · util.skipNewline (cyclomatic 16) · ×1
  • util.skipNewline (cyclomatic 16) packages/flow-transform/src/transform/comments/prettier/common/util.js:126 — util.skipNewline 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 · mapComponentParameters (cyclomatic 16) · ×1
  • mapComponentParameters (cyclomatic 16) packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:193 — mapComponentParameters has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · describeNodeForDebugging (cyclomatic 16) · ×1
  • describeNodeForDebugging (cyclomatic 16) packages/flow-transform/src/transform/comments/prettier/common/util.js:316 — describeNodeForDebugging 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 · getOptions (cyclomatic 16) · ×1
  • getOptions (cyclomatic 16) packages/flow-parser/oxidized-src/index.js:30 — getOptions 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.
D10 · Test Quality · Test project verifies nothing · ×1
  • Test project verifies nothing: the repository root tests/closure/callback_writes.js:4 — No conventional assertion call was detected in 3 of 3 tests in `the repository root` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
D2 · Cognitive Complexity · flowDefToTSDef.getTransforms (cognitive 321) · ×1
  • flowDefToTSDef.getTransforms (cognitive 321) REDACTED:222 — flowDefToTSDef.getTransforms has cognitive complexity 321 (threshold 15). Drivers by points: if/else 89 (165 pts), ternaries 50 (72 pts), boolean chains 45, match/switch 14 (25 pts), loops 10 (14 pts) (nesting depth added 113). Of this number, 231 points are the body's own statements and 90 belong to 21 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 · getTransforms (cognitive 147) · ×1
  • getTransforms (cognitive 147) REDACTED:84 — getTransforms has cognitive complexity 147 (threshold 15). Drivers by points: if/else 49 (53 pts), ternaries 44 (52 pts), boolean chains 16, match/switch 13 (16 pts), other 6, loops 4 (nesting depth added 15). Most of this is not in the body itself: 5 of the 147 points are its own statements and the rest belongs to 96 function items inside it that branch (_translateIntoObjectMethod, Literal, TSImportType, …). 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 · run_swebench.main (cognitive 97) · ×1
  • run_swebench.main (cognitive 97) evals/run_swebench.py:649 — run_swebench.main has cognitive complexity 97 (threshold 15). Drivers by points: if/else 32 (53 pts), loops 8 (17 pts), ternaries 7 (14 pts), boolean chains 10, error handling 1 (3 pts) (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 · recordRunner.runner (cognitive 78) · ×1
  • recordRunner.runner (cognitive 78) packages/flow-dev-tools/src/record/recordRunner.js:109 — recordRunner.runner has cognitive complexity 78 (threshold 15). Drivers by points: if/else 18 (64 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 53). Of this number, 71 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Annot · ×1
  • Annot::iter (cognitive 67) rust_port/crates/flow_type_sig/src/type_sig.rs:2536 — Annot::iter has cognitive complexity 67 (threshold 15). Drivers by points: loops 11 (28 pts), if/else 8 (20 pts), match/switch 9 (19 pts) (nesting depth added 39). 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 · WholeAstVisitor · ×1
  • WholeAstVisitor::visit_function_with_id (cognitive 54) rust_port/crates/flow_typing_statement/src/react_rules.rs:1444 — WholeAstVisitor::visit_function_with_id has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 12 (30 pts), if/else 11 (17 pts), boolean chains 7 (nesting depth added 24). 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 · comments.attach (cognitive 53) · ×1
  • comments.attach (cognitive 53) packages/flow-transform/src/transform/comments/prettier/main/comments.js:161 — comments.attach has cognitive complexity 53 (threshold 15). Drivers by points: if/else 28 (48 pts), loops 2 (3 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 · ParseError · ×1
  • ParseError::fmt (cognitive 49) rust_port/crates/flow_parser/src/parse_error.rs:305 — ParseError::fmt has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (33 pts), match/switch 8 (16 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TypeNormalizationHardcodedFixesMapper · ×1
  • TypeNormalizationHardcodedFixesMapper::on_union (cognitive 49) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1418 — TypeNormalizationHardcodedFixesMapper::on_union has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 7 (14 pts), boolean chains 11 (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 · run_swebench.run_eval (cognitive 47) · ×1
  • run_swebench.run_eval (cognitive 47) evals/run_swebench.py:482 — run_swebench.run_eval has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (22 pts), if/else 13 (18 pts), boolean chains 5, error handling 1, 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 · compile_swebench.generate_grading_script (cognitive 43) · ×1
  • compile_swebench.generate_grading_script (cognitive 43) evals/compile_swebench.py:152 — compile_swebench.generate_grading_script has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 3 (9 pts), boolean chains 3, 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 · Lexer · ×1
  • Lexer::token (cognitive 39) rust_port/crates/flow_common_semver/src/semver_lexer.rs:58 — Lexer::token has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 2 (4 pts), match/switch 2 (3 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 · TargetFinder · ×1
  • TargetFinder::jsx_element (cognitive 37) rust_port/crates/flow_services_code_action/src/stub_unbound_name.rs:86 — TargetFinder::jsx_element has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 4 (18 pts), if/else 4 (13 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 26). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flow_commands_connect · ×1
  • flow_commands_connect::command_connect::connect_rec (cognitive 36) rust_port/crates/flow_commands_connect/src/command_connect.rs:189 — flow_commands_connect::command_connect::connect_rec has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 6 (13 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 · parse (cognitive 36) · ×1
  • parse (cognitive 36) packages/flow-parser/oxidized-src/FlowParser.js:176 — parse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 7, boolean chains 4 (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 · report (cognitive 36) · ×1
  • report (cognitive 36) packages/eslint-plugin-fb-flow/rules/use-indexed-access-type.js:31 — report has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 5 (10 pts), boolean chains 5 (nesting depth added 18). Of this number, 26 points are the body's own statements and 10 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 · MergeStream · ×1
  • MergeStream::new (cognitive 34) rust_port/crates/flow_services_inference/src/merge_stream.rs:88 — MergeStream::new has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (24 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 · Context · ×1
  • Context::interface_merge_unify_tasks (cognitive 34) rust_port/crates/flow_typing_context/src/lib.rs:2024 — Context::interface_merge_unify_tasks has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (11 pts), match/switch 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValueObject · ×1
  • ValueObject::to_pattern (cognitive 34) rust_port/crates/flow_typing_loc_env/src/match_pattern_ir.rs:899 — ValueObject::to_pattern has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Graph · ×1
  • Graph::update_from_map (cognitive 32) rust_port/crates/flow_common_utils/src/graph.rs:111 — Graph::update_from_map has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 6 (12 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 · FlowParser.detectSourceType (cognitive 32) · ×1
  • FlowParser.detectSourceType (cognitive 32) packages/flow-parser/oxidized-src/FlowParser.js:396 — FlowParser.detectSourceType has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 11, match/switch 1 (2 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 · Collector · ×1
  • Collector::collect (cognitive 30) rust_port/crates/flow_typing_flow_js/src/intersection_kit/objects.rs:108 — Collector::collect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (5 pts), match/switch 2 (3 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · compile_swebench.main (cognitive 30) · ×1
  • compile_swebench.main (cognitive 30) evals/compile_swebench.py:594 — compile_swebench.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (5 pts), error handling 1 (3 pts), boolean chains 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 · findDuplicates (cognitive 30) · ×1
  • findDuplicates (cognitive 30) packages/flow-upgrade/src/codemods/removeDuplicateClassProperties.js:58 — findDuplicates has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts), match/switch 1 (3 pts), 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 · LintSettings · ×1
  • LintSettings::of_lines (cognitive 29) rust_port/crates/flow_lint_settings/src/lint_settings.rs:161 — LintSettings::of_lines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (8 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 9). Of this number, 18 points are the body's own statements and 11 belong to 3 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 · flow_print_signal · ×1
  • flow_print_signal::string_of_signal (cognitive 29) rust_port/crates/flow_print_signal/src/lib.rs:9 — flow_print_signal::string_of_signal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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 · RequiresCalculator · ×1
  • RequiresCalculator::import_declaration (cognitive 28) rust_port/crates/flow_parser_utils/src/file_sig.rs:661 — RequiresCalculator::import_declaration has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 5 (11 pts), loops 1 (4 pts) (nesting depth added 17). Of this number, 25 points are the body's own statements and 3 belong to one function item inside it that branches. 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 · comments.handleClassComments (cognitive 28) · ×1
  • comments.handleClassComments (cognitive 28) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:381 — comments.handleClassComments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 8, loops 1 (3 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 · Def · ×1
  • Def::iter (cognitive 27) rust_port/crates/flow_type_sig/src/type_sig.rs:1490 — Def::iter has cognitive complexity 27 (threshold 15). Drivers by points: loops 10 (20 pts), if/else 4 (6 pts), match/switch 1 (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 · ImportDeclaration (cognitive 27) · ×1
  • ImportDeclaration (cognitive 27) packages/flow-remove-types/index.js:297 — ImportDeclaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (6 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 · PropsToIndexerContext · ×1
  • PropsToIndexerContext::flow_props_to_indexer (cognitive 26) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1623 — PropsToIndexerContext::flow_props_to_indexer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts), match/switch 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 · mutateESTreeASTForPrettier.mutate (cognitive 26) · ×1
  • mutateESTreeASTForPrettier.mutate (cognitive 26) packages/flow-parser/oxidized-src/utils/mutateESTreeASTForPrettier.js:52 — mutateESTreeASTForPrettier.mutate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, 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 · convertClassMember (cognitive 26) · ×1
  • convertClassMember (cognitive 26) packages/flow-api-translator/src/flowToFlowDef.js:1499 — convertClassMember has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, ternaries 1 (2 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 · getTransformContext (cognitive 26) · ×1
  • getTransformContext (cognitive 26) packages/flow-transform/src/transform/TransformContext.js:331 — getTransformContext has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 16, if/else 8 (9 pts), loops 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 13 belong to 30 function literals inside it that branch. 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 · ImportInformationExtractor · ×1
  • ImportInformationExtractor::import_declaration (cognitive 25) rust_port/crates/flow_services_code_action/src/document_paste.rs:134 — ImportInformationExtractor::import_declaration has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 5 (7 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). 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 · Finder · ×1
  • Finder::jsx_element (cognitive 25) rust_port/crates/flow_services_type_info/src/signature_help.rs:668 — Finder::jsx_element has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 3 (12 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 · StripFlowTypes.transformProgram (cognitive 25) · ×1
  • StripFlowTypes.transformProgram (cognitive 25) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:28 — StripFlowTypes.transformProgram has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 10). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · visit (cognitive 25) · ×1
  • visit (cognitive 25) packages/flow-remove-types/index.js:723 — visit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 5, ternaries 1 (3 pts), loops 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 · compile_swebench.compile_project_pattern_evals (cognitive 24) · ×1
  • compile_swebench.compile_project_pattern_evals (cognitive 24) evals/compile_swebench.py:407 — compile_swebench.compile_project_pattern_evals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), error handling 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 · ScopeBase.isStrictScope (cognitive 24) · ×1
  • ScopeBase.isStrictScope (cognitive 24) packages/flow-eslint/src/scope-manager/scope/ScopeBase.js:52 — ScopeBase.isStrictScope has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · flowToFlowDef (cognitive 24) · ×1
  • flowToFlowDef (cognitive 24) packages/flow-api-translator/src/flowToFlowDef.js:388 — flowToFlowDef has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (6 pts), other 2 (nesting depth added 10). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (updatePendingStatements, storeTranslatedStatement, updateProcessedStatement). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · transform.VariableDeclarator (cognitive 24) · ×1
  • transform.VariableDeclarator (cognitive 24) packages/flow-upgrade/src/codemods/collapseObjectInitialization.js:156 — transform.VariableDeclarator has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). Of this number, 22 points are the body's own statements and 2 belong to 3 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 · parse (cognitive 24) · ×1
  • parse (cognitive 24) REDACTED:122 — parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). Of this number, 23 points are the body's own statements and 1 belongs to 2 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 · SourceLocationTable · ×1
  • SourceLocationTable::skip_trivia (cognitive 23) rust_port/crates/flow_parser/src/source_location.rs:103 — SourceLocationTable::skip_trivia has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), boolean chains 3, 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 · UseTInner · ×1
  • UseTInner::eq (cognitive 23) rust_port/crates/flow_typing_type/src/type_.rs:3388 — UseTInner::eq has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 22, 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 · transformProgram · ×1
  • transformProgram::transform (cognitive 23) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:33 — transformProgram::transform has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (2 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 · getTransforms.EnumImpl (cognitive 22) · ×1
  • getTransforms.EnumImpl (cognitive 22) REDACTED:399 — getTransforms.EnumImpl has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4 (6 pts), match/switch 1 (2 pts), loops 1, other 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 · convertExportDeclaration (cognitive 22) · ×1
  • convertExportDeclaration (cognitive 22) packages/flow-api-translator/src/flowToFlowDef.js:903 — convertExportDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (8 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 · eliminateAbstractComponent (cognitive 22) · ×1
  • eliminateAbstractComponent (cognitive 22) packages/flow-upgrade/src/codemods/eliminateAbstractComponent.js:19 — eliminateAbstractComponent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (8 pts), ternaries 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 · flow_services_type_of_name · ×1
  • flow_services_type_of_name::type_of_name::summarize_ty (cognitive 21) rust_port/crates/flow_services_type_of_name/src/type_of_name.rs:231 — flow_services_type_of_name::type_of_name::summarize_ty has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), boolean chains 1, 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 · Builder · ×1
  • Builder::compact (cognitive 21) rust_port/crates/flow_type_sig/src/compact_table.rs:340 — Builder::compact has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (8 pts), loops 2 (nesting depth added 8). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (loop1, loop0). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · compile_swebench.validate_config (cognitive 21) · ×1
  • compile_swebench.validate_config (cognitive 21) evals/compile_swebench.py:98 — compile_swebench.validate_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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 · comments.getSortedChildNodes (cognitive 21) · ×1
  • comments.getSortedChildNodes (cognitive 21) packages/flow-transform/src/transform/comments/prettier/main/comments.js:22 — comments.getSortedChildNodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, 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 · loadWasm (cognitive 21) · ×1
  • loadWasm (cognitive 21) src/flow_dot_js_wasm.js:155 — loadWasm has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 171, (anonymous)::finish, (anonymous)::onRuntimeInitialized, …). 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 · AnnotateLiteralDeclarationsMapper · ×1
  • AnnotateLiteralDeclarationsMapper::program (cognitive 20) rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:137 — AnnotateLiteralDeclarationsMapper::program has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 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 · FileSig · ×1
  • FileSig::to_debug_string (cognitive 20) rust_port/crates/flow_parser_utils/src/file_sig.rs:188 — FileSig::to_debug_string has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 6 (9 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StatusBarWidget.render (cognitive 20) · ×1
  • StatusBarWidget.render (cognitive 20) packages/flow-for-vscode/src/FlowLanguageClient/StatusBarWidget.ts:79 — StatusBarWidget.render has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 4, if/else 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 · TransformMatchSyntax.analyzePattern (cognitive 20) · ×1
  • TransformMatchSyntax.analyzePattern (cognitive 20) packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:287 — TransformMatchSyntax.analyzePattern has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. 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 · findDeclarationByName (cognitive 20) · ×1
  • findDeclarationByName (cognitive 20) packages/flow-api-translator/src/flowToFlowDef.js:171 — findDeclarationByName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 6, loops 2 (4 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 · transform.ClassDeclaration, ClassExpression (cognitive 20) · ×1
  • transform.ClassDeclaration, ClassExpression (cognitive 20) packages/flow-upgrade/src/codemods/removeDuplicateClassProperties.js:146 — transform.ClassDeclaration, ClassExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, ternaries 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 · JsonrpcQueue · ×1
  • JsonrpcQueue::new (cognitive 19) rust_port/crates/flow_lsp_server/src/jsonrpc.rs:145 — JsonrpcQueue::new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), match/switch 1 (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 · flow_services_module · ×1
  • flow_services_module::commit_modules::commit_haste (cognitive 19) rust_port/crates/flow_services_module/src/lib.rs:1893 — flow_services_module::commit_modules::commit_haste has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (8 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flow_utils_find · ×1
  • flow_utils_find::make_next_files (cognitive 19) rust_port/crates/flow_utils_find/src/lib.rs:73 — flow_utils_find::make_next_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (9 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (process, process_stack). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · flowToFlowDef.applyDefaultExportDocPlacement (cognitive 19) · ×1
  • flowToFlowDef.applyDefaultExportDocPlacement (cognitive 19) packages/flow-api-translator/src/flowToFlowDef.js:245 — flowToFlowDef.applyDefaultExportDocPlacement 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 · TransformComponentSyntax.mapStatementList (cognitive 19) · ×1
  • TransformComponentSyntax.mapStatementList (cognitive 19) packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:744 — TransformComponentSyntax.mapStatementList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 12). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.flowRemoveTypes (cognitive 19) · ×1
  • index.flowRemoveTypes (cognitive 19) packages/flow-remove-types/index.js:43 — index.flowRemoveTypes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 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 · visitFunction (cognitive 19) · ×1
  • visitFunction (cognitive 19) packages/flow-eslint/src/scope-manager/referencer/Referencer.js:289 — visitFunction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1, other 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 · dfsForRange (cognitive 19) · ×1
  • dfsForRange (cognitive 19) packages/flow-dev-tools/src/record/recordRunner.js:80 — dfsForRange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (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 · mutate · ×1
  • mutate::transform (cognitive 19) packages/flow-parser/oxidized-src/utils/mutateESTreeASTForPrettier.js:59 — mutate::transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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 · StringQuoteValue · ×1
  • StringQuoteValue::to_cow (cognitive 18) rust_port/crates/flow_parser/src/flow_lexer.rs:622 — StringQuoteValue::to_cow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 2, loops 1 (2 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 · InwardSplitter · ×1
  • InwardSplitter::type_ (cognitive 18) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:3254 — InwardSplitter::type_ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (5 pts), boolean chains 3 (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 · run_swebench.find_eval_dir (cognitive 18) · ×1
  • run_swebench.find_eval_dir (cognitive 18) evals/run_swebench.py:122 — run_swebench.find_eval_dir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 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 · flowDefToTSDef.getTransforms.EnumImpl (cognitive 18) · ×1
  • flowDefToTSDef.getTransforms.EnumImpl (cognitive 18) REDACTED:399 — flowDefToTSDef.getTransforms.EnumImpl has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 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 · flowResult.prettyPrintMessage (cognitive 18) · ×1
  • flowResult.prettyPrintMessage (cognitive 18) packages/flow-dev-tools/src/flowResult.js:233 — flowResult.prettyPrintMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 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 · SimpleTransform.transform (cognitive 18) · ×1
  • SimpleTransform.transform (cognitive 18) packages/flow-parser/oxidized-src/transform/SimpleTransform.js:71 — SimpleTransform.transform has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 74). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TransformMatchSyntax.mapMatchExpression (cognitive 18) · ×1
  • TransformMatchSyntax.mapMatchExpression (cognitive 18) packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:779 — TransformMatchSyntax.mapMatchExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 6 (8 pts), boolean chains 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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 · index.removeNode (cognitive 18) · ×1
  • index.removeNode (cognitive 18) packages/flow-remove-types/index.js:506 — index.removeNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2, 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 · mapRecordDeclaration (cognitive 18) · ×1
  • mapRecordDeclaration (cognitive 18) packages/flow-parser/oxidized-src/estree/TransformRecordSyntax.js:60 — mapRecordDeclaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (4 pts), match/switch 2 (3 pts), loops 1, other 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 92, 183, 98, …). 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 · transform · ×1
  • transform::enter (cognitive 18) packages/flow-parser/oxidized-src/transform/SimpleTransform.js:74 — transform::enter 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 · flow_common_semver · ×1
  • flow_common_semver::semver_range::satisfies (cognitive 17) rust_port/crates/flow_common_semver/src/semver_range.rs:71 — flow_common_semver::semver_range::satisfies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 1 (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 · CheckedSet · ×1
  • CheckedSet::add (cognitive 17) rust_port/crates/flow_common_utils/src/checked_set.rs:125 — CheckedSet::add has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OverlayGraph · ×1
  • OverlayGraph::to_backward_map (cognitive 17) rust_port/crates/flow_common_utils/src/graph.rs:559 — OverlayGraph::to_backward_map has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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. This shape REPEATS in the file: one other method here (GraphOverlay::fold) 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 · Iter · ×1
  • Iter::next (cognitive 17) rust_port/crates/flow_data_structure_wrapper/src/overlay_map.rs:258 — Iter::next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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 · flow_flowlib · ×1
  • flow_flowlib::flowlib_contents::apply_patch (cognitive 17) rust_port/crates/flow_flowlib/src/flowlib_contents.rs:283 — flow_flowlib::flowlib_contents::apply_patch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), match/switch 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 · Transaction · ×1
  • Transaction::set_resolved_requires (cognitive 17) rust_port/crates/flow_heap/src/parsing_heaps.rs:846 — Transaction::set_resolved_requires has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Value · ×1
  • Value::iter (cognitive 17) rust_port/crates/flow_type_sig/src/type_sig.rs:1954 — Value::iter has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (4 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 · ImplicitInstantiationVisitor · ×1
  • ImplicitInstantiationVisitor::type_ (cognitive 17) rust_port/crates/flow_typing_flow_js/src/implicit_instantiation.rs:270 — ImplicitInstantiationVisitor::type_ has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 4 (6 pts), loops 1 (3 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ScopeManager.acquire (cognitive 17) · ×1
  • ScopeManager.acquire (cognitive 17) packages/flow-eslint/src/scope-manager/ScopeManager.js:115 — ScopeManager.acquire has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 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 · VisitorBase.visitChildren (cognitive 17) · ×1
  • VisitorBase.visitChildren (cognitive 17) packages/flow-eslint/src/scope-manager/referencer/VisitorBase.js:41 — VisitorBase.visitChildren 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 · convertObjectExpression (cognitive 17) · ×1
  • convertObjectExpression (cognitive 17) packages/flow-api-translator/src/flowToFlowDef.js:738 — convertObjectExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 7). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 742). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · traverseWithContext (cognitive 17) · ×1
  • traverseWithContext (cognitive 17) packages/flow-transform/src/traverse/traverse.js:83 — traverseWithContext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 6). None of this is in the body itself: all 17 points belong to 11 function items inside it that branch (getBinding, getScope, a function literal at line 176, …). 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 · flowDefToTSDef.getTransforms.isReactImport (cognitive 16) · ×1
  • flowDefToTSDef.getTransforms.isReactImport (cognitive 16) REDACTED:335 — flowDefToTSDef.getTransforms.isReactImport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 354, 339). 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 · index.resultPrinter.toString (cognitive 16) · ×1
  • index.resultPrinter.toString (cognitive 16) packages/flow-remove-types/index.js:102 — index.resultPrinter.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (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 · util.skipNewline (cognitive 16) · ×1
  • util.skipNewline (cognitive 16) packages/flow-transform/src/transform/comments/prettier/common/util.js:126 — util.skipNewline 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 · comments.decorateComment (cognitive 16) · ×1
  • comments.decorateComment (cognitive 16) packages/flow-transform/src/transform/comments/prettier/main/comments.js:84 — comments.decorateComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 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 · getTransforms.isReactImport (cognitive 16) · ×1
  • getTransforms.isReactImport (cognitive 16) REDACTED:335 — getTransforms.isReactImport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 354, 339). 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 · resultPrinter.toString (cognitive 16) · ×1
  • resultPrinter.toString (cognitive 16) packages/flow-remove-types/index.js:102 — resultPrinter.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (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 · mapComponentParameters (cognitive 16) · ×1
  • mapComponentParameters (cognitive 16) packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:193 — mapComponentParameters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 2, ternaries 2, match/switch 1, other 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: default_resolve.rs → lib.rs, any_helpers.rs, type_util.rs rust_port/crates/flow_typing_flow_js/src/default_resolve.rs — `rust_port/crates/flow_typing_flow_js/src/default_resolve.rs` changes together with 3 other files — `rust_port/crates/flow_typing_debug/src/lib.rs`, `rust_port/crates/flow_typing_flow_js/src/flow_js/any_helpers.rs`, `rust_port/crates/flow_typing_type/src/type_util.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 21 shared lines) · ×1
  • Near-duplicate member family (5 members, 21 shared lines) rust_port/crates/flow_codemods/src/annotate_exports.rs:304 — rust_port/crates/flow_codemods/src/annotate_exports.rs:304-393 | rust_port/crates/flow_codemods/src/annotate_exports.rs:492-603 | rust_port/crates/flow_codemods/src/annotate_exports.rs:608-708 | rust_port/crates/flow_codemods/src/annotate_exports.rs:769-895 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:245-326 — These 5 members are variants of one another: a block of 21 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 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 · Near-duplicate member family (4 members, 26 shared lines) · ×1
  • Near-duplicate member family (4 members, 26 shared lines) rust_port/crates/flow_codemods/src/annotate_exports.rs:304 — rust_port/crates/flow_codemods/src/annotate_exports.rs:304-393 | rust_port/crates/flow_codemods/src/annotate_exports.rs:608-708 | rust_port/crates/flow_codemods/src/annotate_exports.rs:769-895 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:245-326 — These 4 members are variants of one another: a block of 26 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, 68 shared lines) · ×1
  • Near-duplicate member family (3 members, 68 shared lines) rust_port/crates/flow_env_builder/src/name_def.rs:2005 — rust_port/crates/flow_env_builder/src/name_def.rs:2005-2140 | rust_port/crates/flow_env_builder/src/name_def.rs:2272-2389 | rust_port/crates/flow_env_builder/src/name_def.rs:2394-2489 — These 3 members are variants of one another: a block of 68 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 (126 shared lines) · ×1
  • Near-duplicate member pair (126 shared lines) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8491 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8491-8744 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8802-9146 — These two members are variants of one another: 126 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 (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) rust_port/crates/flow_parser/src/expression_parser.rs:2631 — rust_port/crates/flow_parser/src/expression_parser.rs:2631-2723 | rust_port/crates/flow_parser/src/type_parser.rs:1001-1090 — These two members are variants of one another: 57 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 (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) rust_port/crates/flow_parser_wasm/src/serializer.rs:4596 — rust_port/crates/flow_parser_wasm/src/serializer.rs:4596-4688 | rust_port/crates/flow_parser_wasm/src/serializer.rs:4763-4870 — These two members are variants of one another: 54 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 (49 shared lines) · ×1
  • Near-duplicate member pair (49 shared lines) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3449 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:3449-3676 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5159-5292 — These two members are variants of one another: 49 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) rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:154 — rust_port/crates/flow_parser_wasm/src/babel_adapter/strip_flow.rs:154-228 | rust_port/crates/flow_parser_wasm/src/strip_flow.rs:128-202 — 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 (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) rust_port/crates/flow_common_ty/src/ty_utils.rs:637 — rust_port/crates/flow_common_ty/src/ty_utils.rs:637-687 | rust_port/crates/flow_common_ty/src/ty_utils.rs:689-739 — These two members are variants of one another: 42 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 (35 shared lines) · ×1
  • Near-duplicate member pair (35 shared lines) rust_port/crates/flow_typing_statement/src/class_sig.rs:1784 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1784-1908 | rust_port/crates/flow_typing_statement/src/class_sig.rs:2025-2180 — These two members are variants of one another: 35 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 (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5738 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5738-5850 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:5860-5968 — These two members are variants of one another: 33 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) rust_port/crates/flow_cli/src/coverage_command.rs:374 — rust_port/crates/flow_cli/src/coverage_command.rs:374-471 | rust_port/crates/flow_cli/src/dump_types_command.rs:148-266 — 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 (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) rust_port/crates/flow_analysis/src/property_assignment.rs:526 — rust_port/crates/flow_analysis/src/property_assignment.rs:526-556 | rust_port/crates/flow_analysis/src/property_assignment.rs:562-593 | rust_port/crates/flow_analysis/src/property_assignment.rs:599-644 | rust_port/crates/flow_analysis/src/property_assignment.rs:650-681 | rust_port/crates/flow_analysis/src/property_assignment.rs:687-719 | rust_port/crates/flow_analysis/src/ssa_builder.rs:808-856 | rust_port/crates/flow_analysis/src/ssa_builder.rs:863-901 | rust_port/crates/flow_analysis/src/ssa_builder.rs:907-946 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1660-1709 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1724-1763 — 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 (346 corresponding lines) · ×1
  • Edited copy of a member (346 corresponding lines) rust_port/crates/flow_parser/src/comment_attachment.rs:870 — rust_port/crates/flow_parser/src/comment_attachment.rs:870-1258 | rust_port/crates/flow_parser/src/expression_parser.rs:2790-3135 — These two members are one piece of code written twice and then edited apart: 346 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (185 corresponding lines) · ×1
  • Edited copy of a member (185 corresponding lines) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:250 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:250-434 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:320-504 — These two members are one piece of code written twice and then edited apart: 185 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (120 corresponding lines) · ×1
  • Edited copy of a member (120 corresponding lines) rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:127 — rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:127-246 | rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:252-382 — These two members are one piece of code written twice and then edited apart: 120 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (143 corresponding lines) · ×1
  • Edited copy of a member (143 corresponding lines) rust_port/crates/flow_typing_statement/src/type_annotation.rs:3990 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:3990-4132 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:4140-4290 — These two members are one piece of code written twice and then edited apart: 143 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (109 corresponding lines) · ×1
  • Edited copy of a member (109 corresponding lines) rust_port/crates/flow_common_ty/src/ty.rs:1199 — rust_port/crates/flow_common_ty/src/ty.rs:1199-1325 | rust_port/crates/flow_common_ty/src/ty.rs:2828-2936 — These two members are one piece of code written twice and then edited apart: 109 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (97 corresponding lines) · ×1
  • Edited copy of a member (97 corresponding lines) rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:156 — rust_port/crates/flow_typing_statement/src/component_declaration_config.rs:156-279 | rust_port/crates/flow_typing_statement/src/func_stmt_config.rs:205-301 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (104 corresponding lines) · ×1
  • Edited copy of a member (104 corresponding lines) rust_port/crates/flow_common_ty/src/ty.rs:1331 — rust_port/crates/flow_common_ty/src/ty.rs:1331-1434 | rust_port/crates/flow_common_ty/src/ty.rs:2938-3046 — 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 (96 corresponding lines) · ×1
  • Edited copy of a member (96 corresponding lines) rust_port/crates/flow_parser/src/expression_parser.rs:2531 — rust_port/crates/flow_parser/src/expression_parser.rs:2531-2626 | rust_port/crates/flow_parser/src/statement_parser.rs:874-970 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:420 — rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:420-495 | rust_port/crates/flow_utils_concurrency/src/map_reduce.rs:521-611 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) rust_port/crates/flow_parser/src/ast_visitor.rs:8997 — rust_port/crates/flow_parser/src/ast_visitor.rs:8997-9072 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3578-3641 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (88 corresponding lines) · ×1
  • Edited copy of a member (88 corresponding lines) rust_port/crates/flow_typing_statement/src/statement.rs:21230 — rust_port/crates/flow_typing_statement/src/statement.rs:21230-21328 | rust_port/crates/flow_typing_statement/src/statement.rs:21357-21444 — These two members are one piece of code written twice and then edited apart: 88 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (60 corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:10402 — rust_port/crates/flow_typing_type/src/type_.rs:10402-10461 | rust_port/crates/flow_typing_type/src/type_.rs:10470-10531 — 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 copies of one member (3 members, 64+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 64+ corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:7362 — rust_port/crates/flow_typing_type/src/type_.rs:7362-7425 | rust_port/crates/flow_typing_type/src/type_.rs:7567-7630 | rust_port/crates/flow_typing_visitors/src/type_mapper.rs:2119-2187 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 64 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is 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 (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) rust_port/crates/flow_typing_type/src/type_.rs:4774 — rust_port/crates/flow_typing_type/src/type_.rs:4774-4829 | rust_port/crates/flow_typing_type/src/type_.rs:5013-5070 — 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:439 — rust_port/crates/flow_services_autocomplete/src/autofix_imports.rs:439-491 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:509-567 — 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 copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) rust_port/crates/flow_cli/src/apply_code_action_command.rs:86 — rust_port/crates/flow_cli/src/apply_code_action_command.rs:86-139 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:193-242 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:290-350 — 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 copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) rust_port/crates/flow_common_ty/src/ty_printer.rs:75 — rust_port/crates/flow_common_ty/src/ty_printer.rs:75-117 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:455-526 — 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5759 — rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:5759-5815 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:7194-7253 — 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 copies of one member (4 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3697 — rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3697-3723 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3734-3763 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3773-3800 | rust_port/crates/flow_typing_utils/src/annotation_inference.rs:3811-3839 — These 4 members are one piece of code written 4 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 4 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) rust_port/crates/flow_heap/src/heap_state.rs:195 — rust_port/crates/flow_heap/src/heap_state.rs:195-265 | rust_port/crates/flow_heap/src/heap_state.rs:267-329 — 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 (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) rust_port/crates/flow_typing_statement/src/class_sig.rs:469 — rust_port/crates/flow_typing_statement/src/class_sig.rs:469-498 | rust_port/crates/flow_typing_statement/src/class_sig.rs:515-551 | rust_port/crates/flow_typing_statement/src/class_sig.rs:587-615 | rust_port/crates/flow_typing_statement/src/class_sig.rs:628-656 — 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, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:7698 — rust_port/crates/flow_parser/src/ast_visitor.rs:7698-7731 | rust_port/crates/flow_parser/src/ast_visitor.rs:7832-7871 | rust_port/crates/flow_parser/src/ast_visitor.rs:7931-7970 — 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 (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2820 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2820-2860 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3303-3337 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5298-5330 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2709 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2709-2741 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5834-5858 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:5864-5888 — 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 (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1223 — rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1223-1258 | rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1268-1303 | rust_port/crates/flow_typing_flow_common/src/type_subst.rs:1313-1348 — 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, 32+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 32+ corresponding lines) rust_port/crates/flow_cli/src/agent_helper_command.rs:101 — rust_port/crates/flow_cli/src/agent_helper_command.rs:101-132 | rust_port/crates/flow_cli/src/autocomplete_command.rs:27-63 | rust_port/crates/flow_cli/src/coverage_command.rs:20-56 | rust_port/crates/flow_cli/src/dump_types_command.rs:16-53 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 21+ corresponding lines) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2552 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2552-2574 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2581-2603 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2610-2632 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2639-2659 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2666-2690 — 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 (6 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 18+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1004 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1004-1024 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1143-1162 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2310-2333 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2553-2576 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2608-2634 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2870-2887 — 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 (5 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 18+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2021 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2021-2038 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2135-2152 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:3347-3366 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5875-5892 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6111-6130 — 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 (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:8033 — rust_port/crates/flow_parser/src/ast_visitor.rs:8033-8061 | rust_port/crates/flow_parser/src/ast_visitor.rs:8084-8106 | rust_port/crates/flow_parser/src/ast_visitor.rs:8131-8156 | rust_port/crates/flow_parser/src/ast_visitor.rs:15430-15451 — 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 (4 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 33+ corresponding lines) rust_port/crates/flow_analysis/src/scope_builder.rs:1609 — rust_port/crates/flow_analysis/src/scope_builder.rs:1609-1646 | rust_port/crates/flow_analysis/src/scope_builder.rs:2141-2176 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:6151-6184 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:10682-10714 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 17+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:7119 — rust_port/crates/flow_parser/src/ast_visitor.rs:7119-7136 | rust_port/crates/flow_parser/src/ast_visitor.rs:7494-7510 | rust_port/crates/flow_parser/src/ast_visitor.rs:13638-13654 | rust_port/crates/flow_parser/src/ast_visitor.rs:16387-16405 | rust_port/crates/flow_parser/src/ast_visitor.rs:16557-16574 | rust_port/crates/flow_parser/src/ast_visitor.rs:18219-18237 — 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 (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:6823 — rust_port/crates/flow_parser/src/ast_visitor.rs:6823-6841 | rust_port/crates/flow_parser/src/ast_visitor.rs:7157-7175 | rust_port/crates/flow_parser/src/ast_visitor.rs:16604-16620 | rust_port/crates/flow_parser/src/ast_visitor.rs:17950-17966 | rust_port/crates/flow_parser/src/ast_visitor.rs:18264-18282 — 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, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:195 — rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:195-210 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:217-232 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:234-249 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:256-271 | rust_port/crates/flow_typing_flow_js/src/natural_inference.rs:278-293 — 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 (8 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 9+ corresponding lines) rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:331 — rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:331-339 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:345-353 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:452-460 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:518-526 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:580-588 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:628-638 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:646-654 | rust_port/crates/flow_lsp_server/src/document_symbol_provider.rs:660-668 — 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 (6 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 8+ corresponding lines) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3871 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3871-3882 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3888-3895 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3906-3922 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3932-3947 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3957-3964 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:3971-3978 — These 6 members are one piece of code written 6 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 6 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) rust_port/crates/flow_parser_wasm/src/serializer.rs:159 — rust_port/crates/flow_parser_wasm/src/serializer.rs:159-174 | rust_port/crates/flow_parser_wasm/src/serializer.rs:239-254 | rust_port/crates/flow_parser_wasm/src/serializer.rs:259-274 | rust_port/crates/flow_parser_wasm/src/serializer.rs:282-296 | rust_port/crates/flow_parser_wasm/src/serializer.rs:301-313 | rust_port/crates/flow_parser_wasm/src/serializer.rs:318-332 — 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 (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1288 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1288-1300 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1505-1518 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1523-1536 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:6769-6782 — 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 copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) rust_port/crates/flow_typing_errors/src/flow_error.rs:269 — rust_port/crates/flow_typing_errors/src/flow_error.rs:269-272 | rust_port/crates/flow_typing_errors/src/flow_error.rs:462-465 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:7085 — rust_port/crates/flow_parser/src/ast_visitor.rs:7085-7093 | rust_port/crates/flow_parser/src/ast_visitor.rs:8500-8508 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:462-473 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:478-489 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) rust_port/crates/flow_parser/src/ast_visitor.rs:6949 — rust_port/crates/flow_parser/src/ast_visitor.rs:6949-6963 | rust_port/crates/flow_parser/src/ast_visitor.rs:10547-10560 | rust_port/crates/flow_parser/src/ast_visitor.rs:13220-13235 | rust_port/crates/flow_parser/src/ast_visitor.rs:18419-18433 | rust_port/crates/flow_parser/src/ast_visitor.rs:18456-18470 — 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) rust_port/crates/flow_typing_errors/src/error_message.rs:1162 — rust_port/crates/flow_typing_errors/src/error_message.rs:1162-1169 | rust_port/crates/flow_typing_errors/src/error_message.rs:1429-1436 | rust_port/crates/flow_typing_errors/src/error_message.rs:2628-2634 | rust_port/crates/flow_typing_errors/src/error_message.rs:2701-2708 — 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 (7 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 15+ corresponding lines) rust_port/crates/flow_config/src/flowconfig.rs:923 — rust_port/crates/flow_config/src/flowconfig.rs:923-938 | rust_port/crates/flow_config/src/flowconfig.rs:1012-1026 | rust_port/crates/flow_config/src/flowconfig.rs:1053-1068 | rust_port/crates/flow_config/src/flowconfig.rs:1073-1088 | rust_port/crates/flow_config/src/flowconfig.rs:1104-1119 | rust_port/crates/flow_config/src/flowconfig.rs:1716-1731 | rust_port/crates/flow_config/src/flowconfig.rs:1736-1751 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 9+ corresponding lines) rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:926 — rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:926-937 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1270-1283 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:1435-1446 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2751-2764 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:2769-2784 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:4180-4193 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5582-5590 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1951 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:1951-1957 | rust_port/crates/flow_typing_type/src/type_.rs:8296-8298 — 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.
D4 · Code Duplication · Duplicated block (26–67 lines × 3) · ×1
  • Duplicated block (26–67 lines × 3) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8659 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8659-8684 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10067-10133 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:10178-10203 — 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 `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:8659` it begins part-way through the construct above it, so those 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 (58 lines × 3) · ×1
  • Duplicated block (58 lines × 3) rust_port/crates/flow_env_builder/src/name_def.rs:2072 — rust_port/crates/flow_env_builder/src/name_def.rs:2072-2129 | rust_port/crates/flow_env_builder/src/name_def.rs:2320-2377 | rust_port/crates/flow_env_builder/src/name_def.rs:2429-2486 — 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 `rust_port/crates/flow_env_builder/src/name_def.rs:2072` it begins part-way through the construct above it, so those 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 (75 lines × 2) · ×1
  • Duplicated block (75 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:19841 — rust_port/crates/flow_typing_statement/src/statement.rs:19841-19915 | rust_port/crates/flow_typing_statement/src/statement.rs:20291-20365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:19841` it does not close everything it opens, so those 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 (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11269 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11269-11322 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11336-11389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11269` 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 (50 lines × 2) · ×1
  • Duplicated block (50 lines × 2) rust_port/crates/flow_event_logger/src/lib.rs:408 — rust_port/crates/flow_event_logger/src/lib.rs:408-457 | rust_port/crates/flow_event_logger/src/lib.rs:831-880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (45–49 lines × 2) · ×1
  • Duplicated block (45–49 lines × 2) rust_port/crates/flow_parser_wasm/src/serializer.rs:1528 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1528-1576 | rust_port/crates/flow_parser_wasm/src/serializer.rs:1626-1670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/serializer.rs:1528` it does not close everything it opens, so those 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 (116 lines × 2) · ×1
  • Duplicated block (116 lines × 2) rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:131 — rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:131-246 | rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:267-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_dev_tools/src/runtests/check_exec_file_promise.rs:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44–47 lines × 2) · ×1
  • Duplicated block (44–47 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:18383 — rust_port/crates/flow_typing_statement/src/statement.rs:18383-18429 | rust_port/crates/flow_typing_statement/src/statement.rs:18559-18602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:18383` it does not close everything it opens, so those 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 (34–46 lines × 2) · ×1
  • Duplicated block (34–46 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9619 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9619-9652 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9791-9836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9619` it begins part-way through the construct above it, so those 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 (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:5501 — rust_port/crates/flow_typing_statement/src/statement.rs:5501-5546 | rust_port/crates/flow_typing_statement/src/statement.rs:5584-5629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:5501` 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 (46–47 lines × 2) · ×1
  • Duplicated block (46–47 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13341 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13341-13387 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13389-13434 — both copies are in the same file, so extract the 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) rust_port/crates/flow_parser/src/ast.rs:4964 — rust_port/crates/flow_parser/src/ast.rs:4964-5006 | rust_port/crates/flow_parser/src/ast.rs:5009-5051 — both copies are in the same file, so extract the 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 (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) rust_port/crates/flow_parser/src/ast.rs:1499 — rust_port/crates/flow_parser/src/ast.rs:1499-1540 | rust_port/crates/flow_parser/src/ast.rs:1543-1584 — both copies are in the same file, so extract the 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 (38–41 lines × 2) · ×1
  • Duplicated block (38–41 lines × 2) rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4378 — rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4378-4418 | rust_port/crates/flow_typing_ty_normalizer/src/normalizer.rs:4421-4458 — both copies are in the same file, so extract the 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 (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) rust_port/crates/flow_services_inference/src/type_service.rs:1981 — rust_port/crates/flow_services_inference/src/type_service.rs:1981-2020 | rust_port/crates/flow_services_inference/src/type_service.rs:4075-4114 — both copies are in the same file, so extract the 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–34 lines × 4) · ×1
  • Duplicated block (32–34 lines × 4) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4867 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4867-4900 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4922-4953 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:4990-5021 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:5056-5087 — 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 (26–34 lines × 2) · ×1
  • Duplicated block (26–34 lines × 2) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9264 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9264-9297 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9336-9361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9264` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9362` calls `MessageAbstract` and `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:9298` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–33 lines × 3) · ×1
  • Duplicated block (23–33 lines × 3) rust_port/crates/flow_analysis/src/ssa_builder.rs:879 — rust_port/crates/flow_analysis/src/ssa_builder.rs:879-901 | rust_port/crates/flow_analysis/src/ssa_builder.rs:924-946 | rust_port/crates/flow_analysis/src/ssa_builder.rs:1677-1709 — 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 `rust_port/crates/flow_analysis/src/ssa_builder.rs:879` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) rust_port/crates/flow_parser/src/statement_parser.rs:228 — rust_port/crates/flow_parser/src/statement_parser.rs:228-260 | rust_port/crates/flow_parser/src/statement_parser.rs:281-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser/src/statement_parser.rs:228` 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 (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8647 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8647-8680 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9032-9065 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8647` 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–33 lines × 2) · ×1
  • Duplicated block (31–33 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1291 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1291-1323 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:4917-4947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1291` it does not close everything it opens, so those 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–32 lines × 3) · ×1
  • Duplicated block (27–32 lines × 3) rust_port/crates/flow_cli/src/glean_schema.rs:321 — rust_port/crates/flow_cli/src/glean_schema.rs:321-347 | rust_port/crates/flow_cli/src/glean_schema.rs:466-497 | rust_port/crates/flow_cli/src/glean_schema.rs:795-821 — 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.
D4 · Code Duplication · Duplicated block (3–32 lines × 3) · ×1
  • Duplicated block (3–32 lines × 3) rust_port/crates/flow_parser/src/parser_env.rs:1141 — rust_port/crates/flow_parser/src/parser_env.rs:1141-1143 | rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:46-77 | rust_port/crates/flow_services_autocomplete/src/autocomplete_service_js.rs:1012-1043 — 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 `rust_port/crates/flow_parser_wasm/src/babel_adapter/record_lowering.rs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1543 — rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1543-1574 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:1606-1635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/insert_type_utils.rs: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. 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 (27–31 lines × 2) · ×1
  • Duplicated block (27–31 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:1312 — rust_port/crates/flow_parser/src/object_parser.rs:1312-1338 | rust_port/crates/flow_parser/src/object_parser.rs:1909-1939 — both copies are in the same file, so extract the 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 (4–31 lines × 5) · ×1
  • Duplicated block (4–31 lines × 5) rust_port/crates/flow_services_inference/src/type_service.rs:1489 — rust_port/crates/flow_services_inference/src/type_service.rs:1489-1492 | rust_port/crates/flow_services_inference/src/type_service.rs:2256-2259 | rust_port/crates/flow_services_inference/src/type_service.rs:2920-2949 | rust_port/crates/flow_services_inference/src/type_service.rs:3293-3323 | rust_port/crates/flow_services_inference/src/type_service.rs:4119-4122 — 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 `rust_port/crates/flow_services_inference/src/type_service.rs:1489` it does not close everything it opens, so those 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, `rust_port/crates/flow_services_inference/src/type_service.rs:2920` calls `dupe` and `rust_port/crates/flow_services_inference/src/type_service.rs:2256` 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 (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) rust_port/crates/flow_analysis/src/scope_builder.rs:1617 — rust_port/crates/flow_analysis/src/scope_builder.rs:1617-1646 | rust_port/crates/flow_analysis/src/scope_builder.rs:2148-2176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_analysis/src/scope_builder.rs:1617` 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 (36–37 lines × 3) · ×1
  • Duplicated block (36–37 lines × 3) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:760 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:760-796 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:901-937 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:986-1021 — 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 `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:760` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3761 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3761-3788 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7790-7817 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7829-7856 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3761` it begins part-way through the construct above it, so those 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–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4863 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4863-4888 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4891-4918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:4863` 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–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1117 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1117-1141 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1220-1247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1117` it begins part-way through the construct above it, so those 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10359 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10359-10385 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10429-10456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10359` it begins part-way through the construct above it, so those 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–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:10057 — rust_port/crates/flow_typing_statement/src/statement.rs:10057-10099 | rust_port/crates/flow_typing_statement/src/statement.rs:10134-10175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:10057` it begins part-way through the construct above it, so those 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–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) rust_port/crates/flow_parser_wasm/src/position.rs:109 — rust_port/crates/flow_parser_wasm/src/position.rs:109-132 | rust_port/crates/flow_parser_wasm/src/position.rs:197-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_parser_wasm/src/position.rs: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.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) rust_port/crates/flow_services_module/src/lib.rs:1548 — rust_port/crates/flow_services_module/src/lib.rs:1548-1573 | rust_port/crates/flow_services_module/src/lib.rs:1593-1618 | rust_port/crates/flow_services_module/src/lib.rs:1644-1669 — 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 `rust_port/crates/flow_services_module/src/lib.rs:1548` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_services_module/src/lib.rs:1574` calls `as_deref_mut` and `rust_port/crates/flow_services_module/src/lib.rs:1670` 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 (19–26 lines × 2) · ×1
  • Duplicated block (19–26 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9846 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9846-9871 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9904-9922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9846` it begins part-way through the construct above it, so those 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–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:468 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:468-488 | rust_port/crates/flow_services_inference/src/job_utils.rs:206-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:468` 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–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2148 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2148-2170 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2290-2314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–24 lines × 2) · ×1
  • Duplicated block (11–24 lines × 2) rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5318 — rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5318-5341 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5434-5444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:5318` it does not close everything it opens, so those 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–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1148 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1148-1169 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1180-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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:1148` it begins part-way through the construct above it, so those 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 (15–24 lines × 2) · ×1
  • Duplicated block (15–24 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5206 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5206-5229 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5239-5253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:5206` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (5–23 lines × 4) · ×1
  • Duplicated block (5–23 lines × 4) rust_port/crates/flow_typing_statement/src/statement.rs:14779 — rust_port/crates/flow_typing_statement/src/statement.rs:14779-14801 | rust_port/crates/flow_typing_statement/src/statement.rs:14807-14829 | rust_port/crates/flow_typing_statement/src/statement.rs:14831-14835 | rust_port/crates/flow_typing_statement/src/statement.rs:14879-14901 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:14779` 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) rust_port/crates/flow_codemods/src/annotate_exports.rs:528 — rust_port/crates/flow_codemods/src/annotate_exports.rs:528-549 | rust_port/crates/flow_codemods/src/annotate_exports.rs:573-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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:528` 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 (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) rust_port/crates/flow_common_ty/src/ty_printer.rs:100 — rust_port/crates/flow_common_ty/src/ty_printer.rs:100-117 | rust_port/crates/flow_parser_utils_output/src/js_layout_generator.rs:505-526 — 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 `rust_port/crates/flow_common_ty/src/ty_printer.rs:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–22 lines × 2) · ×1
  • Duplicated block (15–22 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:9859 — rust_port/crates/flow_typing_statement/src/statement.rs:9859-9880 | rust_port/crates/flow_typing_statement/src/statement.rs:12664-12678 — both copies are in the same file, so extract the 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:21264 — rust_port/crates/flow_typing_statement/src/statement.rs:21264-21285 | rust_port/crates/flow_typing_statement/src/statement.rs:21387-21406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:21264` 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 (44 lines × 3) · ×1
  • Duplicated block (44 lines × 3) rust_port/crates/flow_typing_statement/src/statement.rs:17450 — rust_port/crates/flow_typing_statement/src/statement.rs:17450-17493 | rust_port/crates/flow_typing_statement/src/statement.rs:17616-17659 | rust_port/crates/flow_typing_statement/src/statement.rs:17820-17863 — 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 (13–21 lines × 2) · ×1
  • Duplicated block (13–21 lines × 2) rust_port/crates/flow_typing_statement/src/class_sig.rs:1856 — rust_port/crates/flow_typing_statement/src/class_sig.rs:1856-1876 | rust_port/crates/flow_typing_statement/src/class_sig.rs:2150-2162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/class_sig.rs:1856` 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–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2624 — rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2624-2644 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:3447-3463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:2624` 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–20 lines × 3) · ×1
  • Duplicated block (18–20 lines × 3) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1650 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1650-1669 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2153-2170 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:2188-2205 — 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 `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:1650` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:2225 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:2225-2263 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2393-2431 — both copies are in the same file, so extract the 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 (4–20 lines × 3) · ×1
  • Duplicated block (4–20 lines × 3) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1343 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1343-1346 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6133-6151 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:6158-6177 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:1343` it does not close everything it opens, so those 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–19 lines × 2) · ×1
  • Duplicated block (10–19 lines × 2) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13191 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13191-13209 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13220-13229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13191` 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 × 2) · ×1
  • Duplicated block (17–19 lines × 2) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4964 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4964-4982 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5758-5774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4964` 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 (17–18 lines × 5) · ×1
  • Duplicated block (17–18 lines × 5) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3778 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3778-3795 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7737-7753 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7772-7788 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7807-7823 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7846-7862 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3778` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (16–18 lines × 3) rust_port/crates/flow_parser_wasm/src/serializer.rs:1569 — rust_port/crates/flow_parser_wasm/src/serializer.rs:1569-1586 | rust_port/crates/flow_parser_wasm/src/serializer.rs:1594-1609 | rust_port/crates/flow_parser_wasm/src/serializer.rs:1665-1680 — 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 `rust_port/crates/flow_parser_wasm/src/serializer.rs:1569` it begins part-way through the construct above it, so those 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–18 lines × 3) · ×1
  • Duplicated block (14–18 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9465 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9465-9478 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9502-9519 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10663-10677 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9502` 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 (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7425 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7425-7439 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7465-7482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:7425` it does not close everything it opens, so those 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–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2442 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2442-2459 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2489-2501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2442` it does not close everything it opens, so those 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–17 lines × 4) · ×1
  • Duplicated block (11–17 lines × 4) rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:785 — rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:785-801 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:926-937 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:1010-1021 | rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:1120-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 `rust_port/crates/flow_codemods/src/utils/codemod_runner.rs: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. 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–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:17336 — rust_port/crates/flow_typing_statement/src/statement.rs:17336-17350 | rust_port/crates/flow_typing_statement/src/statement.rs:17664-17680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:17336` it does not close everything it opens, so those 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) · ×1
  • Duplicated block (16 lines × 5) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3868 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3868-3883 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3896-3911 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3925-3940 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3943-3958 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3968-3983 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:3868` it begins part-way through the construct above it, so those 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 × 4) · ×1
  • Duplicated block (16 lines × 4) rust_port/crates/flow_typing_utils/src/type_filter.rs:1155 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1155-1170 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1255-1270 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1379-1394 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1475-1490 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:1155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–16 lines × 3) · ×1
  • Duplicated block (12–16 lines × 3) rust_port/crates/flow_parser_wasm/src/serializer.rs:2279 — rust_port/crates/flow_parser_wasm/src/serializer.rs:2279-2294 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2483-2494 | rust_port/crates/flow_parser_wasm/src/serializer.rs:2536-2547 — 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, `rust_port/crates/flow_parser_wasm/src/serializer.rs:2495` calls `write_bool` and `rust_port/crates/flow_parser_wasm/src/serializer.rs:2295` 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–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9343 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9343-9356 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9369-9382 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9393-9408 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:9343` 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 (44–48 lines × 2) · ×1
  • Duplicated block (44–48 lines × 2) rust_port/crates/flow_parser/src/object_parser.rs:222 — rust_port/crates/flow_parser/src/object_parser.rs:222-269 | rust_port/crates/flow_parser/src/object_parser.rs:1260-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 `rust_port/crates/flow_parser/src/object_parser.rs:222` 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–16 lines × 2) · ×1
  • Duplicated block (10–16 lines × 2) rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:1165 — rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:1165-1180 | rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:1204-1213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/template_literal_type.rs:1165` it does not close everything it opens, so those 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 (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) rust_port/crates/flow_server_command_handler/src/command_handler.rs:7384 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:7384-7398 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7418-7432 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7513-7527 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:7576-7590 — 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 `rust_port/crates/flow_server_command_handler/src/command_handler.rs:7384` it begins part-way through the construct above it, so those 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–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6761 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6761-6771 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6796-6810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:6761` it begins part-way through the construct above it, so those 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 × 6) · ×1
  • Duplicated block (12–14 lines × 6) rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2893 — rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2893-2905 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2935-2947 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3030-3043 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3084-3095 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3136-3148 | rust_port/crates/flow_typing_errors/src/intermediate_error.rs:3176-3187 — 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 `rust_port/crates/flow_typing_errors/src/intermediate_error.rs:2893` it begins part-way through the construct above it, so those 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 × 6) · ×1
  • Duplicated block (14 lines × 6) rust_port/crates/flow_typing_statement/src/statement.rs:17142 — rust_port/crates/flow_typing_statement/src/statement.rs:17142-17155 | rust_port/crates/flow_typing_statement/src/statement.rs:17207-17220 | rust_port/crates/flow_typing_statement/src/statement.rs:17295-17308 | rust_port/crates/flow_typing_statement/src/statement.rs:17459-17472 | rust_port/crates/flow_typing_statement/src/statement.rs:17625-17638 | rust_port/crates/flow_typing_statement/src/statement.rs:17829-17842 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17142` it does not close everything it opens, so those 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 × 5) · ×1
  • Duplicated block (14 lines × 5) rust_port/crates/flow_parser/src/statement_parser.rs:3901 — rust_port/crates/flow_parser/src/statement_parser.rs:3901-3914 | rust_port/crates/flow_parser/src/statement_parser.rs:3925-3938 | rust_port/crates/flow_parser/src/statement_parser.rs:3955-3968 | rust_port/crates/flow_parser/src/statement_parser.rs:3980-3993 | rust_port/crates/flow_parser/src/statement_parser.rs:4003-4016 — 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 `rust_port/crates/flow_parser/src/statement_parser.rs:3901` 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–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) rust_port/crates/flow_typing_statement/src/type_annotation.rs:7763 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:7763-7774 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:7880-7893 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:7998-8011 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8017-8029 — 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 (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1315 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1315-1327 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1330-1340 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1343-1356 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1315` it begins part-way through the construct above it, so those 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–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7627 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7627-7637 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:8175-8188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7627` it begins part-way through the construct above it, so those 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–13 lines × 5) · ×1
  • Duplicated block (11–13 lines × 5) rust_port/crates/flow_codemods/src/annotate_exports.rs:325 — rust_port/crates/flow_codemods/src/annotate_exports.rs:325-337 | rust_port/crates/flow_codemods/src/annotate_exports.rs:517-527 | rust_port/crates/flow_codemods/src/annotate_exports.rs:637-647 | rust_port/crates/flow_codemods/src/annotate_exports.rs:803-813 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:264-275 — before extracting anything, compare `rust_port/crates/flow_codemods/src/annotate_exports.rs` and `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs` 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. If that is what happened, the fix is to keep one copy and have the 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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:325` 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–13 lines × 4) · ×1
  • Duplicated block (7–13 lines × 4) rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:740 — rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:740-752 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:754-766 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:768-780 | rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:781-787 — 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 `rust_port/crates/flow_typing_statement/src/module_info_analyzer.rs:740` 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 (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) rust_port/crates/flow_services_code_action/src/autofix_imports.rs:336 — rust_port/crates/flow_services_code_action/src/autofix_imports.rs:336-348 | rust_port/crates/flow_services_code_action/src/autofix_imports.rs:359-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_services_code_action/src/autofix_imports.rs: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. 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–13 lines × 2) · ×1
  • Duplicated block (8–13 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2252 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2252-2259 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2518-2530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2252` it begins part-way through the construct above it, so those 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–12 lines × 8) · ×1
  • Duplicated block (11–12 lines × 8) rust_port/crates/flow_typing_statement/src/statement.rs:17154 — rust_port/crates/flow_typing_statement/src/statement.rs:17154-17164 | rust_port/crates/flow_typing_statement/src/statement.rs:17219-17229 | rust_port/crates/flow_typing_statement/src/statement.rs:17307-17317 | rust_port/crates/flow_typing_statement/src/statement.rs:17377-17387 | rust_port/crates/flow_typing_statement/src/statement.rs:18045-18056 | rust_port/crates/flow_typing_statement/src/statement.rs:18082-18092 | rust_port/crates/flow_typing_statement/src/statement.rs:18543-18553 | rust_port/crates/flow_typing_statement/src/statement.rs:18720-18730 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17154` it begins part-way through the construct above it, so those 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) · ×1
  • Duplicated block (12 lines × 6) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3498 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3498-3509 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3778-3789 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7737-7748 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7772-7783 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7807-7818 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:7846-7857 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3498` it begins part-way through the construct above it, so those 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–12 lines × 5) · ×1
  • Duplicated block (10–12 lines × 5) rust_port/crates/flow_codemods/src/annotate_exports.rs:363 — rust_port/crates/flow_codemods/src/annotate_exports.rs:363-374 | rust_port/crates/flow_codemods/src/annotate_exports.rs:560-571 | rust_port/crates/flow_codemods/src/annotate_exports.rs:675-684 | rust_port/crates/flow_codemods/src/annotate_exports.rs:847-856 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:299-309 — before extracting anything, compare `rust_port/crates/flow_codemods/src/annotate_exports.rs` and `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs` 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. If that is what happened, the fix is to keep one copy and have the 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 `rust_port/crates/flow_codemods/src/annotate_exports.rs:363` 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 (8–12 lines × 4) · ×1
  • Duplicated block (8–12 lines × 4) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11277 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11277-11288 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11344-11355 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13370-13377 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:13417-13424 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:11277` it does not close everything it opens, so those 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 (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:10256 — rust_port/crates/flow_typing_statement/src/statement.rs:10256-10264 | rust_port/crates/flow_typing_statement/src/statement.rs:10513-10524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:10256` it does not close everything it opens, so those 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–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:783 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:783-792 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:794-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:783` it begins part-way through the construct above it, so those 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–11 lines × 5) · ×1
  • Duplicated block (10–11 lines × 5) rust_port/crates/flow_codemods/src/annotate_exports.rs:525 — rust_port/crates/flow_codemods/src/annotate_exports.rs:525-534 | rust_port/crates/flow_codemods/src/annotate_exports.rs:645-655 | rust_port/crates/flow_codemods/src/annotate_exports.rs:683-692 | rust_port/crates/flow_codemods/src/annotate_exports.rs:811-821 | rust_port/crates/flow_codemods/src/annotate_exports.rs:855-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.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) rust_port/crates/flow_typing_flow_js/src/object_kit.rs:764 — rust_port/crates/flow_typing_flow_js/src/object_kit.rs:764-773 | rust_port/crates/flow_typing_flow_js/src/object_kit.rs:778-788 | rust_port/crates/flow_typing_flow_js/src/object_kit.rs:798-808 | rust_port/crates/flow_typing_flow_js/src/object_kit.rs:818-828 — 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 `rust_port/crates/flow_typing_flow_js/src/object_kit.rs:764` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872 — rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872-1882 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1920-1928 | rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:2749-2757 — 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 `rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs:1872` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795 — rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795-1802 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2025-2035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_server_command_handler/src/command_handler.rs:1795` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–11 lines × 2) · ×1
  • Duplicated block (6–11 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2740 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2740-2750 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2837-2842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2740` it begins part-way through the construct above it, so those 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 (9–10 lines × 7) · ×1
  • Duplicated block (9–10 lines × 7) rust_port/crates/flow_typing_statement/src/component_params.rs:195 — rust_port/crates/flow_typing_statement/src/component_params.rs:195-204 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:1367-1375 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:1588-1597 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:1749-1758 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:1865-1874 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8665-8674 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:8683-8692 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/component_params.rs:195` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–15 lines × 3) · ×1
  • Duplicated block (8–15 lines × 3) rust_port/crates/flow_parser/src/ast_visitor.rs:14097 — rust_port/crates/flow_parser/src/ast_visitor.rs:14097-14104 | rust_port/crates/flow_parser/src/ast_visitor.rs:14129-14143 | rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs:5114-5128 — before extracting anything, compare `rust_port/crates/flow_parser/src/ast_visitor.rs` and `rust_port/crates/flow_parser/src/polymorphic_ast_mapper.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `rust_port/crates/flow_parser/src/ast_visitor.rs:14097` it begins part-way through the construct above it, so those 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 (9 lines × 15) · ×1
  • Duplicated block (9 lines × 15) rust_port/crates/flow_typing_statement/src/statement.rs:17275 — rust_port/crates/flow_typing_statement/src/statement.rs:17275-17283 | rust_port/crates/flow_typing_statement/src/statement.rs:17471-17479 | rust_port/crates/flow_typing_statement/src/statement.rs:17604-17612 | rust_port/crates/flow_typing_statement/src/statement.rs:17637-17645 | rust_port/crates/flow_typing_statement/src/statement.rs:17698-17706 | rust_port/crates/flow_typing_statement/src/statement.rs:17841-17849 | rust_port/crates/flow_typing_statement/src/statement.rs:17963-17971 | rust_port/crates/flow_typing_statement/src/statement.rs:18352-18360 | rust_port/crates/flow_typing_statement/src/statement.rs:18372-18380 | rust_port/crates/flow_typing_statement/src/statement.rs:18391-18399 | rust_port/crates/flow_typing_statement/src/statement.rs:18419-18427 | rust_port/crates/flow_typing_statement/src/statement.rs:18567-18575 | rust_port/crates/flow_typing_statement/src/statement.rs:18592-18600 | rust_port/crates/flow_typing_statement/src/statement.rs:18744-18752 | rust_port/crates/flow_typing_statement/src/statement.rs:18762-18770 — 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 12) · ×1
  • Duplicated block (8–9 lines × 12) rust_port/crates/flow_cli/src/agent_helper_command.rs:252 — rust_port/crates/flow_cli/src/agent_helper_command.rs:252-260 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:92-99 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:199-206 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:298-305 | rust_port/crates/flow_cli/src/autofix_command.rs:175-183 | rust_port/crates/flow_cli/src/autofix_command.rs:347-354 | rust_port/crates/flow_cli/src/autofix_command.rs:516-523 | rust_port/crates/flow_cli/src/dump_types_command.rs:156-164 | rust_port/crates/flow_cli/src/get_def_command.rs:70-77 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:99-107 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:257-265 | rust_port/crates/flow_cli/src/type_of_name_command.rs:166-174 — before extracting anything, compare `rust_port/crates/flow_cli/src/agent_helper_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` as WHOLE FILES: this scan already matched 4 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. 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, `rust_port/crates/flow_cli/src/apply_code_action_command.rs:99` calls `unwrap`, `get`, `truthy` and `rust_port/crates/flow_cli/src/agent_helper_command.rs:260` 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 (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) rust_port/crates/flow_typing_utils/src/type_filter.rs:713 — rust_port/crates/flow_typing_utils/src/type_filter.rs:713-721 | rust_port/crates/flow_typing_utils/src/type_filter.rs:888-896 | rust_port/crates/flow_typing_utils/src/type_filter.rs:947-955 | rust_port/crates/flow_typing_utils/src/type_filter.rs:993-1001 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1045-1053 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1550-1558 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1601-1609 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1657-1665 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:713` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_utils/src/type_filter.rs:1655` calls `ArrT`, `unchanged_result` and `rust_port/crates/flow_typing_utils/src/type_filter.rs:886` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2172 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2172-2183 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2283-2292 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2697-2705 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3360-3369 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:3979-3987 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:4624-4632 | rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5031-5040 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:2172` it begins part-way through the construct above it, so those 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 (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1019 — rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1019-1027 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2440-2448 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2487-2495 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2543-2551 | rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2676-2684 — 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 `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:1019` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2553` calls `object_like`, `Ok` and `rust_port/crates/flow_typing_utils/src/type_operation_utils.rs:2450` 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 (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) rust_port/crates/flow_cli/src/autofix_command.rs:32 — rust_port/crates/flow_cli/src/autofix_command.rs:32-40 | rust_port/crates/flow_cli/src/autofix_command.rs:271-278 | rust_port/crates/flow_cli/src/autofix_command.rs:415-422 | rust_port/crates/flow_cli/src/type_at_pos_command.rs:27-35 — 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 `rust_port/crates/flow_cli/src/autofix_command.rs:32` it begins part-way through the construct above it, so those 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–9 lines × 2) · ×1
  • Duplicated block (5–9 lines × 2) rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:305 — rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:305-313 | rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:423-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:305` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–9 lines × 4) · ×1
  • Duplicated block (3–9 lines × 4) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14667 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14667-14675 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14695-14703 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14799-14804 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14823-14825 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14667` it does not close everything it opens, so those 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, `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14677` calls `as_str` and `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:14705` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 23) · ×1
  • Duplicated block (8 lines × 23) rust_port/crates/flow_typing_statement/src/statement.rs:17154 — rust_port/crates/flow_typing_statement/src/statement.rs:17154-17162 | rust_port/crates/flow_typing_statement/src/statement.rs:17219-17227 | rust_port/crates/flow_typing_statement/src/statement.rs:17275-17282 | rust_port/crates/flow_typing_statement/src/statement.rs:17307-17315 | rust_port/crates/flow_typing_statement/src/statement.rs:17376-17385 | rust_port/crates/flow_typing_statement/src/statement.rs:17471-17478 | rust_port/crates/flow_typing_statement/src/statement.rs:17604-17611 | rust_port/crates/flow_typing_statement/src/statement.rs:17637-17644 | rust_port/crates/flow_typing_statement/src/statement.rs:17697-17705 | rust_port/crates/flow_typing_statement/src/statement.rs:17841-17848 | rust_port/crates/flow_typing_statement/src/statement.rs:17963-17970 | rust_port/crates/flow_typing_statement/src/statement.rs:18044-18054 | rust_port/crates/flow_typing_statement/src/statement.rs:18082-18090 | rust_port/crates/flow_typing_statement/src/statement.rs:18352-18359 | rust_port/crates/flow_typing_statement/src/statement.rs:18372-18379 | rust_port/crates/flow_typing_statement/src/statement.rs:18391-18398 | rust_port/crates/flow_typing_statement/src/statement.rs:18419-18426 | rust_port/crates/flow_typing_statement/src/statement.rs:18543-18551 | rust_port/crates/flow_typing_statement/src/statement.rs:18567-18574 | rust_port/crates/flow_typing_statement/src/statement.rs:18592-18599 | rust_port/crates/flow_typing_statement/src/statement.rs:18720-18728 | rust_port/crates/flow_typing_statement/src/statement.rs:18744-18751 | rust_port/crates/flow_typing_statement/src/statement.rs:18762-18769 — all 23 copies are in the same file, so extract the block into one function there and call 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 `rust_port/crates/flow_typing_statement/src/statement.rs:17154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) rust_port/crates/flow_parser/src/declaration_parser.rs:868 — rust_port/crates/flow_parser/src/declaration_parser.rs:868-873 | rust_port/crates/flow_parser/src/expression_parser.rs:2110-2117 — 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 `rust_port/crates/flow_parser/src/declaration_parser.rs:868` it does not close everything it opens, so those 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–8 lines × 2) · ×1
  • Duplicated block (5–8 lines × 2) rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5269 — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5269-5276 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1247-1251 — 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 `rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:5269` it does not close everything it opens, so those 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 (4–7 lines × 9) · ×1
  • Duplicated block (4–7 lines × 9) rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2373 — rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2373-2379 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2390-2393 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2394-2400 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2421-2427 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2495-2501 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2509-2512 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2554-2560 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2632-2638 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2784-2790 — 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 `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2373` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2371` calls `Reason`, `dupe`, `merge_impl` and `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2390` 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 × 5) · ×1
  • Duplicated block (7 lines × 5) rust_port/crates/flow_cli/src/lib.rs:386 — rust_port/crates/flow_cli/src/lib.rs:386-392 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4222-4228 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4280-4286 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:4641-4647 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:8078-8084 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4230` calls `map_err` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs:4288` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–7 lines × 6) · ×1
  • Duplicated block (3–7 lines × 6) rust_port/crates/flow_cli/src/agent_helper_command.rs:247 — rust_port/crates/flow_cli/src/agent_helper_command.rs:247-250 | rust_port/crates/flow_cli/src/autofix_command.rs:167-173 | rust_port/crates/flow_cli/src/autofix_command.rs:339-345 | rust_port/crates/flow_cli/src/autofix_command.rs:508-514 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:95-97 | rust_port/crates/flow_cli/src/type_of_name_command.rs:162-164 — before extracting anything, compare `rust_port/crates/flow_cli/src/autofix_command.rs` and `rust_port/crates/flow_cli/src/inlay_hint_command.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 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, `rust_port/crates/flow_cli/src/inlay_hint_command.rs:94` calls `get_connect_flags` and `rust_port/crates/flow_cli/src/autofix_command.rs:167` 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 (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8871 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8871-8878 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8896-8904 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8912-8920 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8896` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–7 lines × 4) · ×1
  • Duplicated block (5–7 lines × 4) rust_port/crates/flow_typing/src/merge.rs:359 — rust_port/crates/flow_typing/src/merge.rs:359-365 | rust_port/crates/flow_typing/src/merge.rs:378-384 | rust_port/crates/flow_typing/src/merge.rs:397-403 | rust_port/crates/flow_typing/src/merge.rs:414-418 — 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 `rust_port/crates/flow_typing/src/merge.rs:359` it does not close everything it opens, so those 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, `rust_port/crates/flow_typing/src/merge.rs:359` calls `DefT` and `rust_port/crates/flow_typing/src/merge.rs:414` 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–7 lines × 4) · ×1
  • Duplicated block (4–7 lines × 4) rust_port/crates/flow_services_inference/src/merge_service.rs:257 — rust_port/crates/flow_services_inference/src/merge_service.rs:257-263 | rust_port/crates/flow_services_inference/src/merge_service.rs:340-346 | rust_port/crates/flow_services_inference/src/merge_service.rs:357-360 | rust_port/crates/flow_services_inference/src/merge_service.rs:377-380 — 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 `rust_port/crates/flow_services_inference/src/merge_service.rs:257` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_services_inference/src/merge_service.rs:255` calls `downgrade`, `Fn` and `rust_port/crates/flow_services_inference/src/merge_service.rs:357` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) rust_port/crates/flow_cli/src/codemod_command.rs:823 — rust_port/crates/flow_cli/src/codemod_command.rs:823-829 | rust_port/crates/flow_cli/src/codemod_command.rs:942-948 | rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:154-159 | rust_port/crates/flow_codemods/src/utils/codemod_annotator.rs:481-486 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:1276-1281 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2245-2250 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2330-2335 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:2413-2418 | rust_port/crates/flow_server_command_handler/src/command_handler.rs:3912-3918 — before extracting anything, compare `rust_port/crates/flow_cli/src/codemod_command.rs` and `rust_port/crates/flow_server_command_handler/src/command_handler.rs` as WHOLE FILES: this scan already matched 3 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 `rust_port/crates/flow_cli/src/codemod_command.rs:823` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) rust_port/crates/flow_type_sig/src/type_sig_mark.rs:279 — rust_port/crates/flow_type_sig/src/type_sig_mark.rs:279-285 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:546-552 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:561-567 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:576-582 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:591-597 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:606-612 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:621-627 | rust_port/crates/flow_type_sig/src/type_sig_mark.rs:636-642 — 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 `rust_port/crates/flow_type_sig/src/type_sig_mark.rs:279` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–6 lines × 6) · ×1
  • Duplicated block (5–6 lines × 6) rust_port/crates/flow_typing_type/src/type_.rs:3780 — rust_port/crates/flow_typing_type/src/type_.rs:3780-3785 | rust_port/crates/flow_typing_type/src/type_.rs:4470-4475 | rust_port/crates/flow_typing_type/src/type_.rs:4502-4506 | rust_port/crates/flow_typing_type/src/type_.rs:4511-4515 | rust_port/crates/flow_typing_type/src/type_.rs:4520-4524 | rust_port/crates/flow_typing_type/src/type_.rs:4529-4533 — 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 `rust_port/crates/flow_typing_type/src/type_.rs:3780` it begins part-way through the construct above it, so those 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, `rust_port/crates/flow_typing_type/src/type_.rs:4476` calls `then_with`, `cmp` and `rust_port/crates/flow_typing_type/src/type_.rs:4507` 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 × 5) · ×1
  • Duplicated block (6 lines × 5) rust_port/crates/flow_typing_utils/src/type_filter.rs:1139 — rust_port/crates/flow_typing_utils/src/type_filter.rs:1139-1144 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1239-1244 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1363-1368 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1412-1417 | rust_port/crates/flow_typing_utils/src/type_filter.rs:1459-1464 — 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 `rust_port/crates/flow_typing_utils/src/type_filter.rs:1139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–6 lines × 4) · ×1
  • Duplicated block (4–6 lines × 4) rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3197 — rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3197-3202 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3442-3447 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3526-3529 | rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3816-3820 — 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 `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3197` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3440` calls `diff_if_changed`, `expression` and `rust_port/crates/flow_parser_utils/src/flow_ast_differ.rs:3195` 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 (4–6 lines × 5) · ×1
  • Duplicated block (4–6 lines × 5) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8106 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8106-8109 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8568-8573 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8631-8635 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8891-8896 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8985-8989 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) rust_port/crates/flow_typing_statement/src/statement.rs:7931 — rust_port/crates/flow_typing_statement/src/statement.rs:7931-7935 | rust_port/crates/flow_typing_statement/src/statement.rs:7955-7960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/statement.rs:7931` 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 (6 lines × 31) · ×1
  • Duplicated block (6 lines × 31) rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1457 — rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1457-1462 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1484-1489 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1518-1523 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1557-1562 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1590-1595 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1710-1715 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1744-1749 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:1978-1983 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2006-2011 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2085-2090 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2135-2140 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2174-2179 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2212-2217 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2244-2249 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2308-2313 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2335-2340 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2361-2366 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2390-2395 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2430-2435 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2472-2477 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2505-2510 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2545-2550 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2577-2582 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2674-2679 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:2841-2846 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3058-3063 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3112-3117 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3178-3183 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3269-3274 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3316-3321 | rust_port/crates/flow_env_builder_resolver/src/name_def_ordering.rs:3360-3365 — all 31 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 12) · ×1
  • Duplicated block (5 lines × 12) rust_port/crates/flow_common_ty/src/ty_utils.rs:678 — rust_port/crates/flow_common_ty/src/ty_utils.rs:678-682 | rust_port/crates/flow_common_ty/src/ty_utils.rs:730-734 | rust_port/crates/flow_common_ty/src/ty_utils.rs:792-796 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:2691-2696 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1312-1316 | rust_port/crates/flow_typing_statement/src/class_sig.rs:1393-1397 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:5421-5425 | rust_port/crates/flow_typing_type/src/type_util.rs:2693-2697 | rust_port/crates/flow_typing_utils/src/type_env.rs:749-753 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2954-2958 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:4476-4480 | rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:5855-5859 — there are 12 copies across 7 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 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_common_ty/src/ty_utils.rs:678` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_common_ty/src/ty_utils.rs:791` calls `Bot` and `rust_port/crates/flow_typing_utils/src/type_sig_merge.rs:2953` 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 (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) rust_port/crates/flow_services_inference/src/merge_service.rs:248 — rust_port/crates/flow_services_inference/src/merge_service.rs:248-252 | rust_port/crates/flow_services_inference/src/merge_service.rs:266-270 | rust_port/crates/flow_services_inference/src/merge_service.rs:282-286 | rust_port/crates/flow_services_inference/src/merge_service.rs:331-335 | rust_port/crates/flow_services_inference/src/merge_service.rs:351-355 | rust_port/crates/flow_services_inference/src/merge_service.rs:371-375 | rust_port/crates/flow_services_inference/src/merge_service.rs:390-394 | rust_port/crates/flow_services_inference/src/merge_service.rs:545-549 | rust_port/crates/flow_services_inference/src/merge_service.rs:587-591 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_services_inference/src/merge_service.rs:265` calls `as_ref` and `rust_port/crates/flow_services_inference/src/merge_service.rs:388` 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 (3–5 lines × 6) · ×1
  • Duplicated block (3–5 lines × 6) rust_port/crates/flow_typing/src/env_resolution.rs:506 — rust_port/crates/flow_typing/src/env_resolution.rs:506-510 | rust_port/crates/flow_typing_flow_common/src/flow_js_utils.rs:1938-1942 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1465-1469 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1478-1482 | rust_port/crates/flow_typing_flow_js/src/flow_js.rs:1531-1535 | rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1413-1415 — 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 `rust_port/crates/flow_typing/src/env_resolution.rs:506` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust_port/crates/flow_typing/src/env_resolution.rs:506` calls `Err`, `TimedOut` and `rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1413` 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 × 4) · ×1
  • Duplicated block (4–5 lines × 4) rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2704 — rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2704-2707 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2759-2763 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2778-2781 | rust_port/crates/flow_env_builder_resolver/src/name_resolver.rs:2798-2802 — 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 (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8154 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8154-8157 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8908-8912 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8996-9000 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:8154` it does not close everything it opens, so those 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 × 5) · ×1
  • Duplicated block (13 lines × 5) rust_port/crates/flow_codemods/src/annotate_exports.rs:35 — rust_port/crates/flow_codemods/src/annotate_exports.rs:35-47 | rust_port/crates/flow_codemods/src/annotate_literal_declarations.rs:23-35 | rust_port/crates/flow_codemods/src/annotate_optional_properties.rs:71-83 | rust_port/crates/flow_codemods/src/remove_react_import.rs:90-102 | rust_port/crates/flow_services_code_action/src/insert_type_utils.rs:62-74 — before extracting anything, compare `rust_port/crates/flow_codemods/src/annotate_exports.rs` and `rust_port/crates/flow_codemods/src/annotate_optional_properties.rs` 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. If that is what happened, the fix is to keep one copy and have the 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 `i` to `usize` in one and `i64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) rust_port/crates/flow_typing_utils/src/type_env.rs:1457 — rust_port/crates/flow_typing_utils/src/type_env.rs:1457-1467 | rust_port/crates/flow_typing_utils/src/type_env.rs:1471-1481 | rust_port/crates/flow_typing_utils/src/type_env.rs:1485-1495 | rust_port/crates/flow_typing_utils/src/type_env.rs:1499-1509 | rust_port/crates/flow_typing_utils/src/type_env.rs:1513-1524 | rust_port/crates/flow_typing_utils/src/type_env.rs:1530-1540 — 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 `rust_port/crates/flow_typing_utils/src/type_env.rs:1513` it does not close everything it opens, so those 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 (7 lines × 13) · ×1
  • Duplicated block (7 lines × 13) rust_port/crates/flow_cli/src/agent_helper_command.rs:254 — rust_port/crates/flow_cli/src/agent_helper_command.rs:254-262 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:94-101 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:201-208 | rust_port/crates/flow_cli/src/apply_code_action_command.rs:300-307 | rust_port/crates/flow_cli/src/autocomplete_command.rs:167-173 | rust_port/crates/flow_cli/src/autofix_command.rs:177-184 | rust_port/crates/flow_cli/src/autofix_command.rs:349-356 | rust_port/crates/flow_cli/src/autofix_command.rs:518-524 | rust_port/crates/flow_cli/src/check_contents_command.rs:73-80 | rust_port/crates/flow_cli/src/coverage_command.rs:382-388 | rust_port/crates/flow_cli/src/dump_types_command.rs:158-166 | rust_port/crates/flow_cli/src/inlay_hint_command.rs:101-109 | rust_port/crates/flow_cli/src/type_of_name_command.rs:168-176 — before extracting anything, compare `rust_port/crates/flow_cli/src/agent_helper_command.rs` and `rust_port/crates/flow_cli/src/dump_types_command.rs` as WHOLE FILES: this scan already matched 4 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 `rust_port/crates/flow_cli/src/dump_types_command.rs: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. 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, `rust_port/crates/flow_cli/src/autofix_command.rs:184` calls `get`, `truthy`, `unwrap` and `rust_port/crates/flow_cli/src/agent_helper_command.rs:262` 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 × 10) · ×1
  • Duplicated block (6 lines × 10) rust_port/crates/flow_typing_statement/src/type_annotation.rs:2292 — rust_port/crates/flow_typing_statement/src/type_annotation.rs:2292-2298 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2432-2438 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2679-2685 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2702-2707 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2804-2809 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2826-2832 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2910-2915 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2919-2924 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2940-2945 | rust_port/crates/flow_typing_statement/src/type_annotation.rs:2967-2972 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust_port/crates/flow_typing_statement/src/type_annotation.rs:2292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 15) · ×1
  • Duplicated block (5 lines × 15) rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9422 — rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9422-9426 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9433-9437 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9465-9469 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9472-9476 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9479-9483 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9500-9504 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9515-9519 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9522-9526 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9529-9533 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9536-9540 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9543-9547 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9568-9572 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9604-9608 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9611-9615 | rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9618-9622 — 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 `rust_port/crates/flow_type_sig/src/type_sig_parse.rs:9422` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Node.js 16 packages/eslint-plugin-fb-flow/package.json:29 — packages/eslint-plugin-fb-flow/package.json declares Node.js 16 as this project's engines.node, and Node.js 16, support ended 2023-09-11. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2023-09-11 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 224 typed · 9208 plain JS — the untyped files are evals/evals/01_error_fixing/error_001_refinement_invalidation/ideal/main.js, evals/evals/01_error_fixing/error_001_refinement_invalidation/input/main.js, evals/evals/01_error_fixing/error_002_exact_object_types/ideal/main.js, evals/evals/01_error_fixing/error_002_exact_object_types/input/main.js, evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js, evals/evals/01_error_fixing/error_003_unknown_type_refinement/input/main.js (+9202 more). 0 production file(s) opt out entirely with @ts-nocheck · 11 @ts-ignore suppression(s).
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (19 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (19 clone groups) packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4 — 19 duplicated blocks under packages/ have copies in at least two of the sibling directories flow-api-translator, flow-dev-tools, flow-estree, flow-transform, flow-typed, flow-upgrade — 12 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 14 sibling directories (16 clone groups) · ×1
  • Duplication concentrated across 14 sibling directories (16 clone groups) newtests/lsp/queries/outline.js:3 — 16 duplicated blocks under newtests/lsp/ have copies in at least two of the sibling directories auto_close_jsx, completion, connection, documentHighlight, document_paste, edits (+8 more sibling(s) not listed) — 8 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (5 clone groups) evals/evals/02_unique_features/enum_001_string_enum_cast/ideal/main.js:32 — 5 duplicated blocks under evals/evals/02_unique_features/ have copies in at least two of the sibling directories component_006_rest_params, component_008_ref_param, component_025_migrate_forwardref, enum_001_string_enum_cast, enum_003_boolean_symbol, hook_003_hook_type_annotation (+1 more sibling(s) not listed) — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (89 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (89 matched lines × 2 locations) REDACTED:32 — REDACTED:32 · REDACTED:40 — the two spans are one implementation copied and then locally edited — 526 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (56 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (56 matched lines × 2 locations) evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/ideal/main.js:18 — evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/ideal/main.js:18 · evals/evals/04_ts_to_flow/nominal_classes_interface_bridge/input/source.ts:4 — the two spans are one implementation copied and then locally edited — 368 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (54 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (54 matched lines × 2 locations) packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4 — packages/flow-dev-tools/flow-typed/npm/glob_v7.x.x.js:4 · packages/flow-typed/glob.js:13 — the two spans are one implementation copied and then locally edited — 420 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (48 matched lines × 2 locations) evals/evals/02_unique_features/hook_005_conditional_call/ideal/main.js:13 — evals/evals/02_unique_features/hook_005_conditional_call/ideal/main.js:13 · evals/evals/02_unique_features/hook_005_conditional_call/input/main.js:13 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (46 lines × 16 locations) · ×1
  • Duplicated block (46 lines × 16 locations) newtests/lsp/signatureHelp/test.js:875 — newtests/lsp/signatureHelp/test.js:875 · newtests/lsp/signatureHelp/test.js:921 · newtests/lsp/signatureHelp/test.js:967 · newtests/lsp/signatureHelp/test.js:1013 · +12 more site(s) not listed — all 16 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×1
  • Duplicated block (43 lines × 2 locations) packages/flow-typed/jest.js:332 — packages/flow-typed/jest.js:332 · packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:762 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×1
  • Duplicated block (40 lines × 2 locations) newtests/lsp/signatureHelp/test.js:1893 — newtests/lsp/signatureHelp/test.js:1893 · newtests/lsp/signatureHelp/test.js:1962 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (39 lines × 6 locations) · ×1
  • Duplicated block (39 lines × 6 locations) newtests/lsp/signatureHelp/test.js:1592 — newtests/lsp/signatureHelp/test.js:1592 · newtests/lsp/signatureHelp/test.js:1631 · newtests/lsp/signatureHelp/test.js:1670 · newtests/lsp/signatureHelp/test.js:1709 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) packages/flow-dev-tools/flow-typed/node.js:307 — packages/flow-dev-tools/flow-typed/node.js:307 · packages/flow-dev-tools/flow-typed/node.js:364 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block (37 lines × 21 locations) · ×1
  • Duplicated block (37 lines × 21 locations) newtests/lsp/signatureHelp/test.js:2034 — newtests/lsp/signatureHelp/test.js:2034 · newtests/lsp/signatureHelp/test.js:2071 · newtests/lsp/signatureHelp/test.js:2109 · newtests/lsp/signatureHelp/test.js:2147 · +17 more site(s) not listed — all 21 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block with local edits (33 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (33 matched lines × 2 locations) packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:537 — packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:537 · packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:667 — the two spans are one implementation copied and then locally edited — 185 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 (32 lines × 2 locations) · ×1
  • Duplicated block (32 lines × 2 locations) evals/evals/02_unique_features/hook_007_migrate_basic/ideal/main.js:12 — evals/evals/02_unique_features/hook_007_migrate_basic/ideal/main.js:12 · evals/evals/02_unique_features/hook_007_migrate_basic/input/main.js:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (32 lines × 6 locations) · ×1
  • Duplicated block (32 lines × 6 locations) newtests/lsp/signatureHelp/test.js:153 — newtests/lsp/signatureHelp/test.js:153 · newtests/lsp/signatureHelp/test.js:185 · newtests/lsp/signatureHelp/test.js:217 · newtests/lsp/signatureHelp/test.js:249 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (31 lines × 7 locations) · ×1
  • Duplicated block (31 lines × 7 locations) newtests/lsp/signatureHelp/test.js:587 — newtests/lsp/signatureHelp/test.js:587 · newtests/lsp/signatureHelp/test.js:618 · newtests/lsp/signatureHelp/test.js:649 · newtests/lsp/signatureHelp/test.js:680 · +3 more site(s) not listed — all 7 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (31 lines × 10 locations) · ×1
  • Duplicated block (31 lines × 10 locations) newtests/lsp/signatureHelp/test.js:2829 — newtests/lsp/signatureHelp/test.js:2829 · newtests/lsp/signatureHelp/test.js:2860 · newtests/lsp/signatureHelp/test.js:2892 · newtests/lsp/signatureHelp/test.js:2924 · +6 more site(s) not listed — all 10 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) packages/flow-dev-tools/flow-typed/node.js:2782 — packages/flow-dev-tools/flow-typed/node.js:2782 · packages/flow-dev-tools/flow-typed/node.js:2851 — 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 (30 lines × 5 locations) · ×1
  • Duplicated block (30 lines × 5 locations) newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:472 — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:472 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:502 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:532 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:562 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (30 lines × 8 locations) · ×1
  • Duplicated block (30 lines × 8 locations) newtests/lsp/signatureHelp/test.js:2848 — newtests/lsp/signatureHelp/test.js:2848 · newtests/lsp/signatureHelp/test.js:2880 · newtests/lsp/signatureHelp/test.js:2912 · newtests/lsp/signatureHelp/test.js:2944 · +4 more site(s) not listed — all 8 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:150 — packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:150 · packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:233 — 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 with local edits (29 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (29 matched lines × 2 locations) evals/evals/02_unique_features/hook_004_mutation_prevention/ideal/main.js:13 — evals/evals/02_unique_features/hook_004_mutation_prevention/ideal/main.js:13 · evals/evals/02_unique_features/hook_004_mutation_prevention/input/main.js:13 — the two spans are one implementation copied and then locally edited — 176 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) REDACTED:2954 — REDACTED:2954 · REDACTED:3001 — 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 with local edits (27 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (27 matched lines × 2 locations) evals/evals/01_error_fixing/error_025_object_this_reference/ideal/main.js:13 — evals/evals/01_error_fixing/error_025_object_this_reference/ideal/main.js:13 · evals/evals/01_error_fixing/error_025_object_this_reference/input/main.js:13 — the two spans are one implementation copied and then locally edited — 190 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (27 lines × 21 locations) · ×1
  • Duplicated block (27 lines × 21 locations) newtests/lsp/code-action/quickfix/match/test.js:21 — newtests/lsp/code-action/quickfix/match/test.js:21 · newtests/lsp/code-action/quickfix/match/test.js:48 · newtests/lsp/code-action/quickfix/match/test.js:75 · newtests/lsp/code-action/quickfix/match/test.js:102 · +17 more site(s) not listed — all 21 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (26 lines × 9 locations) · ×1
  • Duplicated block (26 lines × 9 locations) lib/lib.es5.js:1993 — lib/lib.es5.js:1993 · lib/lib.es5.js:2275 · lib/lib.es5.js:2557 · lib/lib.es5.js:2838 · +5 more site(s) not listed — all 9 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (26 lines × 4 locations) · ×1
  • Duplicated block (26 lines × 4 locations) newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:77 — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:77 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:103 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:129 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:155 — all 4 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (25 matched lines × 2 locations) evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js:10 — evals/evals/01_error_fixing/error_003_unknown_type_refinement/ideal/main.js:10 · evals/evals/01_error_fixing/error_003_unknown_type_refinement/input/main.js:10 — the two spans are one implementation copied and then locally edited — 119 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function (top-level) (cyclomatic 1153, cognitive 1152) · ×1
  • Complex function (top-level) (cyclomatic 1153, cognitive 1152) tests/type_printer/types.js:5 — (top-level) has cyclomatic complexity 1153 and cognitive complexity 1152; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 259, cognitive 450) · ×1
  • Complex function (anonymous) (cyclomatic 259, cognitive 450) tests/refinements/invalidation.js:41 — (anonymous) has cyclomatic complexity 259 and cognitive complexity 450; 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 handleSpecialObjectCompare (cyclomatic 107, cognitive 143) · ×1
  • Complex function handleSpecialObjectCompare (cyclomatic 107, cognitive 143) packages/flow-parser/test/esprima_test_runner.js:56 — handleSpecialObjectCompare has cyclomatic complexity 107 and cognitive complexity 143; 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 (top-level) (cyclomatic 95, cognitive 94) · ×1
  • Complex function (top-level) (cyclomatic 95, cognitive 94) tests/disjoint_union_perf/jsAst.js:4 — (top-level) has cyclomatic complexity 95 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function GenericTypeAnnotation (cyclomatic 81, cognitive 37) · ×1
  • Complex function GenericTypeAnnotation (cyclomatic 81, cognitive 37) REDACTED:2491 — GenericTypeAnnotation has cyclomatic complexity 81 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (top-level) (cyclomatic 77, cognitive 76) · ×1
  • Complex function (top-level) (cyclomatic 77, cognitive 76) tests/enums/refinement.js:6 — (top-level) has cyclomatic complexity 77 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 71, cognitive 105) · ×1
  • Complex function (anonymous) (cyclomatic 71, cognitive 105) tests/refinements/invalidation.js:235 — (anonymous) has cyclomatic complexity 71 and cognitive complexity 105; 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 (anonymous) (cyclomatic 66, cognitive 101) · ×1
  • Complex function (anonymous) (cyclomatic 66, cognitive 101) tests/refinements/invalidation.js:183 — (anonymous) has cyclomatic complexity 66 and cognitive complexity 101; 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 (top-level) (cyclomatic 56, cognitive 31) · ×1
  • Complex function (top-level) (cyclomatic 56, cognitive 31) tests/switch_case_typing/test.js:1 — (top-level) has cyclomatic complexity 56 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (top-level) (cyclomatic 48, cognitive 45) · ×1
  • Complex function (top-level) (cyclomatic 48, cognitive 45) tests/sketchy_null_default/test.js:7 — (top-level) has cyclomatic complexity 48 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function transform (cyclomatic 47, cognitive 23) · ×1
  • Complex function transform (cyclomatic 47, cognitive 23) packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:33 — transform has cyclomatic complexity 47 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function eliminateAbstractComponent (cyclomatic 43, cognitive 22) · ×1
  • Complex function eliminateAbstractComponent (cyclomatic 43, cognitive 22) packages/flow-upgrade/src/codemods/eliminateAbstractComponent.js:19 — eliminateAbstractComponent has cyclomatic complexity 43 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runTest (cyclomatic 35, cognitive 55) · ×1
  • Complex function runTest (cyclomatic 35, cognitive 55) packages/flow-parser/test/esprima_test_runner.js:457 — runTest has cyclomatic complexity 35 and cognitive complexity 55; 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 convertClassMember (cyclomatic 32, cognitive 26) · ×1
  • Complex function convertClassMember (cyclomatic 32, cognitive 26) packages/flow-api-translator/src/flowToFlowDef.js:1499 — convertClassMember has cyclomatic complexity 32 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (top-level) (cyclomatic 31, cognitive 38) · ×1
  • Complex function (top-level) (cyclomatic 31, cognitive 38) tests/constant_condition/unary_not.js:1 — (top-level) has cyclomatic complexity 31 and cognitive complexity 38; 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 (top-level) (cyclomatic 31, cognitive 30) · ×1
  • Complex function (top-level) (cyclomatic 31, cognitive 30) src/parser/test/flow/expression/conditional/deeply_nested_parenthesized_consequents.js:1 — (top-level) has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function attach (cyclomatic 30, cognitive 53) · ×1
  • Complex function attach (cyclomatic 30, cognitive 53) packages/flow-transform/src/transform/comments/prettier/main/comments.js:161 — attach has cyclomatic complexity 30 and cognitive complexity 53; 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 compare (cyclomatic 30, cognitive 50) · ×1
  • Complex function compare (cyclomatic 30, cognitive 50) packages/flow-parser/test/esprima_test_runner.js:376 — compare has cyclomatic complexity 30 and cognitive complexity 50; 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 DeclareExportDeclaration (cyclomatic 30, cognitive 40) · ×1
  • Complex function DeclareExportDeclaration (cyclomatic 30, cognitive 40) REDACTED:1384 — DeclareExportDeclaration has cyclomatic complexity 30 and cognitive complexity 40; 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 parse (cyclomatic 30, cognitive 36) · ×1
  • Complex function parse (cyclomatic 30, cognitive 36) packages/flow-parser/oxidized-src/FlowParser.js:176 — parse has cyclomatic complexity 30 and cognitive complexity 36; 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 f (cyclomatic 28, cognitive 31) · ×1
  • Complex function f (cyclomatic 28, cognitive 31) tests/new_generics/maybe.js:3 — f has cyclomatic complexity 28 and cognitive complexity 31; 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 runTestSuite (cyclomatic 27, cognitive 62) · ×1
  • Complex function runTestSuite (cyclomatic 27, cognitive 62) packages/flow-dev-tools/src/test/runTestSuite.js:46 — runTestSuite has cyclomatic complexity 27 and cognitive complexity 62; 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 compare (cyclomatic 26, cognitive 61) · ×1
  • Complex function compare (cyclomatic 26, cognitive 61) packages/flow-parser/__tests__/runWasmFixtures.js:243 — compare has cyclomatic complexity 26 and cognitive complexity 61; 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 ObjectTypeAnnotation (cyclomatic 25, cognitive 47) · ×1
  • Complex function ObjectTypeAnnotation (cyclomatic 25, cognitive 47) REDACTED:3802 — ObjectTypeAnnotation has cyclomatic complexity 25 and cognitive complexity 47; 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 runOnce (cyclomatic 24, cognitive 69) · ×1
  • Complex function runOnce (cyclomatic 24, cognitive 69) packages/flow-dev-tools/src/test/testRunner.js:38 — runOnce has cyclomatic complexity 24 and cognitive complexity 69; 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 compare (cyclomatic 24, cognitive 59) · ×1
  • Complex function compare (cyclomatic 24, cognitive 59) packages/flow-parser/test/hardcoded_test_runner.js:68 — compare has cyclomatic complexity 24 and cognitive complexity 59; 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 detectSourceType (cyclomatic 24, cognitive 30) · ×1
  • Complex function detectSourceType (cyclomatic 24, cognitive 30) packages/flow-parser/oxidized-src/FlowParser.js:396 — detectSourceType has cyclomatic complexity 24 and cognitive complexity 30; 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 _async_scope (cyclomatic 24, cognitive 23) · ×1
  • Complex function _async_scope (cyclomatic 24, cognitive 23) tests/constant_condition/err1/promise.js:1 — _async_scope has cyclomatic complexity 24 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateRendered (cyclomatic 23, cognitive 14) · ×1
  • Complex function validateRendered (cyclomatic 23, cognitive 14) packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts:63 — validateRendered has cyclomatic complexity 23 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getDiff (cyclomatic 22, cognitive 56) · ×1
  • Complex function getDiff (cyclomatic 22, cognitive 56) packages/flow-dev-tools/src/test/assertions/simpleDiffAssertion.js:27 — getDiff has cyclomatic complexity 22 and cognitive complexity 56; 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 logical (cyclomatic 22, cognitive 19) · ×1
  • Complex function logical (cyclomatic 22, cognitive 19) tests/unused_promise/test.js:37 — logical has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 22, cognitive 18) · ×1
  • Complex function main (cyclomatic 22, cognitive 18) src/__tests__/flow_dot_js_smoke_test.js:15 — main has cyclomatic complexity 22 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (top-level) (cyclomatic 21, cognitive 31) · ×1
  • Complex function (top-level) (cyclomatic 21, cognitive 31) tests/optional_chaining/refinements2.js:3 — (top-level) has cyclomatic complexity 21 and cognitive complexity 31; 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 handleClassComments (cyclomatic 21, cognitive 27) · ×1
  • Complex function handleClassComments (cyclomatic 21, cognitive 27) packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:381 — handleClassComments has cyclomatic complexity 21 and cognitive complexity 27; 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 (top-level) (cyclomatic 21, cognitive 20) · ×1
  • Complex function (top-level) (cyclomatic 21, cognitive 20) tests/constant_condition/string_literal.js:1 — (top-level) has cyclomatic complexity 21 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function convertExport (cyclomatic 21, cognitive 14) · ×1
  • Complex function convertExport (cyclomatic 21, cognitive 14) packages/flow-api-translator/src/flowToFlowDef.js:501 — convertExport has cyclomatic complexity 21 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DeclareClass (cyclomatic 20, cognitive 22) · ×1
  • Complex function DeclareClass (cyclomatic 20, cognitive 22) REDACTED:1150 — DeclareClass has cyclomatic complexity 20 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 convertExportDeclaration (cyclomatic 20, cognitive 22) · ×1
  • Complex function convertExportDeclaration (cyclomatic 20, cognitive 22) packages/flow-api-translator/src/flowToFlowDef.js:903 — convertExportDeclaration has cyclomatic complexity 20 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 VariableDeclarator (cyclomatic 20, cognitive 22) · ×1
  • Complex function VariableDeclarator (cyclomatic 20, cognitive 22) packages/flow-upgrade/src/codemods/collapseObjectInitialization.js:156 — VariableDeclarator has cyclomatic complexity 20 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 analyzePattern (cyclomatic 20, cognitive 16) · ×1
  • Complex function analyzePattern (cyclomatic 20, cognitive 16) packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:287 — analyzePattern has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · newtests/lsp/completion/test.js · ×1
  • newtests/lsp/completion/test.js: 10576 lines of code newtests/lsp/completion/test.js:1 — newtests/lsp/completion/test.js has 10576 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 · packages/flow-dev-tools/flow-typed/node.js · ×1
  • packages/flow-dev-tools/flow-typed/node.js: 5655 lines of code packages/flow-dev-tools/flow-typed/node.js:1 — packages/flow-dev-tools/flow-typed/node.js has 5655 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: 4645 lines of code REDACTED:1 — REDACTED has 4645 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 · lib/lib.es5.js · ×1
  • lib/lib.es5.js: 4010 lines of code lib/lib.es5.js:1 — lib/lib.es5.js has 4010 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 · newtests/lsp/documentSymbol/test.js · ×1
  • newtests/lsp/documentSymbol/test.js: 3629 lines of code newtests/lsp/documentSymbol/test.js:1 — newtests/lsp/documentSymbol/test.js has 3629 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 · newtests/lsp/signatureHelp/test.js · ×1
  • newtests/lsp/signatureHelp/test.js: 3577 lines of code newtests/lsp/signatureHelp/test.js:1 — newtests/lsp/signatureHelp/test.js has 3577 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 · packages/flow-estree/src/types.js · ×1
  • packages/flow-estree/src/types.js: 2158 lines of code packages/flow-estree/src/types.js:1 — packages/flow-estree/src/types.js has 2158 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 · packages/flow-api-translator/src/flowToFlowDef.js · ×1
  • packages/flow-api-translator/src/flowToFlowDef.js: 2063 lines of code packages/flow-api-translator/src/flowToFlowDef.js:1 — packages/flow-api-translator/src/flowToFlowDef.js has 2063 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: 1995 lines of code REDACTED:1 — REDACTED has 1995 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 · newtests/lsp/selectionRange/test.js · ×1
  • newtests/lsp/selectionRange/test.js: 1957 lines of code newtests/lsp/selectionRange/test.js:1 — newtests/lsp/selectionRange/test.js has 1957 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 · evals/flow-typed/environment/jsx.js · ×1
  • evals/flow-typed/environment/jsx.js: 1929 lines of code evals/flow-typed/environment/jsx.js:1 — evals/flow-typed/environment/jsx.js has 1929 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 · packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js · ×1
  • packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js: 1196 lines of code packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js:1 — packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js has 1196 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 · packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js · ×1
  • packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js: 972 lines of code packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js:1 — packages/flow-parser/oxidized-src/estree/TransformMatchSyntax.js has 972 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 · packages/flow-eslint/src/scope-manager/referencer/Referencer.js · ×1
  • packages/flow-eslint/src/scope-manager/referencer/Referencer.js: 934 lines of code packages/flow-eslint/src/scope-manager/referencer/Referencer.js:1 — packages/flow-eslint/src/scope-manager/referencer/Referencer.js has 934 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 · packages/flow-transform/src/transform/comments/prettier/language-js/comments.js · ×1
  • packages/flow-transform/src/transform/comments/prettier/language-js/comments.js: 903 lines of code packages/flow-transform/src/transform/comments/prettier/language-js/comments.js:1 — packages/flow-transform/src/transform/comments/prettier/language-js/comments.js has 903 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 · packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js · ×1
  • packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js: 828 lines of code packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:1 — packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js has 828 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 · packages/flow-typed/prettier.js · ×1
  • packages/flow-typed/prettier.js: 813 lines of code packages/flow-typed/prettier.js:1 — packages/flow-typed/prettier.js has 813 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 · packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js · ×1
  • packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js: 804 lines of code packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js:1 — packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js has 804 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 · newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js · ×1
  • newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js: 797 lines of code newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js:1 — newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js has 797 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 · packages/flow-remove-types/index.js · ×1
  • packages/flow-remove-types/index.js: 782 lines of code packages/flow-remove-types/index.js:1 — packages/flow-remove-types/index.js has 782 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 · packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js · ×1
  • packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js: 765 lines of code packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:1 — packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js has 765 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 · packages/flow-typed/jest.js · ×1
  • packages/flow-typed/jest.js: 751 lines of code packages/flow-typed/jest.js:1 — packages/flow-typed/jest.js has 751 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 · newtests/lsp/code-action/quickfix/react/test.js · ×1
  • newtests/lsp/code-action/quickfix/react/test.js: 685 lines of code newtests/lsp/code-action/quickfix/react/test.js:1 — newtests/lsp/code-action/quickfix/react/test.js has 685 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 · newtests/lsp/diagnostics/test.js · ×1
  • newtests/lsp/diagnostics/test.js: 617 lines of code newtests/lsp/diagnostics/test.js:1 — newtests/lsp/diagnostics/test.js has 617 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 · newtests/lsp/code-action/quickfix/match/test.js · ×1
  • newtests/lsp/code-action/quickfix/match/test.js: 601 lines of code newtests/lsp/code-action/quickfix/match/test.js:1 — newtests/lsp/code-action/quickfix/match/test.js has 601 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 · newtests/lsp/code-action/refactor/test.js · ×1
  • newtests/lsp/code-action/refactor/test.js: 587 lines of code newtests/lsp/code-action/refactor/test.js:1 — newtests/lsp/code-action/refactor/test.js has 587 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 · src/flow_dot_js_wasm.js · ×1
  • src/flow_dot_js_wasm.js: 527 lines of code src/flow_dot_js_wasm.js:1 — src/flow_dot_js_wasm.js has 527 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 · packages/flow-transform/src/transform/TransformContext.js · ×1
  • packages/flow-transform/src/transform/TransformContext.js: 521 lines of code packages/flow-transform/src/transform/TransformContext.js:1 — packages/flow-transform/src/transform/TransformContext.js has 521 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 · packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts · ×1
  • packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts: 461 lines of code packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts:1 — packages/flow-for-vscode/src/FlowLanguageClient/DetailedDiagnostics.ts has 461 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: 451 lines of code REDACTED:1 — REDACTED has 451 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 · packages/flow-eslint/src/scope-manager/scope/ScopeBase.js · ×1
  • packages/flow-eslint/src/scope-manager/scope/ScopeBase.js: 436 lines of code packages/flow-eslint/src/scope-manager/scope/ScopeBase.js:1 — packages/flow-eslint/src/scope-manager/scope/ScopeBase.js has 436 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 · packages/flow-parser/oxidized-src/FlowParser.js · ×1
  • packages/flow-parser/oxidized-src/FlowParser.js: 423 lines of code packages/flow-parser/oxidized-src/FlowParser.js:1 — packages/flow-parser/oxidized-src/FlowParser.js has 423 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 · packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js · ×1
  • packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js: 422 lines of code packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js:1 — packages/flow-eslint/src/scope-manager/referencer/TypeVisitor.js has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · The declared test suite includes a file that cannot be loaded · ×1
  • The declared test suite includes a file that cannot be loaded packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js:11 — This repository declares test tooling, and the ✓ above records that declaration — but packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/export/module-exports/typeof/import/spec.js and 65 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
R7 · Dead Code · Dead file (~10581 LoC) · ×1
  • Dead file (~10581 LoC) newtests/lsp/completion/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~6098 LoC) · ×1
  • Dead file (~6098 LoC) packages/flow-dev-tools/flow-typed/node.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~3631 LoC) · ×1
  • Dead file (~3631 LoC) newtests/lsp/documentSymbol/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~3604 LoC) · ×1
  • Dead file (~3604 LoC) newtests/lsp/signatureHelp/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~2165 LoC) · ×1
  • Dead file (~2165 LoC) evals/flow-typed/environment/jsx.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~1962 LoC) · ×1
  • Dead file (~1962 LoC) newtests/lsp/selectionRange/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~1235 LoC) · ×1
  • Dead file (~1235 LoC) packages/flow-upgrade/flow-typed/npm/jest_v27.x.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~881 LoC) · ×1
  • Dead file (~881 LoC) packages/flow-typed/prettier.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~871 LoC) · ×1
  • Dead file (~871 LoC) packages/flow-upgrade/flow-typed/npm/fs-extra_v10.x.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~799 LoC) · ×1
  • Dead file (~799 LoC) newtests/lsp/code-action/quickfix/ts_and_legacy_syntax/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~775 LoC) · ×1
  • Dead file (~775 LoC) packages/flow-typed/jest.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~770 LoC) · ×1
  • Dead file (~770 LoC) packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~687 LoC) · ×1
  • Dead file (~687 LoC) newtests/lsp/code-action/quickfix/react/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~624 LoC) · ×1
  • Dead file (~624 LoC) newtests/lsp/diagnostics/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~603 LoC) · ×1
  • Dead file (~603 LoC) newtests/lsp/code-action/quickfix/match/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~589 LoC) · ×1
  • Dead file (~589 LoC) newtests/lsp/code-action/refactor/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~486 LoC) · ×1
  • Dead file (~486 LoC) lib/misc.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~398 LoC) · ×1
  • Dead file (~398 LoC) newtests/lsp/completion/autoimports/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~343 LoC) · ×1
  • Dead file (~343 LoC) newtests/lsp/queries/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~328 LoC) · ×1
  • Dead file (~328 LoC) newtests/lsp/wait_for_recheck/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~316 LoC) · ×1
  • Dead file (~316 LoC) packages/flow-upgrade/flow-typed/npm/yargs_v17.x.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~306 LoC) · ×1
  • Dead file (~306 LoC) newtests/autofix-exports/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~292 LoC) · ×1
  • Dead file (~292 LoC) newtests/lsp/documentHighlight/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~263 LoC) · ×1
  • Dead file (~263 LoC) newtests/lsp/linkedEditingRange/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~241 LoC) · ×1
  • Dead file (~241 LoC) newtests/lsp/connection/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~235 LoC) · ×1
  • Dead file (~235 LoC) newtests/lsp/globalReferencesAndRename/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~232 LoC) · ×1
  • Dead file (~232 LoC) packages/flow-upgrade/flow-typed/npm/semver_v7.x.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~206 LoC) · ×1
  • Dead file (~206 LoC) newtests/lsp/code-action/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~175 LoC) · ×1
  • Dead file (~175 LoC) packages/flow-typed/node.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~174 LoC) · ×1
  • Dead file (~174 LoC) newtests/lsp/code-action/quickfix/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~159 LoC) · ×1
  • Dead file (~159 LoC) packages/flow-dev-tools/flow-typed/npm/chalk_v4.x.x.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~142 LoC) · ×1
  • Dead file (~142 LoC) packages/flow-typed/babel-parser.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~140 LoC) · ×1
  • Dead file (~140 LoC) newtests/lsp/code-action/quickfix/records/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~139 LoC) · ×1
  • Dead file (~139 LoC) newtests/lsp/completion/haste_package_auto_imports/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~137 LoC) · ×1
  • Dead file (~137 LoC) newtests/package_json_changes/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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 (~114 LoC) · ×1
  • Dead file (~114 LoC) newtests/lsp/code-action/refactor/readonly_conversion/test.js — no import path from any entry point (1085 application, 212 tooling, 8951 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
R8 · Dependency Hygiene · Unused dependency 'esbuild' · ×1
  • Unused dependency 'esbuild' — Declared in packages/flow-dev-tools/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'builtin-modules' · ×1
  • Unused dependency 'builtin-modules' — Declared in packages/flow-for-vscode/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'flow-bin' · ×1
  • Unused dependency 'flow-bin' — Declared in packages/flow-for-vscode/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'vsce' · ×1
  • Unused dependency 'vsce' — Declared in packages/flow-for-vscode/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'flow-remove-types' · ×1
  • Unused dependency 'flow-remove-types' — Declared in packages/scripts/bootstrap/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked tests/workspaces_test/package.json:4 — tests/workspaces_test/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X1 · Async correctness · `async` callback passed to `forEach` · ×1
  • `async` callback passed to `forEach` packages/flow-for-vscode/src/index.ts:106 — `forEach` ignores what its callback returns, so the Promise 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 rejection is never handled — in Node.js an unhandled rejection terminates the process by default, and in a browser it is lost. Iterate with `for (const item of items) { await … }` when the work must run in order, or `await Promise.all(items.map(async (item) => { … }))` 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.
Minor — 120 finding(s)
D24 · Comment Value · redundant comment · ×33
  • redundant comment evals/evals/03_project_patterns/relay_core/context/RelayHooks.js:22 — "Opaque type for a preloaded query reference." repeats the code it sits on: 4 of its 5 words (opaque, type, preloaded, query) are already in `export opaque type PreloadedQuery<out TQuery extends OperationType>: Readonly<{`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/babel-plugin-transform-flow-enums/__tests__/babel-plugin-transform-flow-enums-test.js:70 — "Test `getRuntime` plugin option" repeats the code it sits on: 4 of its 5 words (get, runtime, plugin, option) are already in `pluginTester({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/types/react/global/spec.js:14 — 5 comments in this file only repeat the code they sit on (lines 14, 17, 21, 23, 24), for example "React.ElementRef<typeof Component>". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-api-translator/__tests__/flowDefToTSDef/fixtures/types/react/import/spec.js:16 — 6 comments in this file only repeat the code they sit on (lines 16, 19, 20, 23, 25, 26), for example "React.ElementRef<typeof Component>". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-eslint/__tests__/hermes-scope/declare-export-test.js:58 — "you can only declare export types within a module" repeats the code it sits on: 4 of its 5 words (declare, export, types, module) are already in `verifyHasScopes(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-eslint/src/scope-manager/referencer/Visitor.js:60 — "Process the right hand nodes recursively." repeats the code it sits on: 4 of its 5 words (process, right, hand, nodes) are already in `if (options.processRightHandNodes === true)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-for-vscode/src/common/Logger.ts:26 — "max of keys LOG_LEVEL" repeats the code it sits on: 4 of its 4 words (max, keys, log, level) are already in `const MAX_LEVEL_LENGTH = Object.keys(LOG_LEVEL).reduce((maxLength, level) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-parser/__tests__/ImportExpression-test.js:57 — "Babel converts ImportExpression to CallExpression with Import callee" repeats the code it sits on: 5 of its 6 words (babel, import, expression, call, callee) are already in `expect(parseForSnapshot(testCase.code, {babel: true}))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-parser/oxidized-src/estree/StripFlowTypesForBabel.js:180 — "Convert to simple generic type annotation" repeats the code it sits on: 4 of its 5 words (simple, generic, type, annotation) are already in `return createSimpleGenericTypeAnnotation('symbol', node);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-parser/oxidized-src/estree/StripFlowTypesForBabel.js:184 — "Convert to simple generic type annotation" repeats the code it sits on: 4 of its 5 words (simple, generic, type, annotation) are already in `return createSimpleGenericTypeAnnotation('bigint', node);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-parser/oxidized-src/estree/TransformComponentSyntax.js:720 — "Scan for references to our component." repeats the code it sits on: 3 of its 3 words (scan, references, component) are already in `const referencePos = scanForFirstComponentReference(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:273 — "static build(node: Node, bigint: true): Stats<bigint>;" repeats the code it sits on: 5 of its 6 words (static, build, node, bigint, stats) are already in `static build(node: Node, bigint?: boolean): Stats<TStatNumber>;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:564 — "statSync( path: PathLike, options: { bigint: true, throwIfNoEntry?: true, }, ): Stats<bigint>;" repeats the code it sits on: 10 of its 11 words (stat, sync, path, like, options, bigint, throw, no, entry, stats) are already in `statSync(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-upgrade/src/findFlowFiles.js:82 — "Then process the file path as JavaScript." repeats the code it sits on: 5 of its 5 words (process, file, path, java, script) are already in `await processJavaScriptFilePath(filePath, stats.size);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-upgrade/src/findFlowFiles.js:107 — "Open the file path." repeats the code it sits on: 3 of its 3 words (open, file, path) are already in `const file = await fs.open(filePath, 'r');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/flow-upgrade/src/upgrade.js:97 — "Find all of the Flow files in the directory we are upgrading." repeats the code it sits on: 4 of its 5 words (find, flow, files, directory) are already in `const filePaths = await findFlowFilesWithSpinner(directory, options);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/parser/test/flow/types/function_types_with_anonymous_parameters/migrated_0019.js:1 — "string | (number => boolean)" repeats the code it sits on: 3 of its 3 words (string, number, boolean) are already in `type A = string | number => boolean;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/parser/test/flow/types/function_types_with_anonymous_parameters/migrated_0020.js:1 — "string & (number => boolean)" repeats the code it sits on: 3 of its 3 words (string, number, boolean) are already in `type A = string & number => boolean;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/parser/test/flow/types/function_types_with_anonymous_parameters/migrated_0024.js:1 — "string => (boolean | number)" repeats the code it sits on: 3 of its 3 words (string, boolean, number) are already in `type A = string => boolean | number;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/async_component_syntax/test.js:13 — "Async component with props" repeats the code it sits on: 3 of its 3 words (async, component, props) are already in `async component AsyncWithProps(foo: number, bar: string)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/async_component_syntax/test.js:34 — "Export async component" repeats the code it sits on: 3 of its 3 words (export, async, component) are already in `export async component ExportedAsync()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/async_component_syntax/test.js:50 — "Async hook with params" repeats the code it sits on: 3 of its 3 words (async, hook, params) are already in `async hook useAsyncHookWithParams(foo: number): Promise<number>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/async_component_syntax/test.js:62 — "Export async hook" repeats the code it sits on: 3 of its 3 words (export, async, hook) are already in `export async hook useExportedAsyncHook(): string`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/binding/rebinding.js:207 — "fn params name clash" repeats the code it sits on: 4 of its 4 words (fn, params, name, clash) are already in `function fn_params_name_clash(x: number, x: number /* error: x already bound */)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/exact_object_type/test.js:11 — "Every exact object type is an `ExactObjectType`" repeats the code it sits on: 3 of its 3 words (exact, object, type) are already in `exact as ExactObjectType;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 8 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×18
  • Duplicated predicate evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:30 — `message.length > 0 && message.length < 160` appears character-identically in 2 files — evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js, evals/evals/01_error_fixing/error_019_class_nominal_typing/input/main.js. 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 evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js:18 — `message.length > 0 && message.length < 500` appears character-identically in 2 files — evals/evals/01_error_fixing/error_019_class_nominal_typing/ideal/main.js, evals/evals/01_error_fixing/error_019_class_nominal_typing/input/main.js. 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 packages/flow-parser/oxidized-src/estree/StripFlowTypes.js:127 — `node.importKind === 'type' || node.importKind === 'typeof'` appears character-identically in 2 files — packages/flow-parser/oxidized-src/estree/StripFlowTypes.js, packages/flow-remove-types/index.js. 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 packages/flow-parser/oxidized-src/index.js:47 — `options.sourceType != null && options.sourceType !== 'script' && options.sourceType !== 'module'` appears character-identically in 2 files — packages/flow-parser/oxidized-src/index.js, packages/flow-remove-types/runnable-wasm.js. 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 packages/flow-bin/index.js:17 — `process.platform === 'linux' && process.arch === 'x64'` appears character-identically in 2 files — packages/flow-bin/index.js, packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts. 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 packages/flow-bin/index.js:21 — `process.platform === 'win32' && process.arch === 'x64'` appears character-identically in 2 files — packages/flow-bin/index.js, packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts. 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 REDACTED:357 — `variable.defs.length && variable.name === name` appears character-identically in 2 files — REDACTED, packages/flow-transform/src/traverse/traverse.js. 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 rust_port/crates/flow_services_inference/src/obj_to_obj_hook.rs:32 — `def_t.deref() && o.literal.is_expression()` appears character-identically in 2 files — rust_port/crates/flow_services_inference/src/obj_to_obj_hook.rs, rust_port/crates/flow_typing_ty_normalizer/src/no_flow.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:70 — `f.starts_with(sroot) || files::is_included(file_options, f)` appears character-identically in 2 files — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs, rust_port/crates/flow_services_inference/src/type_service.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:240 — `files::is_flow_file(file_options, f) && ((file_options.implicitly_include_root && f.starts_with(sroot)) || files::is_included(file_options, …` appears character-identically in 2 files — rust_port/crates/flow_server_rechecker/src/recheck_updates.rs, rust_port/crates/flow_services_inference/src/type_service.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_parser_utils/src/file_sig.rs:519 — `inner.quasis.len() == 1 && inner.expressions.is_empty()` appears character-identically in 2 files — rust_port/crates/flow_parser_utils/src/file_sig.rs, rust_port/crates/flow_typing_statement/src/statement.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_cli/src/check_contents_command.rs:97 — `json || json_version.is_some() || pretty` appears character-identically in 3 files — rust_port/crates/flow_cli/src/check_contents_command.rs, rust_port/crates/flow_cli/src/foreground_check_commands.rs, rust_port/crates/flow_cli/src/status_command.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs:10067 — `matches!(data.kind, ImplicitInstantiationTvarKind::Inferred) || env.restrictive_frozen_tvars()` appears character-identically in 2 files — rust_port/crates/flow_typing_flow_js/src/flow_js/dispatch.rs, rust_port/crates/flow_typing_flow_js/src/subtyping_kit.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_parsing/src/parsing_service.rs:239 — `options.enums || flow_common::files::has_ts_ext(file)` appears character-identically in 2 files — rust_port/crates/flow_parsing/src/parsing_service.rs, rust_port/crates/flow_type_sig/src/type_sig_options.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_cli/src/foreground_check_commands.rs:351 — `options_flags.quiet || json_flags.json || json_flags.pretty` appears character-identically in 2 files — rust_port/crates/flow_cli/src/foreground_check_commands.rs, rust_port/crates/flow_cli/src/start_command.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_env_builder/src/name_def.rs:2690 — `params.params.len() == 1 && params.rest.is_none()` appears character-identically in 2 files — rust_port/crates/flow_env_builder/src/name_def.rs, rust_port/crates/flow_parser/src/ast_utils.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_parser/src/expression_parser.rs:2262 — `postraw.starts_with("0x") || postraw.starts_with("0X")` appears character-identically in 2 files — rust_port/crates/flow_parser/src/expression_parser.rs, rust_port/crates/flow_parser/src/flow_lexer.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate rust_port/crates/flow_typing_errors/src/error_message.rs:1660 — `self.lower == other.lower && self.upper == other.upper` appears character-identically in 2 files — rust_port/crates/flow_typing_errors/src/error_message.rs, rust_port/crates/flow_typing_type/src/type_.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D30 · Dependency Vulnerabilities · Low CVE · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on Err · ×12
  • Silent fallback default on Err rust_port/crates/flow_cli/src/dev_tools_command.rs:60 — `get_bin` turns every `Err` into `"flow".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_cli/src/glean_runner.rs:740 — `extract_member_def` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_dev_tools/src/runtests/check_annotate_exports.rs:49 — `find_files` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_server_command_handler/src/command_handler.rs:4003 — `add_missing_imports` turns every `Err` into `Ok(vec![])` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_server_rechecker/src/recheck_updates.rs:99 — `assert_compatible_flowconfig_version` turns every `Err` into `true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_services_code_action/src/code_action_service.rs:574 — `insert_inferred_type_as_cast_code_actions` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_services_code_action/src/refactor_extract.rs:1252 — `extract_from_type_refactors` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_services_inference/src/type_service.rs:2523 — `assert_compatible_flowconfig_version` turns every `Err` into `true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_services_type_info/src/signature_help.rs:294 — `get_func` turns every `Err` into `Ok(vec![])` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_services_type_info/src/signature_help.rs:416 — `get_prop_of_obj_toplevel` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_typing_utils/src/predicate_kit.rs:1416 — `concrete_types_for_inspection` turns every `Err` into `Ok(Vec::new())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err rust_port/crates/flow_utils_find/src/lib.rs:37 — `hh_readdir` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
X4 · Structured logging · Interpolated log message defeats structured logging · ×11
  • Interpolated log message defeats structured logging rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:130 — `info!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_utils_concurrency/src/thread_pool.rs:158 — `debug!` at line 158 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_dfind/src/lib.rs:143 — `warn!` at line 143 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_dfind/src/lib.rs:187 — `warn!` at line 187 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:282 — `warn!` at line 282 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:406 — `debug!` at line 406 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:472 — `warn!` at line 472 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:480 — `warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:610 — `debug!` at line 610 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_daemon/src/daemon.rs:613 — `debug!` at line 613 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging rust_port/crates/flow_codemods/src/utils/codemod_runner.rs:95 — `info!` at line 95 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
D19 · Documentation Quality · Documentation · ×5
  • Documentation: no build, run or usage example packages/babel-plugin-transform-flow-enums/README.md:1 — `babel-plugin-transform-flow-enums` is a published package (`package.json` without `"private": true`) and neither `packages/babel-plugin-transform-flow-enums/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/flow-enums-runtime/README.md:1 — `flow-enums-runtime` is a published package (`package.json` without `"private": true`) and neither `packages/flow-enums-runtime/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/flow-estree/README.md:1 — `flow-estree` is a published package (`package.json` without `"private": true`) and neither `packages/flow-estree/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/flow-transform/README.md:1 — `flow-transform` is a published package (`package.json` without `"private": true`) and neither `packages/flow-transform/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example packages/try-flow-website-js/README.md:1 — `try-flow-website-js` is a published package (`package.json` without `"private": true`) and neither `packages/try-flow-website-js/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
M4 · Documentation accuracy · README/code drift · ×3
  • README/code drift README.md:105 — README.md links to `src/parser/README.md`, but `src/parser/README.md` 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.
  • README/code drift packages/flow-parser/README.md:21 — packages/flow-parser/README.md names React 19, but the manifest declares `react` ^18.3.1. 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.
  • README/code drift website/docs/react/refs.md:84 — website/docs/react/refs.md names React 19, but the manifest declares `react` ^18.3.1. 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.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 132 significant file(s) lose their only recent owner: rust_port/crates/flow_typing_debug/src/lib.rs, rust_port/crates/flow_lsp_server/src/flow_lsp.rs, rust_port/crates/flow_typing_flow_js/src/slice_utils.rs, rust_port/crates/flow_services_code_action/src/code_action_service.rs, rust_port/crates/flow_typing_type/src/type_util.rs, rust_port/crates/flow_parser/src/flow_lexer.rs, rust_port/crates/flow_env_builder/src/find_providers.rs, rust_port/crates/flow_common/src/reason.rs (+124 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: rust_port/crates/flow_env_builder/src/assertion_call_target.rs, rust_port/crates/flow_typing/src/declared_types.rs, rust_port/crates/flow_env_builder/src/nonvoid_return.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 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 (137 single-owned of 534 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; 534 of the 783 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: rust_port/crates/flow_parser_utils_output/src/js_layout_generator_test/inline_tests_part4.rs, rust_port/crates/flow_parser_utils/src/object_type_key.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found rust_port/crates/flow_parser_wasm/src/bin/codegen.rs: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 `rust_port/crates/flow_parser_wasm/src/bin/codegen.rs` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `isBitwiseANDToken` spells `AND` where 160 names in the project spell it `And` · ×1
  • `isBitwiseANDToken` spells `AND` where 160 names in the project spell it `And` packages/flow-estree/src/generated/predicates.js:1480 — 160 of 164 names in project repository spell the token `And` (160 of 164; unit: names in project repository containing `And`). Peers: test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/autofix-exports/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspNotification, lspIgnoreStatusAndCancellation, }) (newtests/lsp/auto_close_jsx/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/enums/test.js:13); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/match/test.js:12); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/react/test.js:11). Rename to `isBitwiseAndToken`. [rule N6]
D21 · Naming Consistency · `isLogicalANDToken` spells `AND` where 160 names in the project spell it `And` · ×1
  • `isLogicalANDToken` spells `AND` where 160 names in the project spell it `And` packages/flow-estree/src/generated/predicates.js:1500 — 160 of 164 names in project repository spell the token `And` (160 of 164; unit: names in project repository containing `And`). Peers: test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/autofix-exports/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspNotification, lspIgnoreStatusAndCancellation, }) (newtests/lsp/auto_close_jsx/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/enums/test.js:13); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/match/test.js:12); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/react/test.js:11). Rename to `isLogicalAndToken`. [rule N6]
D21 · Naming Consistency · `isBitwiseANDEqualToken` spells `AND` where 160 names in the project spell it `And` · ×1
  • `isBitwiseANDEqualToken` spells `AND` where 160 names in the project spell it `And` packages/flow-estree/src/generated/predicates.js:1570 — 160 of 164 names in project repository spell the token `And` (160 of 164; unit: names in project repository containing `And`). Peers: test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/autofix-exports/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspNotification, lspIgnoreStatusAndCancellation, }) (newtests/lsp/auto_close_jsx/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/enums/test.js:13); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/match/test.js:12); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/react/test.js:11). Rename to `isBitwiseAndEqualToken`. [rule N6]
D21 · Naming Consistency · `isLogicalANDEqualToken` spells `AND` where 160 names in the project spell it `And` · ×1
  • `isLogicalANDEqualToken` spells `AND` where 160 names in the project spell it `And` packages/flow-estree/src/generated/predicates.js:1580 — 160 of 164 names in project repository spell the token `And` (160 of 164; unit: names in project repository containing `And`). Peers: test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/autofix-exports/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspNotification, lspIgnoreStatusAndCancellation, }) (newtests/lsp/auto_close_jsx/test.js:10); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/enums/test.js:13); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/match/test.js:12); test.default({ lspStartAndConnect, lspStart, lspRequest, lspInitializeParams, lspRequestAndWaitUntilResponse, addFile, lspIgnoreStatusAndCancellation, }) (newtests/lsp/code-action/quickfix/react/test.js:11). Rename to `isLogicalAndEqualToken`. [rule N6]
D21 · Naming Consistency · `UseAT` spells `AT` where 13 names in the project spell it `At` · ×1
  • `UseAT` spells `AT` where 13 names in the project spell it `At` tests/type_at_pos_imports/import-alias.js:37 — 13 of 14 names in project repository spell the token `At` (13 of 14; unit: names in project repository containing `At`). Peers: String.charAt (lib/lib.es5.js:403); String.charCodeAt (lib/lib.es5.js:409); flowToJS.stripAtFlow (packages/flow-api-translator/src/flowToJS.js:23); DocblockUtils.removeAtFlowFromDocblock (packages/flow-api-translator/src/utils/DocblockUtils.js:17); normalize.snippetAt (packages/flow-dev-tools/src/test/assertions/normalize.js:114). Rename to `UseAt`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 7 of 22 project(s) overshoot their size bounds, lowering Project Cohesion to 4.1/10. The most over is `rust_port` (570123 LoC, 3061 module-visible types across 123 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.
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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 24/32 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/flow-bin`, `packages/flow-dev-tools`, `packages/flow-remove-types`, `packages/flow-upgrade` and 3 more.
P2 · Observability · Console output used as the logging channel · ×1
  • Console output used as the logging channel packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageProvider.ts:90 — `packages/flow-for-vscode/src/utils/LanguageClient/TypeCoverageFeature/TypeCoverageProvider.ts` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation package.json:19 — `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R8 · Dependency Hygiene · Test-only dependency 'esrecurse' in production deps · ×1
  • Test-only dependency 'esrecurse' in production deps packages/flow-eslint/package.json:26 — Only test files import it (first: packages/flow-eslint/__tests__/eslint-scope/get-declared-variables-test.js:39) — move it to devDependencies.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~1.3 `!` null assertions per 1k TypeScript source lines — 7 assertion(s) across the 5468 source line(s) of the 86 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/flow-for-vscode/src/handlers.ts (7). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 99 finding(s)
D10 · Test Quality · Skipped (documented) · ×89
  • Skipped (documented): (unnamed test) tests/unreachable/jsx_unreachable.js:5 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/union_new/issue-2232.js:19 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/union_new/test31.js:9 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/union_new/test31.js:13 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/type_at_pos_react/react_abstract_component.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/super/super.js:29 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/spread/lit_reason.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/spread/test4.js:2 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/sketchy_null_strict/non-strict.js:5 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/sketchy_null_strict/strict.js:5 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/sealed_tvars/regression_tests.js:94 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/refinements/loop_incorrect_invalidation_regression_test.js:4 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/refinements/super_member.js:11 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/refinements/super_member.js:20 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/rec/union-spread.js:11 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/rec/union-spread.js:13 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/react_abstract_component/test_prop.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/provider_havoc/empty.js:8 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/promises/all.js:28 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/promises/any.js:8 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/private_class_methods/test.js:31 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/private_class_methods/test.js:45 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/private_class_methods/test.js:57 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/private_class_fields/test.js:16 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) tests/private_class_fields/test.js:27 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • + 64 more in this group — see findings.md.
D24 · Comment Value · doc comments repeat the names · ×10
  • doc comments repeat the names lib/lib.es5.js:86 — 2 of 690 documented parameters and 50 of 878 summaries in `.` only repeat the member or parameter name (e.g. "A string value" for `string`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-api-translator/src/utils/ts-estree-ast-types.js:159 — 0 of 0 documented parameters and 5 of 312 summaries in `flow-api-translator` only repeat the member or parameter name (e.g. "The class body." for `body`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-dev-tools/flow-typed/node.js:5336 — 0 of 5 documented parameters and 2 of 81 summaries in `flow-dev-tools` only repeat the member or parameter name (e.g. "Returns an object with statistics about the V8 heap." for `getHeapStatistics`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-eslint/src/scope-manager/ScopeManager.js:57 — 0 of 5 documented parameters and 2 of 78 summaries in `flow-eslint` only repeat the member or parameter name (e.g. "All scopes" for `scopes`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-estree/src/types.js:2287 — 0 of 0 documented parameters and 2 of 11 summaries in `flow-estree` only repeat the member or parameter name (e.g. "Match patterns *" for `MatchPattern`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-typed/babel-parser.js:71 — 0 of 13 documented parameters and 1 of 136 summaries in `flow-packages-workspace` only repeat the member or parameter name (e.g. "Source filename." for `sourceFilename`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-parser/oxidized-src/transform/SimpleTransform.js:24 — 6 of 15 documented parameters and 1 of 61 summaries in `flow-parser` only repeat the member or parameter name (e.g. "Transform callback" for `TransformCallback`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-transform/src/transform/TransformContext.js:203 — 0 of 24 documented parameters and 1 of 70 summaries in `flow-transform` only repeat the member or parameter name (e.g. "Removes the specified comments" for `removeComments`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/flow-upgrade/flow-typed/npm/memfs_v3.4.x.js:238 — 0 of 9 documented parameters and 0 of 26 summaries in `flow-upgrade` only repeat the member or parameter name (e.g. "" for `link`). 6 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names newtests/lsp/signatureHelp/member_callee.js:5 — 0 of 21 documented parameters and 4 of 16 summaries in `newtests` only repeat the member or parameter name (e.g. "foo" for `foo`). Delete the restating tags, or add what the name does not say.

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-7472ef6e1cc94ad1b478d170f56cd575/history.json --exit-code 0 --source .14artifacts/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-7472ef6e1cc94ad1b478d170f56cd575/tree.json --exit-code 0 --source .1artifacts/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 packages/flow-parser/oxidized-src/generated .94artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .109artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 255 file(s) — `evals/evals/01_error_fixing/error_002_exact_object_types/input/main.js`, `evals/evals/01_error_fixing/error_004_exact_objects_extra_props/ideal/main.js`, `evals/evals/01_error_fixing/error_005_array_variance/ideal/main.js`, `evals/evals/01_error_fixing/error_007_property_variance/ideal/main.js`, `evals/evals/01_error_fixing/error_007_property_variance/input/main.js`, … (+250 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1d8d4-1336-7157-a7dc-012c4e294bcb · 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